Skip to content

Commit

Permalink
Merge pull request #223 from jhrozek/lock-raw-results-extractor
Browse files Browse the repository at this point in the history
OCPBUGS-3344: fetchraw: Lock down the PVCExtractorPod
  • Loading branch information
Vincent056 committed Sep 11, 2023
2 parents 18f6f65 + a571527 commit de62cfd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/fetchraw/compliancescans.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ func getPVCExtractorPodLabels(objName string) map[string]string {
}

func getPVCExtractorPod(objName, ns, image, claimName string) *corev1.Pod {
bFalse := false
bTrue := true

return &corev1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
Expand All @@ -308,6 +311,17 @@ func getPVCExtractorPod(objName, ns, image, claimName string) *corev1.Pod {
Name: "pv-extract-pod",
Image: image,
Command: []string{"sleep", "inf"},
SecurityContext: &corev1.SecurityContext{
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
},
Privileged: &bFalse,
RunAsNonRoot: &bTrue,
AllowPrivilegeEscalation: &bFalse,
SeccompProfile: &corev1.SeccompProfile{
Type: "RuntimeDefault",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "raw-results-vol",
Expand Down

0 comments on commit de62cfd

Please sign in to comment.