-
Notifications
You must be signed in to change notification settings - Fork 180
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
Allow smbd to load libcephfs proxy conditionally #2555
Open
anoopcs9
wants to merge
1
commit into
fedora-selinux:rawhide
Choose a base branch
from
anoopcs9:smbd-load-cephfs-proxy-bool
base: rawhide
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Allow smbd to load libcephfs proxy conditionally #2555
anoopcs9
wants to merge
1
commit into
fedora-selinux:rawhide
from
anoopcs9:smbd-load-cephfs-proxy-bool
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anoopcs9
added a commit
to anoopcs9/sit-environment
that referenced
this pull request
Feb 4, 2025
For the time being, until the official fix[1] is available with standard selinux-policy packages, compile and insert a local SELinux policy to allow smbd to connect via unix stream sockets for proper fucntioning of libcephfs proxy. Refer comments from [2] for more details. [1] fedora-selinux/selinux-policy#2555 [2] samba-in-kubernetes#128 Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
The design for libcephfs proxy[1] was accepted sometime back with the corresponding implementation subsequently merged[2] into upstream Ceph. This additional way to integrate CephFS with Samba is comprised of two components. The daemon i.e, libcephfsd is responsible for creating the unix domain socket as a starting point of communication. On the other side proxy library, which is designed[3] to be loaded within smbd, connects to the already created socket and thereby communicates with the daemon. During the development and testing stages we happened to notice some AVC denial messages in the audit logs: type=AVC msg=audit(1738236295.070:1470): avc: denied { write } for pid=41822 comm="smbd[192.168.12" name="libcephfsd.sock" dev="tmpfs" ino=1908 scontext=system_u:system_r:smbd_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=sock_file permissive=1 type=AVC msg=audit(1738236295.070:1470): avc: denied { connectto } for pid=41822 comm="smbd[192.168.12" path="/run/libcephfsd.sock" scontext=system_u:system_r:smbd_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket permissive=1 Therefore we propose a new boolean - samba_load_libcephfs_proxy, off by default, to contain the necessary allow rules for smbd_t to operate in a proxy mode using libcephfs. [1] https://docs.ceph.com/en/latest/dev/libcephfs_proxy/ [2] ceph/ceph#58376 [3] https://gitlab.com/samba-team/samba/-/merge_requests/3792 Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
444f306
to
2aa8f77
Compare
anoopcs9
added a commit
to samba-in-kubernetes/sit-environment
that referenced
this pull request
Feb 5, 2025
For the time being, until the official fix[1] is available with standard selinux-policy packages, compile and insert a local SELinux policy to allow smbd to connect via unix stream sockets for proper fucntioning of libcephfs proxy. Refer comments from [2] for more details. [1] fedora-selinux/selinux-policy#2555 [2] #128 Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
@zpytela I hope rpm-build:fedora-41-x86_64 job failure is expected. |
@zpytela Can you please take a look at this change? |
zpytela
reviewed
Mar 3, 2025
optional_policy(` | ||
tunable_policy(`samba_load_libcephfs_proxy',` | ||
unconfined_stream_connect(smbd_t) | ||
rw_sock_files_pattern(smbd_t, var_run_t, var_run_t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which service creates and/or works with files with the var_run_t
type? A private type should be used in cases of allowing write access.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The design for libcephfs proxy was accepted sometime back with the corresponding implementation subsequently merged into upstream Ceph. This additional way to integrate CephFS with Samba is comprised of two components. The daemon i.e, libcephfsd is responsible for creating the unix domain socket as a starting point of communication. On the other side proxy library, which is designed to be loaded within smbd, connects to the already created socket and thereby communicates with the daemon.
During the development and testing stages we happened to notice some AVC denial messages in the audit logs:
Therefore we propose a new boolean - samba_load_libcephfs_proxy, off by default, to contain the necessary allow rules for smbd_t to operate in a proxy mode using libcephfs.