ma-agents 2.6.0 → 2.8.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 for internal services and local development.
4
+ Automated workflow for generating self-signed certificates using the `self-signed-cert` skill.
5
5
 
6
6
  ## Instructions
7
- 1. **Requirement Analysis**: Determine common name (CN) and Subject Alternative Names (SANs).
8
- 2. **CA Generation** (if needed):
9
- - `openssl genrsa -out rootCA.key 4096`
10
- - `openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 3650 -out rootCA.crt`
11
- 3. **Certificate Generation**:
12
- - Generate private key and CSR (Certificate Signing Request).
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ma-agents",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "NPX tool to install skills for AI coding agents (Claude Code, Gemini, Copilot, Kilocode, Cline, Cursor)",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,38 @@
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
+ The skill provide both Bash (Linux/macOS) and PowerShell (Windows) scripts.
23
+
24
+ ### Linux / macOS
25
+ Run `scripts/generate-cert.sh` with:
26
+ - `TYPE`: `root` or `cert`
27
+ - `NAME`: Base name for the files
28
+ - `DNS`: Primary domain/IP
29
+
30
+ Example: `bash scripts/generate-cert.sh cert my-service localhost`
31
+
32
+ ### Windows (PowerShell)
33
+ Run `scripts/generate-cert.ps1` with:
34
+ - `-Type`: `root` or `cert`
35
+ - `-Name`: Base name
36
+ - `-Dns`: Primary domain/IP
37
+
38
+ Example: `.\scripts\generate-cert.ps1 -Type cert -Name my-service -Dns localhost`
@@ -0,0 +1,45 @@
1
+ param (
2
+ [Parameter(Mandatory=$true)]
3
+ [ValidateSet("root", "cert")]
4
+ [string]$Type,
5
+
6
+ [string]$Name = "server",
7
+
8
+ [string]$Dns = "localhost",
9
+
10
+ [string]$CaKey,
11
+
12
+ [string]$CaCert
13
+ )
14
+
15
+ $ErrorActionPreference = "Stop"
16
+
17
+ if ($Type -eq "root") {
18
+ Write-Host "Generating Root CA..." -ForegroundColor Cyan
19
+ openssl genrsa -out "${Name}_rootCA.key" 4096
20
+ openssl req -x509 -new -nodes -key "${Name}_rootCA.key" -sha256 -days 3650 -out "${Name}_rootCA.crt" `
21
+ -subj "/CN=${Name}-Root-CA/O=MA-Agents/C=US"
22
+ Write-Host "Root CA created: ${Name}_rootCA.crt" -ForegroundColor Green
23
+
24
+ } elseif ($Type -eq "cert") {
25
+ if (-not $CaKey -or -not $CaCert) {
26
+ Write-Host "Generating standalone self-signed certificate..." -ForegroundColor Cyan
27
+ openssl req -x509 -newnodes -days 365 -newkey rsa:2048 `
28
+ -keyout "${Name}.key" -out "${Name}.crt" `
29
+ -subj "/CN=${Dns}/O=MA-Agents" `
30
+ -addext "subjectAltName = DNS:${Dns}"
31
+ } else {
32
+ Write-Host "Generating certificate signed by CA..." -ForegroundColor Cyan
33
+ openssl genrsa -out "${Name}.key" 2048
34
+ openssl req -new -key "${Name}.key" -out "${Name}.csr" -subj "/CN=${Dns}/O=MA-Agents"
35
+
36
+ # Extension file for SAN
37
+ "subjectAltName = DNS:${Dns}" | Out-File -FilePath "${Name}.ext" -Encoding ascii
38
+
39
+ openssl x509 -req -in "${Name}.csr" -CA "$CaCert" -CAkey "$CaKey" -CAcreateserial `
40
+ -out "${Name}.crt" -days 365 -sha256 -extfile "${Name}.ext"
41
+
42
+ Remove-Item "${Name}.csr", "${Name}.ext" -ErrorAction SilentlyContinue
43
+ }
44
+ Write-Host "Certificate created: ${Name}.crt" -ForegroundColor Green
45
+ }
@@ -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
+ }