javi-forge 1.25.0 → 1.26.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/dist/cli/dispatch/tdd.d.ts +6 -3
- package/dist/cli/dispatch/tdd.js +62 -31
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +2 -2
- package/dist/commands/ci.js +14 -4
- package/dist/commands/doctor.d.ts +8 -0
- package/dist/commands/doctor.js +112 -0
- package/dist/commands/hooks/sections/deps.d.ts +28 -0
- package/dist/commands/hooks/sections/deps.js +126 -0
- package/dist/commands/hooks/sections/permissions.d.ts +33 -0
- package/dist/commands/hooks/sections/permissions.js +101 -0
- package/dist/commands/hooks/sections/secrets.d.ts +58 -0
- package/dist/commands/hooks/sections/secrets.js +182 -0
- package/dist/commands/hooks.d.ts +39 -3
- package/dist/commands/hooks.js +93 -6
- package/dist/commands/init/steps/security.d.ts +10 -20
- package/dist/commands/init/steps/security.js +58 -78
- package/dist/commands/init.js +1 -2
- package/dist/commands/tdd.d.ts +0 -14
- package/dist/commands/tdd.js +0 -88
- package/dist/constants.d.ts +6 -1
- package/dist/constants.js +12 -7
- package/dist/lib/ci-config.d.ts +10 -0
- package/dist/lib/ci-config.js +33 -0
- package/dist/types/index.d.ts +0 -7
- package/package.json +1 -1
- package/dist/commands/tdd-pipeline.d.ts +0 -17
- package/dist/commands/tdd-pipeline.js +0 -144
- package/templates/security-hooks/commit-msg-signing +0 -29
- package/templates/security-hooks/pre-commit-permissions +0 -74
- package/templates/security-hooks/pre-commit-secrets +0 -74
- package/templates/security-hooks/pre-push-branch-protection +0 -62
- package/templates/security-hooks/pre-push-deps +0 -83
- package/templates/security-hooks/pre-push-signing +0 -67
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# SECURITY LAYER 2: Dependency Audit (pre-push)
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# Runs dependency vulnerability audit before pushing.
|
|
6
|
-
# Checks for known CVEs in project dependencies.
|
|
7
|
-
#
|
|
8
|
-
# Supports: npm/pnpm/yarn, pip-audit, cargo audit, govulncheck
|
|
9
|
-
# To skip: git push --no-verify (NOT recommended)
|
|
10
|
-
# =============================================================================
|
|
11
|
-
|
|
12
|
-
set -e
|
|
13
|
-
|
|
14
|
-
RED='\033[0;31m'
|
|
15
|
-
YELLOW='\033[1;33m'
|
|
16
|
-
GREEN='\033[0;32m'
|
|
17
|
-
NC='\033[0m'
|
|
18
|
-
|
|
19
|
-
echo "SECURITY [2/6]: Dependency audit..."
|
|
20
|
-
|
|
21
|
-
# Auto-detect stack and run appropriate audit
|
|
22
|
-
if [ -f "package.json" ]; then
|
|
23
|
-
if [ -f "pnpm-lock.yaml" ]; then
|
|
24
|
-
echo -e "${YELLOW} Running: pnpm audit${NC}"
|
|
25
|
-
pnpm audit --audit-level=high 2>/dev/null || {
|
|
26
|
-
echo -e "${RED} High/critical vulnerabilities found in dependencies.${NC}"
|
|
27
|
-
echo -e "${YELLOW} Run 'pnpm audit' for details, 'pnpm audit --fix' to auto-fix.${NC}"
|
|
28
|
-
exit 1
|
|
29
|
-
}
|
|
30
|
-
elif [ -f "yarn.lock" ]; then
|
|
31
|
-
echo -e "${YELLOW} Running: yarn npm audit${NC}"
|
|
32
|
-
yarn npm audit --severity high 2>/dev/null || {
|
|
33
|
-
echo -e "${RED} High/critical vulnerabilities found in dependencies.${NC}"
|
|
34
|
-
echo -e "${YELLOW} Run 'yarn npm audit' for details.${NC}"
|
|
35
|
-
exit 1
|
|
36
|
-
}
|
|
37
|
-
else
|
|
38
|
-
echo -e "${YELLOW} Running: npm audit${NC}"
|
|
39
|
-
npm audit --audit-level=high 2>/dev/null || {
|
|
40
|
-
echo -e "${RED} High/critical vulnerabilities found in dependencies.${NC}"
|
|
41
|
-
echo -e "${YELLOW} Run 'npm audit' for details, 'npm audit fix' to auto-fix.${NC}"
|
|
42
|
-
exit 1
|
|
43
|
-
}
|
|
44
|
-
fi
|
|
45
|
-
elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
|
|
46
|
-
if command -v pip-audit &>/dev/null; then
|
|
47
|
-
echo -e "${YELLOW} Running: pip-audit${NC}"
|
|
48
|
-
pip-audit 2>/dev/null || {
|
|
49
|
-
echo -e "${RED} Vulnerabilities found in Python dependencies.${NC}"
|
|
50
|
-
echo -e "${YELLOW} Run 'pip-audit' for details.${NC}"
|
|
51
|
-
exit 1
|
|
52
|
-
}
|
|
53
|
-
else
|
|
54
|
-
echo -e "${YELLOW} pip-audit not installed. Skipping. Install: pip install pip-audit${NC}"
|
|
55
|
-
fi
|
|
56
|
-
elif [ -f "Cargo.toml" ]; then
|
|
57
|
-
if command -v cargo-audit &>/dev/null; then
|
|
58
|
-
echo -e "${YELLOW} Running: cargo audit${NC}"
|
|
59
|
-
cargo audit 2>/dev/null || {
|
|
60
|
-
echo -e "${RED} Vulnerabilities found in Rust dependencies.${NC}"
|
|
61
|
-
echo -e "${YELLOW} Run 'cargo audit' for details.${NC}"
|
|
62
|
-
exit 1
|
|
63
|
-
}
|
|
64
|
-
else
|
|
65
|
-
echo -e "${YELLOW} cargo-audit not installed. Skipping. Install: cargo install cargo-audit${NC}"
|
|
66
|
-
fi
|
|
67
|
-
elif [ -f "go.mod" ]; then
|
|
68
|
-
if command -v govulncheck &>/dev/null; then
|
|
69
|
-
echo -e "${YELLOW} Running: govulncheck${NC}"
|
|
70
|
-
govulncheck ./... 2>/dev/null || {
|
|
71
|
-
echo -e "${RED} Vulnerabilities found in Go dependencies.${NC}"
|
|
72
|
-
echo -e "${YELLOW} Run 'govulncheck ./...' for details.${NC}"
|
|
73
|
-
exit 1
|
|
74
|
-
}
|
|
75
|
-
else
|
|
76
|
-
echo -e "${YELLOW} govulncheck not installed. Skipping. Install: go install golang.org/x/vuln/cmd/govulncheck@latest${NC}"
|
|
77
|
-
fi
|
|
78
|
-
else
|
|
79
|
-
echo -e "${YELLOW} No supported dependency manifest found. Skipping.${NC}"
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
echo -e "${GREEN} Dependency audit passed.${NC}"
|
|
83
|
-
exit 0
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# SECURITY LAYER 4: Code Signing Verification (pre-push)
|
|
4
|
-
# =============================================================================
|
|
5
|
-
# Checks that commits being pushed are GPG/SSH signed (if configured).
|
|
6
|
-
# Warns but does not block if signing is not configured.
|
|
7
|
-
#
|
|
8
|
-
# To skip: git push --no-verify (NOT recommended)
|
|
9
|
-
# =============================================================================
|
|
10
|
-
|
|
11
|
-
set -e
|
|
12
|
-
|
|
13
|
-
RED='\033[0;31m'
|
|
14
|
-
YELLOW='\033[1;33m'
|
|
15
|
-
GREEN='\033[0;32m'
|
|
16
|
-
CYAN='\033[0;36m'
|
|
17
|
-
NC='\033[0m'
|
|
18
|
-
|
|
19
|
-
echo "SECURITY [4/6]: Code signing check..."
|
|
20
|
-
|
|
21
|
-
# Check if commit signing is configured
|
|
22
|
-
SIGN_KEY=$(git config --get user.signingkey 2>/dev/null || echo "")
|
|
23
|
-
GPG_SIGN=$(git config --get commit.gpgsign 2>/dev/null || echo "false")
|
|
24
|
-
GPG_FORMAT=$(git config --get gpg.format 2>/dev/null || echo "openpgp")
|
|
25
|
-
|
|
26
|
-
if [ -z "$SIGN_KEY" ] || [ "$GPG_SIGN" != "true" ]; then
|
|
27
|
-
echo -e "${YELLOW} Commit signing not configured. Skipping verification.${NC}"
|
|
28
|
-
echo -e "${CYAN} To enable: git config --global commit.gpgsign true${NC}"
|
|
29
|
-
echo -e "${CYAN} GPG: git config --global user.signingkey <KEY_ID>${NC}"
|
|
30
|
-
echo -e "${CYAN} SSH: git config --global gpg.format ssh && git config --global user.signingkey ~/.ssh/id_ed25519.pub${NC}"
|
|
31
|
-
exit 0
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
# Verify recent commits are signed
|
|
35
|
-
REMOTE="$1"
|
|
36
|
-
URL="$2"
|
|
37
|
-
|
|
38
|
-
while read -r LOCAL_REF LOCAL_OID REMOTE_REF REMOTE_OID; do
|
|
39
|
-
if [ "$LOCAL_OID" = "0000000000000000000000000000000000000000" ]; then
|
|
40
|
-
continue # Branch deletion
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# Check last 10 commits (or all new ones)
|
|
44
|
-
RANGE=""
|
|
45
|
-
if [ "$REMOTE_OID" = "0000000000000000000000000000000000000000" ]; then
|
|
46
|
-
RANGE="$LOCAL_OID"
|
|
47
|
-
else
|
|
48
|
-
RANGE="$REMOTE_OID..$LOCAL_OID"
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
UNSIGNED=$(git log --format='%H %G?' "$RANGE" 2>/dev/null | grep -E ' N$' | head -5 || true)
|
|
52
|
-
|
|
53
|
-
if [ -n "$UNSIGNED" ]; then
|
|
54
|
-
echo -e "${YELLOW} Warning: unsigned commits detected:${NC}"
|
|
55
|
-
echo "$UNSIGNED" | while read -r hash status; do
|
|
56
|
-
MSG=$(git log --format='%s' -1 "$hash" 2>/dev/null)
|
|
57
|
-
echo -e "${YELLOW} ${hash:0:8} $MSG${NC}"
|
|
58
|
-
done
|
|
59
|
-
echo -e "${YELLOW} Signing is configured but some commits are unsigned.${NC}"
|
|
60
|
-
echo -e "${CYAN} To sign: git commit -S -m 'message'${NC}"
|
|
61
|
-
echo -e "${CYAN} To amend: git commit --amend -S${NC}"
|
|
62
|
-
# Warning only, don't block
|
|
63
|
-
fi
|
|
64
|
-
done
|
|
65
|
-
|
|
66
|
-
echo -e "${GREEN} Signing check complete.${NC}"
|
|
67
|
-
exit 0
|