kubescape/regolibrary

Add rego rule to check for windows securityContext compliance

Open

#317 aperta il 6 mar 2023

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Open Policy Agent (69 fork)auto 404
enhancementgood first issue

Metriche repository

Star
 (131 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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:

  • gmsaCredentialSpec
  • gmsaCredentialSpecName
  • hostProcess
  • runAsUserName

The equivalent rules should be named like so:

  • set-gmsacredentialspec-value
  • set-gmsacredentialspecname-value
  • set-hostprocess-true (checking also if WindowsHostProcessContainers feature flag is enabled in api-server)
  • runAsUserName

Guida contributor