Skip to content

Conversation

confusedcrib
Copy link
Contributor

No description provided.

Copy link

DryRun Security Summary

The pull request introduces several security concerns, including hardcoded AWS credentials, excessive permissions granted to the service account, and potential exposure of the Docker socket, which could lead to unauthorized access, privilege escalation, and even container breakout and host-level compromise.

Expand for full summary

Summary:

The changes in this pull request introduce several security concerns that need to be addressed before merging. The primary issues include hardcoded AWS credentials, excessive permissions granted to the service account, and potential exposure of the Docker socket. These security vulnerabilities could lead to unauthorized access, privilege escalation, and even container breakout and host-level compromise.

To address these security concerns, the application security engineer should recommend the following:

  1. Secure Storage of Credentials: Replace the hardcoded AWS credentials with a secure method of storing and retrieving them, such as a secrets management service or environment variables.
  2. Principle of Least Privilege: Review the required permissions for the application and grant only the necessary access, avoiding broad, unnecessary permissions that could lead to privilege escalation.
  3. Docker Socket Risks: Carefully evaluate the need for mounting the Docker socket and, if possible, remove this mount or find a more secure alternative that limits the container's access to the host's Docker daemon.

By addressing these security vulnerabilities, the application can be deployed in a more secure manner, reducing the risk of potential attacks and unauthorized access.

Files Changed:

  • insecure-chart/templates/insecure-app.yaml: This file contains the Kubernetes manifest for the "insecure-app" deployment. The changes remove the securityContext block that granted the container privileged access, but it still exposes the AWS access key ID and secret access key directly in the environment variables. Additionally, the insecure-app-role grants the insecure-app-sa service account full access to pods, service accounts, and service account tokens, which is an excessive level of permissions. The container also continues to mount the host's Docker socket, which can allow the container to interact with the host's Docker daemon, potentially leading to container breakout and host-level compromise.

Code Analysis

We ran 9 analyzers against 1 file and 1 analyzer had findings. 8 analyzers had no findings.

Analyzer Findings
Secrets Analyzer 1 finding

Riskiness

🔴 Risk threshold exceeded.

View PR in the DryRun Dashboard.

@confusedcrib
Copy link
Contributor Author

Logo
Checkmarx One – Scan Summary & Details38dc546b-f15e-4c73-ab05-f863e824c0dc

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Container Running With Low UID /insecure-app.yaml: 37 Check if containers are running with low UID, which might cause conflicts with the host's user table.
MEDIUM Seccomp Profile Is Not Configured /insecure-app.yaml: 37 Containers should be configured with a secure Seccomp profile to restrict potentially dangerous syscalls
LOW No Drop Capabilities for Containers /insecure-app.yaml: 37 Sees if Kubernetes Drop Capabilities exists to ensure containers security context
LOW Pod or Container Without Security Context /insecure-app.yaml: 37 A security context defines privilege and access control settings for a Pod or Container

Fixed Issues

Severity Issue Source File / Package
HIGH Container Is Privileged /insecure-app.yaml: 39
MEDIUM Container Running With Low UID /insecure-app.yaml: 39
MEDIUM Seccomp Profile Is Not Configured /insecure-app.yaml: 39
LOW No Drop Capabilities for Containers /insecure-app.yaml: 39

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