Skip to content

Commit f71b826

Browse files
committed
add security params based on code engine review
1 parent 453b734 commit f71b826

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

config/manager/manager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ spec:
7171
name: manager
7272
securityContext:
7373
allowPrivilegeEscalation: false
74+
seccompProfile:
75+
type: RuntimeDefault
7476
capabilities:
7577
drop:
7678
- "ALL"

controllers/syncer/csi_controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ func (s *csiControllerSyncer) ensureContainersSpec() []corev1.Container {
158158
}
159159

160160
func (s *csiControllerSyncer) ensureContainer(name, image string, args []string) corev1.Container {
161-
sc := &corev1.SecurityContext{AllowPrivilegeEscalation: util.False()}
161+
sc := &corev1.SecurityContext{
162+
AllowPrivilegeEscalation: util.False(),
163+
SeccompProfile: &corev1.SeccompProfile{
164+
Type: corev1.SeccompProfileTypeRuntimeDefault,
165+
},
166+
}
162167
fillSecurityContextCapabilities(sc)
163168
return corev1.Container{
164169
Name: name,

controllers/syncer/csi_node.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
154154
)
155155
registrar.SecurityContext = &corev1.SecurityContext{RunAsNonRoot: util.False(),
156156
RunAsUser: func(uid int64) *int64 { return &uid }(0),
157-
Privileged: util.False()}
157+
Privileged: util.False(),
158+
SeccompProfile: &corev1.SeccompProfile{
159+
Type: corev1.SeccompProfileTypeRuntimeDefault,
160+
},
161+
}
158162
fillSecurityContextCapabilities(registrar.SecurityContext)
159163
registrar.ImagePullPolicy = s.getCSINodeDriverRegistrarPullPolicy()
160164
registrar.Resources = getSidecarResourceRequests(s.driver, constants.CSINodeDriverRegistrar)

0 commit comments

Comments
 (0)