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

Rule ID AC_K8S_0080 broken #1604

Open
lisenet opened this issue Aug 18, 2023 · 0 comments
Open

Rule ID AC_K8S_0080 broken #1604

lisenet opened this issue Aug 18, 2023 · 0 comments

Comments

@lisenet
Copy link

lisenet commented Aug 18, 2023

  • terrascan version: 1.18.3
  • Operating System: Ubuntu 20.04 LTS

Description

Terrascan does not detect seccompProfile. This is a bug in a policy definition.

What I Did

Create a Kubernetes deployment configuration file with seccompProfile defined:

mkdir ./test

cat <<EOF > ./test/httpd-healthcheck.yml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd-healthcheck
  namespace: httpd-healthcheck
  labels:
    app: httpd-healthcheck
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpd-healthcheck
  template:
    metadata:
      name: httpd-healthcheck
      labels:
        app: httpd-healthcheck
    spec:
      securityContext:
        seccompProfile:
          type: "RuntimeDefault"
      containers:
        - name: httpd-healthcheck
          image: example/httpd-healthcheck:1.0.0
          securityContext:
            allowPrivilegeEscalation: false
            seccompProfile:
              type: "RuntimeDefault"
EOF

Run terrascan command against it:

cd ./temp/
terrascan scan -v -i k8s --scan-rules="AC_K8S_0080" ./test/

This is the output:

	Description    :	Default seccomp profile not enabled will make the container to make non-essential system calls
	File           :	healthcheck-deployment.yml
	Line           :	2
	Severity       :	MEDIUM
	Rule Name      :	secCompProfile
	Rule ID        :	AC_K8S_0080
	Resource Name  :	httpd-healthcheck
	Resource Type  :	kubernetes_deployment
	Category       :	Identity and Access Management

The policy is configured to look for secCompProfile when it should be seccompProfile.

See here.

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

No branches or pull requests

1 participant