kubescape/regolibrary
View on GitHubAdd rego rule to check for windows securityContext compliance
Open
#317 opened on Mar 6, 2023
enhancementgood first issue
Repository metrics
- Stars
- (131 stars)
- PR merge metrics
- (PR metrics pending)
Description
In order to support Windows system, we should add rego rules to check for securityContext parameters also for this OS.
Reading from the official documentation, we should implement a control for each of the following listed fields: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#windowssecuritycontextoptions-v1-core
So, the new checks to be added, are the following:
gmsaCredentialSpecgmsaCredentialSpecNamehostProcessrunAsUserName
The equivalent rules should be named like so:
set-gmsacredentialspec-valueset-gmsacredentialspecname-valueset-hostprocess-true(checking also ifWindowsHostProcessContainersfeature flag is enabled inapi-server)runAsUserName