Skip to content

Commit

Permalink
Removes privileged=true for flannel containers (#755)
Browse files Browse the repository at this point in the history
The ROS security audit of the M-Lab platform noted that flannel
containers were running with CAP_SYS_ADMIN, and that we should determine
if we could remove that capability. This was the result of setting
privileged=true in the securityContext for the pods. Looking at the
current documentation for flannel, their sample configurations explicity
set privileged=false, and grant only NET_ADMIN and NET_RAW capabilities.
This commit follows this same pattern for M-Lab's flannel pods.
  • Loading branch information
nkinkade authored Jan 4, 2023
1 parent 921fdac commit b56a580
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion k8s/daemonsets/core/flannel-physical.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@
},
},
securityContext: {
privileged: true,
privileged: false,
capabilities: {
add: [
'NET_ADMIN',
'NET_RAW',
],
},
},
volumeMounts: [
{
Expand Down
8 changes: 7 additions & 1 deletion k8s/daemonsets/core/flannel-virtual.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@
},
},
securityContext: {
privileged: true,
privileged: false,
capabilities: {
add: [
'NET_ADMIN',
'NET_RAW',
],
},
},
volumeMounts: [
{
Expand Down

0 comments on commit b56a580

Please sign in to comment.