Re: [PATCH v2 2/2] ssh: Add interface ssh_search_dir

Dominick Grift <[email protected]>
Newsgroups org.kernel.vger.selinux-refpolicy
Message-ID <[email protected]>
On Thu, Jun 20, 2019 at 05:41:38PM +0300, Alexander Miroshnichenko wrote:
> Create interface ssh_search_dir to allow ssh_server search for keys in non-standard location.
> 
> Signed-off-by: Alexander Miroshnichenko <[email protected]>
> ---
>  policy/modules/services/ssh.if | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/policy/modules/services/ssh.if b/policy/modules/services/ssh.if
> index 0941f133711e..51c64ded00c4 100644
> --- a/policy/modules/services/ssh.if
> +++ b/policy/modules/services/ssh.if
> @@ -680,6 +680,24 @@ interface(`ssh_agent_exec',`
>  	can_exec($1, ssh_agent_exec_t)
>  ')
>  
> +########################################
> +## <summary>
> +##      Search for keys in non-standard location
> +## </summary>
> +## <param name="domain">
> +##      <summary>
> +##      Domain allowed access.
> +##      </summary>
> +## </param>
> +#
> +interface(`ssh_search_dir',`
> +        gen_require(`
> +                type sshd_t;
> +        ')
> +
> +	allow sshd_t $1:dir search_dir_perms;

This is generally not allowed. The caller should generally be the source.
Regardless of the above. Keys should be in user home directories. I wonder what specific scenario prompted you to propose this interface?

> +')
> +
>  ########################################
>  ## <summary>
>  ##	Read ssh home directory content
> -- 
> 2.21.0
> 

-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift
signature.asc (application/pgp-signature, 659 B)
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCAAdFiEEujmXliIBLFTc2Y4AJXSOVTf5R2kFAl0LnR8ACgkQJXSOVTf5
R2lR4wv/ca0OCq/YHBE/YOv2Sc1iuAlw2MzLTVRrADrf2RfroeBhQJ4CbW7lytDl
9t6vGzv3zwjzuY6dAQ/8ZQFYvku6Qu6HozBNPAKFDtMfdwdYZmX+RSvc8Ckv8v/7
Kr7/L7JznMfkEIVQsXfur2K4fC8Qe08NzjB63h54olgZLOB4S1LGY4Ur48vp7e/8
t1/ey9i5KGBP41taR9S5C8WzJE8gdQfkbaf5V697zcrfw5Rcx05kiF2zovdLD5ep
qXkTlvmqVdlzpYEIxOG/6gx7W268ix3WpuFTlKO1H6EzzOM7UbUXIJ/yYPzP26iW
Oxb9lSQZ19IUg6pLfqxeDbbijHGNKt98IO/yz4rP+tQdYys6kMZlxe/shXLW8a7d
GzHbg0rjNImYgAe180NnNTJp7bFklzs3JX4D88w4F6QhURTGf5iYlIV+7IE4LguS
d7a2503r5FsbdzSscelmrbJAa0Q9vQ9Vcbwj7G0M4BFzg+s3s5EHzeQRJnacyNOH
2rPB6MZd
=6WS5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.