Skip to main content

Allowed Container Images

Type: Rule
ID: k8s-namespace-blocked-images
Source: v2/rules/k8s/namespace/allowed-images.yaml
Rego Source: blocked-images.rego
Labels: K8s, Namespace

Verify only container images specified in the Allowed List run within the Kubernetes namespace.

note

This rule requires K8s Namespace Discovery Evidence. See here for more details.

tip

Signed Evidence for this rule IS NOT required by default but is recommended.

warning

Rule requires evaluation with a target. Without one, it will be disabled unless the --all-evidence flag is provided.

Usage example

uses: k8s/namespace/allowed-images@v2
with:
images_to_include:
- docker.io/my_org/my_image1
- docker.io/my_org/my_image2

Mitigation

Ensures that only approved container images are running within the Kubernetes namespace, reducing the risk of introducing vulnerabilities or unapproved software.

Description

This rule ensures that only container images specified in the allowed list are running within the Kubernetes namespace. It performs the following steps:

  1. Iterates over the container images running in the namespace.
  2. Checks each image against the allowed list specified in the with.images_to_include configuration.
    • If an image is not in the allowed list, the rule flags it as a violation.

Evidence Requirements:

  • Evidence must be provided by the Scribe Platform's CLI tool through scanning Kubernetes resources.

Evidence Requirements

FieldValue
signedFalse
content_body_typegeneric
target_typedata
predicate_typehttp://scribesecurity.com/evidence/discovery/v0.1
labels- asset_type=namespace
- platform=k8s

Input Definitions

ParameterTypeRequiredDescription
images_to_includearrayFalseList of allowed container images.