Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure pubsubplus container securityContext & Fix checkov CKV_K8S_38 against Pod automountServiceAccountToken should be set to false unless necessary. #81

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sebay
Copy link

@sebay sebay commented Mar 26, 2024

Security scans improvement:

  1. Gatekeeper
    On top of pod securityContext, container securityContext can also be configured. It will be set on pubsubplus container.
    This is notably useful in constraint environment where gatekeeper policies expect certain securityContext on both pod and container.
spec:
  container:
    securityContext:
      runAsNonRoot: true
      runAsGroup: 1000001
      runAsUser: 1000001
      allowPrivilegeEscalation: false
      privileged: false
      capabilities:
        drop:
          - ALL
      seLinuxOptions:
        level: s0:c123,c456
        role: object_r
        type: svirt_sandbox_file_t
        user: system_u
      seccompProfile:
        type: RuntimeDefault
  1. Checkov CKV_K8S_38.
    Set automountServiceAccountToken=false. Mount token with projected volumes. Note the option is not optional as given both operator and created pubsubresource require token, projected volume is always mounted.

@sebay sebay changed the title Configure pubsubplus container securityContext Configure pubsubplus container securityContext & Fix checkov CKV_K8S_38 against Pod automountServiceAccountToken should be set to false unless necessary. Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant