Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samba.setup: Run cephfs.vfs integration with SELinux booleans #80

Merged

Conversation

anoopcs9
Copy link
Collaborator

@anoopcs9 anoopcs9 commented Jan 29, 2024

Upon investigation following are the only AVCs from audit logs blocking us from running CephFS VFS integration.

type=AVC msg=audit(1706499792.666:8328): avc: denied { name_connect } for pid=75570 comm="msgr-worker-1" dest=3300 scontext=system_u:system_r:smbd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=1

Even though its misleading samba_load_libgfapi seems to be the only SELinux boolean that we require to run integration using VFS module for Ceph in Samba under Enforcing mode. This is clear from the allow rules defined for the boolean as follows:

$ sesearch -b samba_load_libgfapi -A
allow smbd_t packet_type:packet recv; [ samba_load_libgfapi ]:True
allow smbd_t packet_type:packet send; [ samba_load_libgfapi ]:True
allow smbd_t port_type:tcp_socket name_bind; [ samba_load_libgfapi ]:True
allow smbd_t port_type:tcp_socket name_connect; [ samba_load_libgfapi ]:True

Fixes #79

Upon investigation following are the only AVCs from audit logs blocking
us from running CephFS VFS integration.

. . .
type=AVC msg=audit(1706499792.666:8328): avc:  denied  { name_connect }
for  pid=75570 comm="msgr-worker-1" dest=3300 scontext=system_u:system_r:smbd_t:s0
tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=1
. . .

Even though its misleading 'samba_load_libgfapi' seems to be the only
SELinux boolean that we require to run integration using VFS module for
Ceph in Samba under Enforcing mode. This is clear from the allow rules
defined for the boolean as follows:

$ sesearch -b samba_load_libgfapi -A
allow smbd_t packet_type:packet recv; [ samba_load_libgfapi ]:True
allow smbd_t packet_type:packet send; [ samba_load_libgfapi ]:True
allow smbd_t port_type:tcp_socket name_bind; [ samba_load_libgfapi ]:True
allow smbd_t port_type:tcp_socket name_connect; [ samba_load_libgfapi ]:True

Signed-off-by: Anoop C S <[email protected]>
@anoopcs9 anoopcs9 marked this pull request as ready for review January 29, 2024 13:32
@anoopcs9 anoopcs9 requested a review from xhernandez January 29, 2024 13:33
@xhernandez xhernandez merged commit 0a9bb85 into samba-in-kubernetes:main Jan 30, 2024
6 checks passed
@anoopcs9 anoopcs9 deleted the run-cephfs.vfs-selinux-enforced branch March 11, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run CephFS VFS integration under SELinux Enforcing mode
2 participants