Skip to content

Commit

Permalink
[release-1.9] SC settings for ApiServerSource's Receive Adapter's con…
Browse files Browse the repository at this point in the history
…tainer/deployment (#6792)

This is an automated cherry-pick of #6788

```release-note
SecurityContext settings for ApiServerSource's Receive Adapter's container/deployment
```

Signed-off-by: Matthias Wessendorf <[email protected]>
Co-authored-by: Matthias Wessendorf <[email protected]>
  • Loading branch information
knative-prow-robot and matzew authored Mar 6, 2023
1 parent f634181 commit d89300c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/reconciler/apiserversource/resources/receive_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ func MakeReceiveAdapter(args *ReceiveAdapterArgs) (*appsv1.Deployment, error) {
},
},
},
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.Bool(false),
ReadOnlyRootFilesystem: ptr.Bool(true),
RunAsNonRoot: ptr.Bool(true),
Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}},
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ func TestMakeReceiveAdapters(t *testing.T) {
},
},
},
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.Bool(false),
ReadOnlyRootFilesystem: ptr.Bool(true),
RunAsNonRoot: ptr.Bool(true),
Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}},
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
},
},
},
},
Expand Down

0 comments on commit d89300c

Please sign in to comment.