ma-agents 2.6.0 → 2.7.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
CHANGED
|
@@ -85,6 +85,7 @@ skills/code-review/
|
|
|
85
85
|
| `opentelemetry-best-practices` | Logic | Distributed tracing and semantic conventions |
|
|
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
|
+
| `self-signed-cert` | Security | Automated Root CA and self-signed certificate generation |
|
|
88
89
|
|
|
89
90
|
## Automated Skill Discovery
|
|
90
91
|
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
# workflow-generate-certs.md
|
|
2
2
|
# Secure Certificate Generation Workflow
|
|
3
3
|
|
|
4
|
-
Automated workflow for generating self-signed certificates
|
|
4
|
+
Automated workflow for generating self-signed certificates using the `self-signed-cert` skill.
|
|
5
5
|
|
|
6
6
|
## Instructions
|
|
7
|
-
1. **
|
|
8
|
-
2. **
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
- Sign with CA or generate standalone self-signed cert.
|
|
14
|
-
- `openssl x509 -req -in {csr} -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out {crt} -days 365 -sha256`
|
|
7
|
+
1. **Load Skill**: Activate the `self-signed-cert` skill instructions.
|
|
8
|
+
2. **Requirement Analysis**: Determine common name (CN) and Subject Alternative Names (SANs).
|
|
9
|
+
3. **Execution**:
|
|
10
|
+
- Use the `generate-cert.sh` script from the skill's scripts directory.
|
|
11
|
+
- Choice A: `bash scripts/generate-cert.sh root my-internal-ca`
|
|
12
|
+
- Choice B: `bash scripts/generate-cert.sh cert my-service localhost`
|
|
15
13
|
4. **Packaging**: Provide instructions for importing the cert into trust stores (OS, Browsers) or mounting in Kubernetes secrets.
|
|
16
14
|
5. **Security**: Ensure private keys are stored with restricted permissions (600).
|
|
17
15
|
6. **Rotation**: Offer a schedule for certificate renewal.
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Self-Signed Certificate Generator
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Automate the creation of Root CAs and self-signed certificates for internal services, local development, and testing environments.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. **Environment Check**: Ensure `openssl` is installed and available in the PATH.
|
|
8
|
+
2. **Workflow Selection**:
|
|
9
|
+
- **Standalone Self-Signed**: Quickest for single service testing.
|
|
10
|
+
- **Root CA + Signed Cert**: Recommended for internal architectures where multiple services need to trust a single authority.
|
|
11
|
+
3. **Security Standards**:
|
|
12
|
+
- Key Size: Minimum 2048-bit (4096-bit preferred).
|
|
13
|
+
- Hashing: SHA-256 or higher.
|
|
14
|
+
- Permissions: Private keys must be set to `600`.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
- NEVER store private keys in version control.
|
|
18
|
+
- ALWAYS include Subject Alternative Names (SANs) for modern browser compatibility.
|
|
19
|
+
- Ensure the certificate Common Name (CN) matches the intended hostname.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
Run the provided script in `scripts/generate-cert.sh` with the following parameters:
|
|
23
|
+
- `TYPE`: `root` or `cert`
|
|
24
|
+
- `NAME`: Base name for the files
|
|
25
|
+
- `DNS`: Primary domain/IP
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# generate-cert.sh - Part of ma-agents self-signed-cert skill
|
|
3
|
+
|
|
4
|
+
TYPE=$1
|
|
5
|
+
NAME=${2:-"server"}
|
|
6
|
+
DNS=${3:-"localhost"}
|
|
7
|
+
|
|
8
|
+
if [ "$TYPE" == "root" ]; then
|
|
9
|
+
echo "Generating Root CA..."
|
|
10
|
+
openssl genrsa -out "${NAME}_rootCA.key" 4096
|
|
11
|
+
openssl req -x509 -new -nodes -key "${NAME}_rootCA.key" -sha256 -days 3650 -out "${NAME}_rootCA.crt" \
|
|
12
|
+
-subj "/CN=${NAME}-Root-CA/O=MA-Agents/C=US"
|
|
13
|
+
chmod 600 "${NAME}_rootCA.key"
|
|
14
|
+
echo "Root CA created: ${NAME}_rootCA.crt"
|
|
15
|
+
|
|
16
|
+
elif [ "$TYPE" == "cert" ]; then
|
|
17
|
+
CA_KEY=$4
|
|
18
|
+
CA_CRT=$5
|
|
19
|
+
|
|
20
|
+
if [ -z "$CA_KEY" ] || [ -z "$CA_CRT" ]; then
|
|
21
|
+
echo "Generating standalone self-signed certificate..."
|
|
22
|
+
openssl req -x509 -newnodes -days 365 -newkey rsa:2048 \
|
|
23
|
+
-keyout "${NAME}.key" -out "${NAME}.crt" \
|
|
24
|
+
-subj "/CN=${DNS}/O=MA-Agents" \
|
|
25
|
+
-addext "subjectAltName = DNS:${DNS}"
|
|
26
|
+
else
|
|
27
|
+
echo "Generating certificate signed by CA..."
|
|
28
|
+
openssl genrsa -out "${NAME}.key" 2048
|
|
29
|
+
openssl req -new -key "${NAME}.key" -out "${NAME}.csr" -subj "/CN=${DNS}/O=MA-Agents"
|
|
30
|
+
|
|
31
|
+
# Extension file for SAN
|
|
32
|
+
echo "subjectAltName = DNS:${DNS}" > "${NAME}.ext"
|
|
33
|
+
|
|
34
|
+
openssl x509 -req -in "${NAME}.csr" -CA "$CA_CRT" -CAkey "$CA_KEY" -CAcreateserial \
|
|
35
|
+
-out "${NAME}.crt" -days 365 -sha256 -extfile "${NAME}.ext"
|
|
36
|
+
rm "${NAME}.csr" "${NAME}.ext"
|
|
37
|
+
fi
|
|
38
|
+
chmod 600 "${NAME}.key"
|
|
39
|
+
echo "Certificate created: ${NAME}.crt"
|
|
40
|
+
else
|
|
41
|
+
echo "Usage: $0 [root|cert] [name] [dns] [ca_key] [ca_crt]"
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Self-Signed Certificate Generator",
|
|
3
|
+
"description": "Generates secure self-signed certificates and Root CAs using OpenSSL.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "Yael (Cyber Analyst)",
|
|
6
|
+
"tags": [
|
|
7
|
+
"security",
|
|
8
|
+
"pki",
|
|
9
|
+
"certificates",
|
|
10
|
+
"openssl"
|
|
11
|
+
]
|
|
12
|
+
}
|