Skip to content

Commit

Permalink
chore: update cilium-operator security context (#2755)
Browse files Browse the repository at this point in the history
* update cil-operator security context

* add security context to 1.14 template
  • Loading branch information
jshr-w authored May 30, 2024
1 parent 91d1e76 commit 6dabf70
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,44 @@ spec:
containerPort: 9963
hostPort: 9963
protocol: TCP
securityContext:
seLinuxOptions:
level: 's0'
# Running with spc_t since we have removed the privileged mode.
# Users can change it to a different type as long as they have the
# type available on the system.
type: 'spc_t'
capabilities:
add:
# Use to set socket permission
- CHOWN
# Used to terminate envoy child process
- KILL
# Used since cilium modifies routing tables, etc...
- NET_ADMIN
# Used since cilium creates raw sockets, etc...
- NET_RAW
# Used since cilium monitor uses mmap
- IPC_LOCK
# Used in iptables. Consider removing once we are iptables-free
- SYS_MODULE
# We need it for now but might not need it for >= 5.11 specially
# for the 'SYS_RESOURCE'.
# In >= 5.8 there's already BPF and PERMON capabilities
- SYS_ADMIN
# Could be an alternative for the SYS_ADMIN for the RLIMIT_NPROC
- SYS_RESOURCE
# Both PERFMON and BPF requires kernel 5.8, container runtime
# cri-o >= v1.22.0 or containerd >= v1.5.0.
# If available, SYS_ADMIN can be removed.
#- PERFMON
#- BPF
- DAC_OVERRIDE
- FOWNER
- SETGID
- SETUID
drop:
- ALL
livenessProbe:
httpGet:
host: "127.0.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,44 @@ spec:
containerPort: 9963
hostPort: 9963
protocol: TCP
securityContext:
seLinuxOptions:
level: 's0'
# Running with spc_t since we have removed the privileged mode.
# Users can change it to a different type as long as they have the
# type available on the system.
type: 'spc_t'
capabilities:
add:
# Use to set socket permission
- CHOWN
# Used to terminate envoy child process
- KILL
# Used since cilium modifies routing tables, etc...
- NET_ADMIN
# Used since cilium creates raw sockets, etc...
- NET_RAW
# Used since cilium monitor uses mmap
- IPC_LOCK
# Used in iptables. Consider removing once we are iptables-free
- SYS_MODULE
# We need it for now but might not need it for >= 5.11 specially
# for the 'SYS_RESOURCE'.
# In >= 5.8 there's already BPF and PERMON capabilities
- SYS_ADMIN
# Could be an alternative for the SYS_ADMIN for the RLIMIT_NPROC
- SYS_RESOURCE
# Both PERFMON and BPF requires kernel 5.8, container runtime
# cri-o >= v1.22.0 or containerd >= v1.5.0.
# If available, SYS_ADMIN can be removed.
#- PERFMON
#- BPF
- DAC_OVERRIDE
- FOWNER
- SETGID
- SETUID
drop:
- ALL
livenessProbe:
httpGet:
host: "127.0.0.1"
Expand Down

0 comments on commit 6dabf70

Please sign in to comment.