Skip to content

Commit c470d3e

Browse files
Merge pull request #49 from IBM/bha-code-engine-fix
add security params based on code engine review
2 parents 2ffd5b1 + f71b826 commit c470d3e

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
@@ -156,7 +156,11 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
156156
)
157157
registrar.SecurityContext = &corev1.SecurityContext{RunAsNonRoot: util.False(),
158158
RunAsUser: func(uid int64) *int64 { return &uid }(0),
159-
Privileged: util.False()}
159+
Privileged: util.False(),
160+
SeccompProfile: &corev1.SeccompProfile{
161+
Type: corev1.SeccompProfileTypeRuntimeDefault,
162+
},
163+
}
160164
fillSecurityContextCapabilities(registrar.SecurityContext)
161165
registrar.ImagePullPolicy = s.getCSINodeDriverRegistrarPullPolicy()
162166
registrar.Resources = getSidecarResourceRequests(s.driver, constants.CSINodeDriverRegistrar)

0 commit comments

Comments
 (0)