-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set the seccomp profile for artifact gc to runtimedefault
Signed-off-by: Lukas Hankeln <lukashankeln@googlemail.com>
- Loading branch information
1 parent
a4fc318
commit c2a5458
Showing
5 changed files
with
40 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package common | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/utils/pointer" | ||
) | ||
|
||
func MinimalCtrSC() *corev1.SecurityContext { | ||
return &corev1.SecurityContext{ | ||
Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, | ||
Privileged: pointer.Bool(false), | ||
RunAsNonRoot: pointer.Bool(true), | ||
RunAsUser: pointer.Int64(8737), | ||
ReadOnlyRootFilesystem: pointer.Bool(true), | ||
AllowPrivilegeEscalation: pointer.Bool(false), | ||
SeccompProfile: &corev1.SeccompProfile{Type: "RuntimeDefault"}, | ||
} | ||
} | ||
|
||
func MinimalPodSC() *corev1.PodSecurityContext { | ||
return &corev1.PodSecurityContext{ | ||
RunAsNonRoot: pointer.Bool(true), | ||
RunAsUser: pointer.Int64(8737), | ||
SeccompProfile: &corev1.SeccompProfile{Type: "RuntimeDefault"}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters