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: Make adjustments to vfs_acl_xattr configuration #109

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playbooks/ansible/cluster-cephfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ samba_shares:
- name: share
samba:
options:
"acl_xattr:ignore system acls": "yes"
"acl_xattr:security_acl_name": "user.NTACL"
4 changes: 2 additions & 2 deletions playbooks/ansible/cluster-glusterfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ samba_shares:
- name: vol-replicate
samba:
options:
"acl_xattr:ignore system acls": "yes"
"acl_xattr:security_acl_name": "user.NTACL"
glusterfs:
type: "replicate"
subvolume_size: "{{ config.groups['cluster']|length }}"
Expand All @@ -92,7 +92,7 @@ samba_shares:
- name: vol-disperse
samba:
options:
"acl_xattr:ignore system acls": "yes"
"acl_xattr:security_acl_name": "user.NTACL"
glusterfs:
type: "disperse"
subvolume_size: 3
Expand Down
2 changes: 1 addition & 1 deletion playbooks/ansible/cluster-gpfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ samba_shares:
- name: share
samba:
options:
"acl_xattr:ignore system acls": "yes"
"acl_xattr:security_acl_name": "user.NTACL"

nsd_device: "/dev/vdb"
2 changes: 1 addition & 1 deletion playbooks/ansible/cluster-xfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ samba_shares:
- name: share
samba:
options:
"acl_xattr:ignore system acls": "yes"
"acl_xattr:security_acl_name": "user.NTACL"
xfs:
device: "/dev/vdb"
10 changes: 10 additions & 0 deletions playbooks/ansible/roles/samba.setup/files/smbd_dac_override.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

module smbd_dac_override 1.0;

require {
type smbd_t;
class capability dac_override;
}

#============= smbd_t ==============
allow smbd_t self:capability dac_override;
32 changes: 32 additions & 0 deletions playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,35 @@
search_string: "CTDB_SAMBA_SKIP_SHARE_CHECK"
line: "CTDB_SAMBA_SKIP_SHARE_CHECK=yes"
state: present

- name: Temporarily allow cap_dac_override for smbd from SELinux
when: config.be.variant == 'default'
block:
- name: Remove any existing policy package
command: semodule -r smbd_dac_override
failed_when: false

- name: Copy required type enforcement file
copy:
src: smbd_dac_override.te
dest: /tmp

- name: Compile SELinux module file
command: checkmodule -M -m -o smbd_dac_override.mod smbd_dac_override.te
args:
chdir: /tmp

- name: Build SELinux policy package
command: semodule_package -o smbd_dac_override.pp -m smbd_dac_override.mod
args:
chdir: /tmp

- name: Load SELinux policy package
command: semodule -i smbd_dac_override.pp
args:
chdir: /tmp

- name: Remove temporary policy files
file:
path: /tmp/smbd_dac_override.*
state: absent
30 changes: 30 additions & 0 deletions playbooks/ansible/roles/samba.setup/tasks/xfs/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
---
- name: Temporarily allow cap_dac_override for smbd from SELinux
block:
- name: Remove any existing policy package
command: semodule -r smbd_dac_override
failed_when: false

- name: Copy required type enforcement file
copy:
src: smbd_dac_override.te
dest: /tmp

- name: Compile SELinux module file
command: checkmodule -M -m -o smbd_dac_override.mod smbd_dac_override.te
args:
chdir: /tmp

- name: Build SELinux policy package
command: semodule_package -o smbd_dac_override.pp -m smbd_dac_override.mod
args:
chdir: /tmp

- name: Load SELinux policy package
command: semodule -i smbd_dac_override.pp
args:
chdir: /tmp

- name: Remove temporary policy files
file:
path: /tmp/smbd_dac_override.*
state: absent
Loading