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

Add support for 'gpfs.vfs' backend variant #90

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

xhernandez
Copy link
Collaborator

Now it's possible to use the 'vfs' variant of the GPFS backend. With it, the gpfs VFS module is automatically configured to be used by Samba.

The GPFS VFS module dynamically loads libgpfs.so library, which requires access to some resources that are not granted by default by SElinux. The Storage Scale product solves this by running smbd process unconfined, so the same solution has been applied here.

Now it's possible to use the 'vfs' variant of the GPFS backend. With it,
the gpfs VFS module is automatically configured to be used by Samba.

The GPFS VFS module dynamically loads libgpfs.so library, which requires
access to some resources that are not granted by default by SElinux. The
Storage Scale product solves this by running smbd process unconfined, so
the same solution has been applied here.

Signed-off-by: Xavi Hernandez <[email protected]>
@xhernandez
Copy link
Collaborator Author

This patch doesn't add any specific GPFS configuration, I think most of the default values are already ok, but I'll address that in a future patch. Also, acl_xattr is left enabled for now, but I think GPFS doesn't need it when vfs_gpfs is used.

Copy link
Collaborator

@spuiuk spuiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially thought we could use the se boolean samba_run_unconfined instead of relabelling the samba binary. However it appears I was wrong.

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/managing_confined_services/sect-managing_confined_services-samba-booleans

samba_run_unconfined
Having this Boolean enabled allows Samba to run unconfined scripts in the /var/lib/samba/scripts/ directory.

ACKing these changes.

@anoopcs9
Copy link
Collaborator

I initially thought we could use the se boolean samba_run_unconfined instead of relabelling the samba binary. However it appears I was wrong.

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/managing_confined_services/sect-managing_confined_services-samba-booleans

On top of it, looking at the following AVC, access is happening via character file.

type=AVC msg=audit(1710240306.758:12716): avc:  denied  { read } for pid=102773 comm="smbd[192.168.12" name="ss0" dev="devtmpfs" ino=120415 scontext=system_u:system_r:smbd_t:s0 tcontext=system_u:object_r:gpfs_device_t:s0 tclass=chr_file permissive=0

@anoopcs9 anoopcs9 merged commit ca8dab1 into samba-in-kubernetes:main Mar 14, 2024
7 checks passed
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.

3 participants