fullshield 0.0.1 → 0.1.1

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/LICENSE +21 -0
  3. package/README.md +159 -1
  4. package/dist/agent.js +5759 -0
  5. package/dist/cli/index.js +8612 -0
  6. package/dist/compliance.js +126 -0
  7. package/dist/confirm.js +146 -0
  8. package/dist/dashboard.js +143 -0
  9. package/dist/iac.js +84 -0
  10. package/dist/incremental.js +13 -0
  11. package/dist/index.d.ts +334 -0
  12. package/dist/index.js +6199 -0
  13. package/dist/llm.js +105 -0
  14. package/dist/mcp.js +5869 -0
  15. package/dist/runtime/auto.js +1163 -0
  16. package/dist/runtime/express.js +242 -0
  17. package/dist/runtime/fastify.js +254 -0
  18. package/dist/runtime/index.js +229 -0
  19. package/dist/runtime/rasp/loader.js +14 -0
  20. package/dist/runtime/rasp.js +1339 -0
  21. package/dist/runtime/register.js +1171 -0
  22. package/dist/supply.js +228 -0
  23. package/dist/threat.js +63 -0
  24. package/dist/workspaces.js +23 -0
  25. package/package.json +93 -8
  26. package/rules/CONFIG-BODYLIMIT-001.md +9 -0
  27. package/rules/CONFIG-CORS-001.md +9 -0
  28. package/rules/CONFIG-DOCKER-ENV-001.md +9 -0
  29. package/rules/CONFIG-DOCKER-LATEST-001.md +9 -0
  30. package/rules/CONFIG-DOCKER-ROOT-001.md +9 -0
  31. package/rules/CONFIG-ERRSTACK-001.md +9 -0
  32. package/rules/CONFIG-HELMET-001.md +9 -0
  33. package/rules/CONFIG-INSTALLSCRIPT-001.md +9 -0
  34. package/rules/CONFIG-RATELIMIT-001.md +9 -0
  35. package/rules/DEPS-DEPRECATED-001.md +9 -0
  36. package/rules/DEPS-NOLOCK-001.md +9 -0
  37. package/rules/DEPS-TYPOSQUAT-001.md +9 -0
  38. package/rules/DEPS-VULN-001.md +9 -0
  39. package/rules/README.md +60 -0
  40. package/rules/SAST-AUTH-001.md +9 -0
  41. package/rules/SAST-CMDI-001.md +9 -0
  42. package/rules/SAST-CRYPTO-001.md +9 -0
  43. package/rules/SAST-EVAL-001.md +9 -0
  44. package/rules/SAST-JWT-001.md +9 -0
  45. package/rules/SAST-NOSQLI-001.md +9 -0
  46. package/rules/SAST-PATH-001.md +9 -0
  47. package/rules/SAST-PROTO-001.md +9 -0
  48. package/rules/SAST-REDIRECT-001.md +9 -0
  49. package/rules/SAST-SQLI-001.md +9 -0
  50. package/rules/SAST-SSRF-001.md +9 -0
  51. package/rules/SAST-XSS-001.md +9 -0
  52. package/rules/SECRET-AIKEY-001.md +9 -0
  53. package/rules/SECRET-AWS-001.md +9 -0
  54. package/rules/SECRET-DBURL-001.md +9 -0
  55. package/rules/SECRET-ENTROPY-001.md +9 -0
  56. package/rules/SECRET-ENVFILE-001.md +9 -0
  57. package/rules/SECRET-GITHUB-001.md +9 -0
  58. package/rules/SECRET-GOOGLE-001.md +9 -0
  59. package/rules/SECRET-JWT-001.md +9 -0
  60. package/rules/SECRET-PRIVKEY-001.md +9 -0
  61. package/rules/SECRET-SLACK-001.md +9 -0
  62. package/rules/SECRET-STRIPE-001.md +9 -0
  63. package/templates/fullshield.config.json +7 -0
  64. package/templates/github-watch.yml +15 -0
  65. package/templates/github-workflow.yml +19 -0
  66. package/templates/gitlab-ci.yml +11 -0
  67. package/templates/pre-commit.sh +11 -0
@@ -0,0 +1,9 @@
1
+ # SAST-NOSQLI-001
2
+
3
+ **req.body/req.query passed as a Mongo filter.** CWE-943.
4
+
5
+ ## Remediation
6
+
7
+ Build an allow-listed filter object; never pass the request object through.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SAST-PATH-001
2
+
3
+ **Tainted path without path.resolve + prefix check.** CWE-22.
4
+
5
+ ## Remediation
6
+
7
+ Resolve against a fixed base and require startsWith(baseDir).
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SAST-PROTO-001
2
+
3
+ **Recursive merge of a tainted object without a __proto__ guard.** CWE-1321.
4
+
5
+ ## Remediation
6
+
7
+ Skip __proto__, constructor, and prototype keys.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SAST-REDIRECT-001
2
+
3
+ **Tainted value into res.redirect.** CWE-601.
4
+
5
+ ## Remediation
6
+
7
+ Allow-list destinations or require a relative path.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SAST-SQLI-001
2
+
3
+ **Tainted input concatenated into query/execute.** CWE-89.
4
+
5
+ ## Remediation
6
+
7
+ Use a parameterized query (query(sql, [params])).
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SAST-SSRF-001
2
+
3
+ **Tainted URL into fetch/axios/http/needle/got/request/superagent/undici.** CWE-918.
4
+
5
+ ## Remediation
6
+
7
+ Allow-list destinations; do not fetch user-supplied URLs.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SAST-XSS-001
2
+
3
+ **Tainted HTML res.send, or unescaped <%- / {{{ in templates.** CWE-79.
4
+
5
+ ## Remediation
6
+
7
+ Escape output. Use <%= in EJS and {{ in Handlebars. skip include.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-AIKEY-001
2
+
3
+ **OpenAI/Anthropic-style API key.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Rotate and load from env. Never send scanned code to an AI provider without consent.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-AWS-001
2
+
3
+ **AWS access key.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Rotate the key. Load it from the environment. Removing it from the file is not enough — it stays in git history.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-DBURL-001
2
+
3
+ **Database URL with an inline password.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Angle-bracket placeholders are ignored. Real passwords must be rotated and moved to env.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-ENTROPY-001
2
+
3
+ **High-entropy string assigned to a secret-like name.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Low confidence. Confirm it is not a live credential.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-ENVFILE-001
2
+
3
+ **Committed .env file.** CWE-260.
4
+
5
+ ## Remediation
6
+
7
+ Add .env to .gitignore, rotate every value, keep only .env.example.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-GITHUB-001
2
+
3
+ **GitHub token.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Revoke the token and store a new one in env/CI secrets.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-GOOGLE-001
2
+
3
+ **Google API key.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Restrict and rotate the key; do not commit it.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-JWT-001
2
+
3
+ **Hardcoded JWT signing secret.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Replace the literal with process.env.JWT_SECRET and rotate.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-PRIVKEY-001
2
+
3
+ **PEM private key block.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Treat the key as compromised, rotate, and keep material out of git.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-SLACK-001
2
+
3
+ **Slack token.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Revoke the token in Slack and load a replacement from env.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,9 @@
1
+ # SECRET-STRIPE-001
2
+
3
+ **Stripe secret key.** CWE-798.
4
+
5
+ ## Remediation
6
+
7
+ Rotate the key and move it to a secret manager.
8
+
9
+ See `SECURITY_SCANNER_SPEC.md` §4 and the fixtures under `test/fixtures/`.
@@ -0,0 +1,7 @@
1
+ {
2
+ "modules": ["deps", "secrets", "sast", "config"],
3
+ "failOn": "high",
4
+ "ignore": ["dist/**", "**/*.test.ts"],
5
+ "baseline": ".fullshield-baseline.json",
6
+ "notify": { "slackWebhookEnv": "FULLSHIELD_SLACK_WEBHOOK" }
7
+ }
@@ -0,0 +1,15 @@
1
+ name: FullShield watch
2
+ on:
3
+ schedule:
4
+ - cron: '0 6 * * *'
5
+ workflow_dispatch:
6
+ jobs:
7
+ watch:
8
+ runs-on: ubuntu-24.04
9
+ steps:
10
+ - uses: actions/checkout@v7
11
+ - uses: actions/setup-node@v7
12
+ with:
13
+ node-version: '22'
14
+ - run: npm ci
15
+ - run: npx fullshield watch --fail-on high
@@ -0,0 +1,19 @@
1
+ name: FullShield
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches: [main]
6
+ jobs:
7
+ scan:
8
+ runs-on: ubuntu-24.04
9
+ steps:
10
+ - uses: actions/checkout@v7
11
+ - uses: actions/setup-node@v7
12
+ with:
13
+ node-version: '22'
14
+ - run: npm ci
15
+ - run: npx fullshield scan --sarif fullshield.sarif --fail-on high
16
+ - uses: github/codeql-action/upload-sarif@v3
17
+ if: always()
18
+ with:
19
+ sarif_file: fullshield.sarif
@@ -0,0 +1,11 @@
1
+ fullshield:
2
+ image: node:22
3
+ script:
4
+ - npm ci
5
+ - npx fullshield scan --json --fail-on high
6
+ artifacts:
7
+ when: always
8
+ paths:
9
+ - fullshield-report.json
10
+ reports:
11
+ sast: fullshield-report.json
@@ -0,0 +1,11 @@
1
+ #!/bin/sh
2
+ # FullShield pre-commit hook: block staged secrets.
3
+ set -e
4
+ ROOT=$(git rev-parse --show-toplevel)
5
+ cd "$ROOT"
6
+ if command -v npx >/dev/null 2>&1; then
7
+ npx fullshield scan --modules secrets --staged --fail-on high
8
+ else
9
+ echo "fullshield pre-commit: npx not found" >&2
10
+ exit 1
11
+ fi