ma-agents 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/bmad-customizations/cyber.customize.yaml +4 -0
- package/lib/bmad-customizations/cyber.md +2 -0
- package/lib/bmad-customizations/devops.customize.yaml +2 -0
- package/lib/bmad-customizations/devops.md +1 -0
- package/lib/bmad-workflows/cyber/generate-certs.md +6 -3
- package/lib/bmad-workflows/cyber/verify-docker-users.md +14 -0
- package/lib/bmad-workflows/cyber/verify-image-signature.md +13 -0
- package/lib/bmad-workflows/devops/sign-docker-image.md +15 -0
- package/package.json +1 -1
- package/skills/docker-hardening-verification/SKILL.md +24 -0
- package/skills/docker-hardening-verification/scripts/verify-hardening.sh +39 -0
- package/skills/docker-hardening-verification/skill.json +13 -0
- package/skills/docker-image-signing/SKILL.md +24 -0
- package/skills/docker-image-signing/scripts/sign-image.sh +33 -0
- package/skills/docker-image-signing/skill.json +13 -0
package/README.md
CHANGED
|
@@ -86,6 +86,8 @@ skills/code-review/
|
|
|
86
86
|
| `vercel-react-best-practices` | Web | 57 Performance rules for React and Next.js |
|
|
87
87
|
| `git-workflow-skill` | Git | Worktree-based feature branch workflow |
|
|
88
88
|
| `self-signed-cert` | Security | Automated Root CA and self-signed certificate generation |
|
|
89
|
+
| `docker-image-signing` | Security | Automated cryptographic signing for Docker images |
|
|
90
|
+
| `docker-hardening-verification` | Security | Audits images for least-privilege and OpenShift compatibility |
|
|
89
91
|
|
|
90
92
|
## Automated Skill Discovery
|
|
91
93
|
|
|
@@ -25,6 +25,10 @@ menu_items:
|
|
|
25
25
|
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/cyber/vault-secrets.md"
|
|
26
26
|
- title: "Generate Secure Certificates"
|
|
27
27
|
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/cyber/generate-certs.md"
|
|
28
|
+
- title: "Verify Image Signature"
|
|
29
|
+
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/cyber/verify-image-signature.md"
|
|
30
|
+
- title: "Verify Docker User Hardening"
|
|
31
|
+
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/cyber/verify-docker-users.md"
|
|
28
32
|
|
|
29
33
|
memories:
|
|
30
34
|
- "OWASP Top 10 2025 security patterns."
|
|
@@ -48,6 +48,8 @@ You must fully embody this agent's persona and follow all activation instruction
|
|
|
48
48
|
<item cmd="VM" workflow="{project-root}/_bmad/bmm/workflows/cyber/vault-secrets.md">[VM] Manage Vault Secrets</item>
|
|
49
49
|
<item cmd="GC" workflow="{project-root}/_bmad/bmm/workflows/cyber/generate-certs.md">[GC] Generate Secure Certificates</item>
|
|
50
50
|
<item cmd="SA" workflow="{project-root}/_bmad/bmm/workflows/cyber/security-audit.md">[SA] Run Comprehensive Security Audit</item>
|
|
51
|
+
<item cmd="VI" workflow="{project-root}/_bmad/bmm/workflows/cyber/verify-image-signature.md">[VI] Verify Image Signature</item>
|
|
52
|
+
<item cmd="VU" workflow="{project-root}/_bmad/bmm/workflows/cyber/verify-docker-users.md">[VU] Verify Docker User Hardening</item>
|
|
51
53
|
<item cmd="DA">[DA] Dismiss Agent</item>
|
|
52
54
|
</menu>
|
|
53
55
|
</agent>
|
|
@@ -23,6 +23,8 @@ menu_items:
|
|
|
23
23
|
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/devops/docker-compose-setup.md"
|
|
24
24
|
- title: "Deploy to Disconnected Environment"
|
|
25
25
|
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/devops/disconnected-deployment.md"
|
|
26
|
+
- title: "Sign Docker Image"
|
|
27
|
+
command: "/bmad-bmm-run-workflow {project-root}/_bmad/bmm/workflows/devops/sign-docker-image.md"
|
|
26
28
|
|
|
27
29
|
memories:
|
|
28
30
|
- "Helm dependency vendorization patterns."
|
|
@@ -47,6 +47,7 @@ You must fully embody this agent's persona and follow all activation instruction
|
|
|
47
47
|
<item cmd="CI" workflow="{project-root}/_bmad/bmm/workflows/devops/configure-infrastructure.md">[CI] Configure Infrastructure (PV/PVC/LB)</item>
|
|
48
48
|
<item cmd="DC" workflow="{project-root}/_bmad/bmm/workflows/devops/docker-compose-setup.md">[DC] Setup Docker Compose</item>
|
|
49
49
|
<item cmd="DD" workflow="{project-root}/_bmad/bmm/workflows/devops/disconnected-deployment.md">[DD] Disconnected Deployment Strategy</item>
|
|
50
|
+
<item cmd="SI" workflow="{project-root}/_bmad/bmm/workflows/devops/sign-docker-image.md">[SI] Sign Docker Image</item>
|
|
50
51
|
<item cmd="DA">[DA] Dismiss Agent</item>
|
|
51
52
|
</menu>
|
|
52
53
|
</agent>
|
|
@@ -7,9 +7,12 @@ Automated workflow for generating self-signed certificates using the `self-signe
|
|
|
7
7
|
1. **Load Skill**: Activate the `self-signed-cert` skill instructions.
|
|
8
8
|
2. **Requirement Analysis**: Determine common name (CN) and Subject Alternative Names (SANs).
|
|
9
9
|
3. **Execution**:
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
- **Linux/macOS**:
|
|
11
|
+
- `bash scripts/generate-cert.sh root my-internal-ca`
|
|
12
|
+
- `bash scripts/generate-cert.sh cert my-service localhost`
|
|
13
|
+
- **Windows**:
|
|
14
|
+
- `.\scripts\generate-cert.ps1 -Type root -Name my-internal-ca`
|
|
15
|
+
- `.\scripts\generate-cert.ps1 -Type cert -Name my-service -Dns localhost`
|
|
13
16
|
4. **Packaging**: Provide instructions for importing the cert into trust stores (OS, Browsers) or mounting in Kubernetes secrets.
|
|
14
17
|
5. **Security**: Ensure private keys are stored with restricted permissions (600).
|
|
15
18
|
6. **Rotation**: Offer a schedule for certificate renewal.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# verify-docker-users.md
|
|
2
|
+
# Docker User & Hardening Verification Workflow
|
|
3
|
+
|
|
4
|
+
This workflow guides the Cyber agent through auditing Docker images for proper user management and least privilege.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. **Inspect Metadata**:
|
|
8
|
+
- Use the `docker-hardening-verification` skill.
|
|
9
|
+
- Run: `bash skills/docker-hardening-verification/scripts/verify-hardening.sh {image_name}`.
|
|
10
|
+
2. **Audit Result Analysis**:
|
|
11
|
+
- **UID Check**: Confirm the defined user is non-zero.
|
|
12
|
+
- **Permissive Files**: Scan for world-writable files in common paths (/tmp, /etc, /var).
|
|
13
|
+
3. **Governance Check**: Ensure the image follows OpenShift/hardened cluster requirements (no root, arbitrary UID support).
|
|
14
|
+
4. **Reporting**: provide a high-level summary of hardening quality and mandatory fixes.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# verify-image-signature.md
|
|
2
|
+
# Docker Image Signature Verification Workflow
|
|
3
|
+
|
|
4
|
+
This workflow guides the Cyber agent through verifying that a Docker image has been properly signed.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. **Identify Image**: Get the image name and digest.
|
|
8
|
+
2. **Locate Public Key**: Obtain the public key or certificate used for signing.
|
|
9
|
+
3. **Execute Verification**:
|
|
10
|
+
- Use `cosign verify --key {public_key} {image_digest}`.
|
|
11
|
+
- Check the output for valid signatures.
|
|
12
|
+
4. **Policy Compliance**: Verify if the signing entity (certificate CN) matches the expected trusted authorities.
|
|
13
|
+
5. **Report**: Alert the user if the image is unsigned or the signature is invalid.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# sign-docker-image.md
|
|
2
|
+
# Docker Image Signing Workflow
|
|
3
|
+
|
|
4
|
+
This workflow guides the DevOps agent through the process of cryptographically signing a Docker image.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. **Select Image**: Identify the image to sign.
|
|
8
|
+
2. **Get Digest**: Retrieve the immutable digest: `docker inspect --format='{{index .RepoDigests 0}}' {image_name}`.
|
|
9
|
+
3. **Prepare Certificate**: Locate the certificate file provided by the user.
|
|
10
|
+
4. **Execute Signing**:
|
|
11
|
+
- Use the `docker-image-signing` skill.
|
|
12
|
+
- Path: `skills/docker-image-signing/scripts/sign-image.sh`
|
|
13
|
+
- Run: `bash skills/docker-image-signing/scripts/sign-image.sh {image_digest} {cert_file} {key_file}`
|
|
14
|
+
5. **Verify**: Confirm the signature using `cosign verify`.
|
|
15
|
+
6. **Report**: provide the signed image reference to the user.
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Docker Hardening Verification
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Audit Docker images to ensure they follow security best practices, specifically focusing on non-root execution and least privilege principles required for hardened clusters like OpenShift.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. **Inspect Image**: Use `docker inspect` or `podman inspect` to check metadata.
|
|
8
|
+
2. **Verify User**:
|
|
9
|
+
- Ensure `USER` is defined and is NOT `root` or `0`.
|
|
10
|
+
- Recommended: Use a high-numbered UID (e.g., `1001`).
|
|
11
|
+
3. **Check Permissions**:
|
|
12
|
+
- Ensure sensitive directories are not world-writable.
|
|
13
|
+
- Check for `setuid`/`setgid` bits on binaries.
|
|
14
|
+
4. **OpenShift Compliance**:
|
|
15
|
+
- Verify that the image doesn't require specific UIDs if it's meant to run with an arbitrary assigned UID (OpenShift's default).
|
|
16
|
+
- Check if the `/etc/passwd` entry handles arbitrary UIDs (e.g., by using `nss_wrapper` or similar).
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
- Fail the audit if `USER root` is detected.
|
|
20
|
+
- Flag a warning if many unnecessary packages/tools are present.
|
|
21
|
+
- Ensure only necessary ports are exposed.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
Run `scripts/verify-hardening.sh <image_name>`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# verify-hardening.sh - Part of ma-agents docker-hardening-verification skill
|
|
3
|
+
|
|
4
|
+
IMAGE=$1
|
|
5
|
+
|
|
6
|
+
if [ -z "$IMAGE" ]; then
|
|
7
|
+
echo "Usage: $0 <image_name>"
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
echo "Auditing image: $IMAGE"
|
|
12
|
+
|
|
13
|
+
# 1. Check User
|
|
14
|
+
USER_VAL=$(docker inspect --format='{{.Config.User}}' "$IMAGE")
|
|
15
|
+
|
|
16
|
+
if [ -z "$USER_VAL" ] || [ "$USER_VAL" == "root" ] || [ "$USER_VAL" == "0" ]; then
|
|
17
|
+
echo "[FAIL] Image runs as root! Definining a non-root USER is mandatory for hardened clusters."
|
|
18
|
+
else
|
|
19
|
+
echo "[PASS] Image runs as user: $USER_VAL"
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# 2. Check for sensitive capabilities (simplified check)
|
|
23
|
+
CAPS=$(docker inspect --format='{{.Config.CapAdd}}' "$IMAGE")
|
|
24
|
+
if [ "$CAPS" != "<nil>" ] && [ -n "$CAPS" ]; then
|
|
25
|
+
echo "[WARNING] Image has explicitly added capabilities: $CAPS"
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# 3. Check for exposed ports
|
|
29
|
+
PORTS=$(docker inspect --format='{{range $p, $conf := .Config.ExposedPorts}}{{$p}} {{end}}' "$IMAGE")
|
|
30
|
+
echo "[INFO] Exposed ports: ${PORTS:-none}"
|
|
31
|
+
|
|
32
|
+
# 4. OpenShift specific check (arbitrary UID support)
|
|
33
|
+
# This is a heuristic check looking for common entrypoint patterns
|
|
34
|
+
ENTRYPOINT=$(docker inspect --format='{{.Config.Entrypoint}}' "$IMAGE")
|
|
35
|
+
if [[ "$ENTRYPOINT" == *"bash"* ]]; then
|
|
36
|
+
echo "[INFO] Entrypoint uses bash, manual check for UID mapping recommended."
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
echo "Summary: Audit complete for $IMAGE"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Docker Hardening Verification",
|
|
3
|
+
"description": "Audits Docker images for security best practices, least privilege, and OpenShift compliance.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "ma-agents",
|
|
6
|
+
"tags": [
|
|
7
|
+
"docker",
|
|
8
|
+
"security",
|
|
9
|
+
"hardening",
|
|
10
|
+
"openshift",
|
|
11
|
+
"least-privilege"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Docker Image Signing
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Ensure the integrity and authenticity of Docker images by signing them with a cryptographic key/certificate. This prevents unauthorized image substitution and ensures only trusted images are deployed.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. **Tool Selection**: Use `cosign` (recommended) or `notary`.
|
|
8
|
+
2. **Environment Check**: Verify that the signing tool and Docker/Podman are installed.
|
|
9
|
+
3. **Signing Process**:
|
|
10
|
+
- Load the provided certificate/key.
|
|
11
|
+
- Run the signing command against the target image (using its SHA256 digest for immutability).
|
|
12
|
+
4. **Verification**: Always run a verification check immediately after signing.
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
- NEVER sign images by tag alone; use the immutable digest (e.g., `image@sha256:...`).
|
|
16
|
+
- Private keys must be handled as secrets and never stored in the clear.
|
|
17
|
+
- Ensure the certificate provided is valid and not expired.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
Run the provided script in `scripts/sign-image.sh` with:
|
|
21
|
+
- `IMAGE`: The image reference with digest.
|
|
22
|
+
- `CERT`: Path to the certificate file.
|
|
23
|
+
- `KEY`: Path to the private key file.
|
|
24
|
+
- `PASSPHRASE`: (Optional) Key passphrase.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# sign-image.sh - Part of ma-agents docker-image-signing skill
|
|
3
|
+
|
|
4
|
+
IMAGE=$1
|
|
5
|
+
CERT=$2
|
|
6
|
+
KEY=$3
|
|
7
|
+
PASSPHRASE=$4
|
|
8
|
+
|
|
9
|
+
if [ -z "$IMAGE" ] || [ -z "$CERT" ] || [ -z "$KEY" ]; then
|
|
10
|
+
echo "Usage: $0 <image_digest> <cert_file> <key_file> [passphrase]"
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
echo "Signing image: $IMAGE"
|
|
15
|
+
|
|
16
|
+
# Check for cosign
|
|
17
|
+
if command -v cosign &> /dev/null; then
|
|
18
|
+
echo "Using Cosign for signing..."
|
|
19
|
+
if [ -n "$PASSPHRASE" ]; then
|
|
20
|
+
export COSIGN_PASSWORD=$PASSPHRASE
|
|
21
|
+
fi
|
|
22
|
+
cosign sign --key "$KEY" --cert "$CERT" "$IMAGE"
|
|
23
|
+
else
|
|
24
|
+
echo "Error: cosign not found. Please install cosign to use this skill."
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if [ $? -eq 0 ]; then
|
|
29
|
+
echo "Successfully signed $IMAGE"
|
|
30
|
+
else
|
|
31
|
+
echo "Failed to sign $IMAGE"
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Docker Image Signing",
|
|
3
|
+
"description": "Automates the signing of Docker images using certificates and Cosign/Notary.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "ma-agents",
|
|
6
|
+
"tags": [
|
|
7
|
+
"docker",
|
|
8
|
+
"security",
|
|
9
|
+
"signing",
|
|
10
|
+
"cosign",
|
|
11
|
+
"notary"
|
|
12
|
+
]
|
|
13
|
+
}
|