Skip to content

Add ConfigMap Code Injection Experiment#104

Open
r3k2 wants to merge 3 commits intoOperantAI:mainfrom
r3k2:configmap-pr-clean
Open

Add ConfigMap Code Injection Experiment#104
r3k2 wants to merge 3 commits intoOperantAI:mainfrom
r3k2:configmap-pr-clean

Conversation

@r3k2
Copy link

@r3k2 r3k2 commented Aug 26, 2025

Adds a new experiment to test ConfigMap code injection vulnerabilities in Kubernetes environments, demonstrating how untrusted ConfigMaps can execute arbitrary code within
containers.

Changes

  • Added experiments_configmap_injection.go implementing the ConfigMap injection experiment
  • Added configmap-code-injection.yaml example configuration
  • Registered the experiment in the experiments registry

Implementation Details

  • Creates a ConfigMap with user-defined script
  • Deploys a pod that mounts and executes the script
  • Verifies successful execution and checks for privilege escalation vectors
  • Properly cleans up all resources

Key Features

  • All parameters (scriptContent, mountPath, targetCommand) are required with validation
  • No hardcoded scripts - all test logic defined in YAML configuration
  • Follows existing Woodpecker experiment patterns

r3k2 added 3 commits August 18, 2025 21:17
  Tests if malicious code can be injected and executed via ConfigMaps.
  Attackers could use this to escalate privileges or exfiltrate data from pods that mount untrusted ConfigMaps.
  - Remove hardcoded script content from Go implementation
  - Make all parameters required (scriptContent, mountPath, targetCommand)
  - Clean up YAML example to be more concise and professional
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.

2 participants