Skip to content

Commit 0a9bb85

Browse files
anoopcs9xhernandez
authored andcommitted
samba.setup: Run cephfs.vfs integration with SELinux booleans
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]>
1 parent a4f28c5 commit 0a9bb85

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- name: Install python3-libsemanage. This is needed for the seboolean ansible command
3+
yum: name=python3-libsemanage state=present

playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@
22
- name: Prepare CephFS VFS support
33
when: config.be.variant == 'vfs'
44
block:
5+
- name: Process OS specific tasks
6+
include_tasks: "{{ include_file }}"
7+
with_first_found:
8+
- files: "{{ config.os[config.nodes[inventory_hostname].os].includes }}"
9+
loop_control:
10+
loop_var: include_file
11+
12+
- name: SELinux - Allow Samba to do tcp socket operations
13+
seboolean:
14+
# Name of the boolean is misleading in this context.
15+
# https://github.com/samba-in-kubernetes/sit-environment/issues/79
16+
name: samba_load_libgfapi
17+
state: yes
18+
persistent: yes
19+
520
- name: Install CephFS VFS module
621
yum:
722
name: samba-vfs-cephfs
823
state: present
924

10-
- name: Set selinux in permissive mode
11-
selinux:
12-
policy: targeted
13-
state: permissive
14-
1525
- name: Skip check of share path
1626
lineinfile:
1727
path: "{{ config.paths.ctdb.etc }}/events/legacy/50.samba.options"

0 commit comments

Comments
 (0)