@synapta/skills 0.1.1 → 0.2.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/index.js +11 -4
- package/package.json +3 -4
- package/skills/ATTRIBUTION.md +80 -0
- package/skills/accessibility-audit/SKILL.md +325 -0
- package/skills/accessibility-audit/reference/wcag-checklist.md +103 -0
- package/skills/apns-notifier/SKILL.md +86 -0
- package/skills/approval-policy-enforcer/SKILL.md +66 -0
- package/skills/apps-sdk-builder/LICENSE.txt +201 -0
- package/skills/apps-sdk-builder/SKILL.md +328 -0
- package/skills/apps-sdk-builder/agents/openai.yaml +13 -0
- package/skills/apps-sdk-builder/references/app-archetypes.md +132 -0
- package/skills/apps-sdk-builder/references/apps-sdk-docs-workflow.md +135 -0
- package/skills/apps-sdk-builder/references/interactive-state-sync-patterns.md +113 -0
- package/skills/apps-sdk-builder/references/repo-contract-and-validation.md +93 -0
- package/skills/apps-sdk-builder/references/search-fetch-standard.md +67 -0
- package/skills/apps-sdk-builder/references/upstream-example-workflow.md +79 -0
- package/skills/apps-sdk-builder/references/window-openai-patterns.md +79 -0
- package/skills/apps-sdk-builder/scripts/scaffold_node_ext_apps.mjs +606 -0
- package/skills/architecture-selector/SKILL.md +64 -0
- package/skills/backlog-planner/SKILL.md +68 -0
- package/skills/carplay-entitlement-checker/SKILL.md +82 -0
- package/skills/concept-deepener/SKILL.md +86 -0
- package/skills/concept-discovery/SKILL.md +517 -0
- package/skills/concept-discovery/assets/sample-analysis.json +81 -0
- package/skills/concept-discovery/expected_outputs/sample-enum-dictionary.md +25 -0
- package/skills/concept-discovery/expected_outputs/sample-page-user-list.md +83 -0
- package/skills/concept-discovery/expected_outputs/sample-prd-readme.md +43 -0
- package/skills/concept-discovery/references/framework-patterns.md +228 -0
- package/skills/concept-discovery/references/prd-quality-checklist.md +65 -0
- package/skills/concept-discovery/scripts/codebase_analyzer.py +732 -0
- package/skills/concept-discovery/scripts/prd_scaffolder.py +435 -0
- package/skills/dast-zap/SKILL.md +453 -0
- package/skills/dast-zap/assets/.gitkeep +9 -0
- package/skills/dast-zap/assets/github_action.yml +207 -0
- package/skills/dast-zap/assets/gitlab_ci.yml +226 -0
- package/skills/dast-zap/assets/zap_automation.yaml +196 -0
- package/skills/dast-zap/assets/zap_context.xml +192 -0
- package/skills/dast-zap/references/EXAMPLE.md +40 -0
- package/skills/dast-zap/references/api_testing_guide.md +475 -0
- package/skills/dast-zap/references/authentication_guide.md +431 -0
- package/skills/dast-zap/references/false_positive_handling.md +427 -0
- package/skills/dast-zap/references/owasp_mapping.md +255 -0
- package/skills/dep-sbom-scan/SKILL.md +466 -0
- package/skills/deploy-cloudflare/SKILL.md +930 -0
- package/skills/deploy-docker/SKILL.md +55 -0
- package/skills/deploy-fly/SKILL.md +228 -0
- package/skills/deploy-k8s/SKILL.md +108 -0
- package/skills/deploy-k8s/assets/logo.png +0 -0
- package/skills/deploy-k8s/docs/README.md +29 -0
- package/skills/deploy-k8s/docs/SUMMARY.md +56 -0
- package/skills/deploy-k8s/docs/advanced/token-efficiency.md +61 -0
- package/skills/deploy-k8s/docs/architecture/multi-tenancy.md +96 -0
- package/skills/deploy-k8s/docs/architecture/storage-and-state.md +102 -0
- package/skills/deploy-k8s/docs/architecture/workload-patterns.md +87 -0
- package/skills/deploy-k8s/docs/book.json +16 -0
- package/skills/deploy-k8s/docs/community/changelog.md +34 -0
- package/skills/deploy-k8s/docs/community/contributing.md +67 -0
- package/skills/deploy-k8s/docs/core-concepts/failure-modes.md +153 -0
- package/skills/deploy-k8s/docs/core-concepts/philosophy.md +83 -0
- package/skills/deploy-k8s/docs/core-concepts/workflow.md +124 -0
- package/skills/deploy-k8s/docs/examples/bad-patterns.md +47 -0
- package/skills/deploy-k8s/docs/examples/do-dont-checklist.md +37 -0
- package/skills/deploy-k8s/docs/examples/good-patterns.md +49 -0
- package/skills/deploy-k8s/docs/failure-modes/api-drift.md +104 -0
- package/skills/deploy-k8s/docs/failure-modes/fragile-rollouts.md +99 -0
- package/skills/deploy-k8s/docs/failure-modes/insecure-workload-defaults.md +80 -0
- package/skills/deploy-k8s/docs/failure-modes/network-exposure.md +98 -0
- package/skills/deploy-k8s/docs/failure-modes/privilege-sprawl.md +91 -0
- package/skills/deploy-k8s/docs/failure-modes/resource-starvation.md +85 -0
- package/skills/deploy-k8s/docs/getting-started/installation.md +152 -0
- package/skills/deploy-k8s/docs/getting-started/quick-start.md +115 -0
- package/skills/deploy-k8s/docs/guides/helm-patterns.md +71 -0
- package/skills/deploy-k8s/docs/guides/kustomize-patterns.md +65 -0
- package/skills/deploy-k8s/docs/guides/observability.md +67 -0
- package/skills/deploy-k8s/docs/guides/security-hardening.md +59 -0
- package/skills/deploy-k8s/docs/guides/validation-and-policy.md +66 -0
- package/skills/deploy-k8s/docs/integrations/mcp-integration.md +52 -0
- package/skills/deploy-k8s/docs/package-lock.json +2892 -0
- package/skills/deploy-k8s/docs/package.json +13 -0
- package/skills/deploy-k8s/references/api-drift.md +298 -0
- package/skills/deploy-k8s/references/conditional/aks-patterns.md +70 -0
- package/skills/deploy-k8s/references/conditional/eks-patterns.md +79 -0
- package/skills/deploy-k8s/references/conditional/gitops-controllers.md +71 -0
- package/skills/deploy-k8s/references/conditional/gke-patterns.md +74 -0
- package/skills/deploy-k8s/references/conditional/observability-stacks.md +80 -0
- package/skills/deploy-k8s/references/conditional/openshift-patterns.md +67 -0
- package/skills/deploy-k8s/references/daemonset-operator-patterns.md +155 -0
- package/skills/deploy-k8s/references/deployment-patterns.md +146 -0
- package/skills/deploy-k8s/references/do-dont-patterns.md +87 -0
- package/skills/deploy-k8s/references/examples-bad.md +282 -0
- package/skills/deploy-k8s/references/examples-good.md +440 -0
- package/skills/deploy-k8s/references/fragile-rollouts.md +303 -0
- package/skills/deploy-k8s/references/helm-patterns.md +203 -0
- package/skills/deploy-k8s/references/insecure-workload-defaults.md +300 -0
- package/skills/deploy-k8s/references/job-patterns.md +120 -0
- package/skills/deploy-k8s/references/kustomize-patterns.md +239 -0
- package/skills/deploy-k8s/references/multi-tenancy.md +343 -0
- package/skills/deploy-k8s/references/network-exposure.md +481 -0
- package/skills/deploy-k8s/references/observability.md +302 -0
- package/skills/deploy-k8s/references/privilege-sprawl.md +273 -0
- package/skills/deploy-k8s/references/resource-starvation.md +374 -0
- package/skills/deploy-k8s/references/security-hardening.md +209 -0
- package/skills/deploy-k8s/references/stateful-patterns.md +130 -0
- package/skills/deploy-k8s/references/storage-and-state.md +330 -0
- package/skills/deploy-k8s/references/validation-and-policy.md +242 -0
- package/skills/deploy-railway/SKILL.md +235 -0
- package/skills/deploy-railway/references/analyze-db-mongo.md +84 -0
- package/skills/deploy-railway/references/analyze-db-mysql.md +254 -0
- package/skills/deploy-railway/references/analyze-db-postgres.md +479 -0
- package/skills/deploy-railway/references/analyze-db-redis.md +208 -0
- package/skills/deploy-railway/references/analyze-db.md +344 -0
- package/skills/deploy-railway/references/configure.md +309 -0
- package/skills/deploy-railway/references/deploy.md +195 -0
- package/skills/deploy-railway/references/operate.md +214 -0
- package/skills/deploy-railway/references/request.md +248 -0
- package/skills/deploy-railway/references/setup.md +312 -0
- package/skills/deploy-railway/scripts/analyze-mongo.py +1549 -0
- package/skills/deploy-railway/scripts/analyze-mysql.py +1195 -0
- package/skills/deploy-railway/scripts/analyze-postgres.py +3058 -0
- package/skills/deploy-railway/scripts/analyze-redis.py +1090 -0
- package/skills/deploy-railway/scripts/dal.py +671 -0
- package/skills/deploy-railway/scripts/enable-pg-stats.py +170 -0
- package/skills/deploy-railway/scripts/pg-extensions.py +370 -0
- package/skills/deploy-railway/scripts/railway-api.sh +52 -0
- package/skills/deploy-ssh/SKILL.md +91 -0
- package/skills/deploy-vercel/SKILL.md +304 -0
- package/skills/deploy-vercel/resources/deploy-codex.sh +301 -0
- package/skills/deploy-vercel/resources/deploy.sh +301 -0
- package/skills/docs-runbooks/SKILL.md +399 -0
- package/skills/drive-status-renderer/SKILL.md +62 -0
- package/skills/iac-scan/SKILL.md +680 -0
- package/skills/iac-scan/assets/.gitkeep +9 -0
- package/skills/iac-scan/assets/checkov_config.yaml +94 -0
- package/skills/iac-scan/assets/github_actions.yml +199 -0
- package/skills/iac-scan/assets/gitlab_ci.yml +218 -0
- package/skills/iac-scan/assets/pre_commit_config.yaml +92 -0
- package/skills/iac-scan/references/EXAMPLE.md +40 -0
- package/skills/iac-scan/references/compliance_mapping.md +237 -0
- package/skills/iac-scan/references/custom_policies.md +460 -0
- package/skills/iac-scan/references/suppression_guide.md +431 -0
- package/skills/incident-briefing/SKILL.md +66 -0
- package/skills/incident-triage/SKILL.md +481 -0
- package/{LICENSE → skills/mcp-builder/LICENSE.txt} +15 -14
- package/skills/mcp-builder/SKILL.md +244 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/mobile-pairing/SKILL.md +52 -0
- package/skills/ops-sre/SKILL.md +297 -0
- package/skills/playwright-qa/LICENSE.txt +201 -0
- package/skills/playwright-qa/NOTICE.txt +14 -0
- package/skills/playwright-qa/SKILL.md +156 -0
- package/skills/playwright-qa/agents/openai.yaml +6 -0
- package/skills/playwright-qa/assets/playwright-small.svg +3 -0
- package/skills/playwright-qa/assets/playwright.png +0 -0
- package/skills/playwright-qa/references/cli.md +116 -0
- package/skills/playwright-qa/references/workflows.md +95 -0
- package/skills/playwright-qa/scripts/playwright_cli.sh +25 -0
- package/skills/release-publish/SKILL.md +85 -0
- package/skills/repo-bootstrap/SKILL.md +92 -0
- package/skills/repo-bootstrap/assets/example-workflows/validate-agents.yml +89 -0
- package/skills/repo-bootstrap/assets/root-thin.md +141 -0
- package/skills/repo-bootstrap/assets/root-verbose.md +149 -0
- package/skills/repo-bootstrap/assets/scoped/backend-go.md +107 -0
- package/skills/repo-bootstrap/assets/scoped/backend-php.md +94 -0
- package/skills/repo-bootstrap/assets/scoped/backend-python.md +84 -0
- package/skills/repo-bootstrap/assets/scoped/backend-typescript.md +89 -0
- package/skills/repo-bootstrap/assets/scoped/claude-code-skill.md +101 -0
- package/skills/repo-bootstrap/assets/scoped/cli.md +83 -0
- package/skills/repo-bootstrap/assets/scoped/concourse.md +196 -0
- package/skills/repo-bootstrap/assets/scoped/ddev.md +68 -0
- package/skills/repo-bootstrap/assets/scoped/docker.md +160 -0
- package/skills/repo-bootstrap/assets/scoped/documentation.md +98 -0
- package/skills/repo-bootstrap/assets/scoped/examples.md +96 -0
- package/skills/repo-bootstrap/assets/scoped/frontend-typescript.md +88 -0
- package/skills/repo-bootstrap/assets/scoped/github-actions.md +174 -0
- package/skills/repo-bootstrap/assets/scoped/gitlab-ci.md +174 -0
- package/skills/repo-bootstrap/assets/scoped/oro-bundle.md +209 -0
- package/skills/repo-bootstrap/assets/scoped/oro-project.md +170 -0
- package/skills/repo-bootstrap/assets/scoped/python-modern.md +170 -0
- package/skills/repo-bootstrap/assets/scoped/resources.md +96 -0
- package/skills/repo-bootstrap/assets/scoped/skill-repo.md +139 -0
- package/skills/repo-bootstrap/assets/scoped/symfony.md +168 -0
- package/skills/repo-bootstrap/assets/scoped/testing.md +87 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-docs.md +103 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-extension.md +133 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-project.md +137 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-testing.md +80 -0
- package/skills/repo-bootstrap/checkpoints.yaml +279 -0
- package/skills/repo-bootstrap/evals/evals.json +385 -0
- package/skills/repo-bootstrap/references/ai-contribution-guidelines.md +63 -0
- package/skills/repo-bootstrap/references/ai-tool-compatibility.md +223 -0
- package/skills/repo-bootstrap/references/directory-coverage.md +82 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/scripts-AGENTS.md +389 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/.env.example +13 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/package.json +33 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/pnpm-lock.yaml +3 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/config.ts +28 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/controllers/userController.ts +74 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/index.ts +26 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/errorHandler.ts +45 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/requestLogger.ts +18 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/health.ts +18 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/users.ts +13 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/errors.ts +40 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/logger.ts +14 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/tsconfig.json +24 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/.env.example +19 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/AGENTS.md +92 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/pyproject.toml +88 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/AGENTS.md +85 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/__init__.py +3 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/config.py +49 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/main.py +66 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/__init__.py +13 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/item.py +43 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/user.py +40 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/__init__.py +5 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/health.py +20 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/items.py +61 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/users.py +55 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/__init__.py +6 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/item_service.py +77 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/user_service.py +69 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/uv.lock +4 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/AGENTS.md +86 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/package.json +20 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/src/App.tsx +5 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/cmd/api/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/go.mod +2 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/AGENTS.md +89 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/go.mod +2 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/AGENTS.md +90 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/package.json +17 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/App.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Button.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Footer.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Header.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Sidebar.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package-lock.json +0 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package.json +12 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-AGENTS.md +371 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-web-AGENTS.md +448 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/composer.json +8 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/package.json +15 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/pnpm-lock.yaml +0 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/src/Controller.php +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/AGENTS.md +92 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/package.json +26 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/App.tsx +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Button.tsx +10 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Footer.tsx +9 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Header.tsx +9 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/main.tsx +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/tsconfig.json +13 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/AGENTS.md +75 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/package.json +7 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/package.json +11 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/src/index.ts +11 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-lock.yaml +42 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-workspace.yaml +2 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/examples-AGENTS.md +45 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/Classes-AGENTS.md +392 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/composer.json +8 -0
- package/skills/repo-bootstrap/references/feedback-memory-schema.md +135 -0
- package/skills/repo-bootstrap/references/git-hooks-setup.md +79 -0
- package/skills/repo-bootstrap/references/output-structure.md +124 -0
- package/skills/repo-bootstrap/references/scripts-guide.md +175 -0
- package/skills/repo-bootstrap/references/verification-guide.md +137 -0
- package/skills/repo-bootstrap/scripts/analyze-git-history.sh +315 -0
- package/skills/repo-bootstrap/scripts/check-freshness.sh +230 -0
- package/skills/repo-bootstrap/scripts/detect-golden-samples.sh +161 -0
- package/skills/repo-bootstrap/scripts/detect-heuristics.sh +93 -0
- package/skills/repo-bootstrap/scripts/detect-project.sh +486 -0
- package/skills/repo-bootstrap/scripts/detect-scopes.sh +330 -0
- package/skills/repo-bootstrap/scripts/detect-utilities.sh +133 -0
- package/skills/repo-bootstrap/scripts/extract-adrs.sh +194 -0
- package/skills/repo-bootstrap/scripts/extract-agent-configs.sh +331 -0
- package/skills/repo-bootstrap/scripts/extract-architecture-rules.sh +522 -0
- package/skills/repo-bootstrap/scripts/extract-ci-commands.sh +385 -0
- package/skills/repo-bootstrap/scripts/extract-ci-rules.sh +384 -0
- package/skills/repo-bootstrap/scripts/extract-commands.sh +358 -0
- package/skills/repo-bootstrap/scripts/extract-documentation.sh +308 -0
- package/skills/repo-bootstrap/scripts/extract-github-rulesets.sh +96 -0
- package/skills/repo-bootstrap/scripts/extract-github-settings.sh +88 -0
- package/skills/repo-bootstrap/scripts/extract-ide-settings.sh +228 -0
- package/skills/repo-bootstrap/scripts/extract-platform-files.sh +290 -0
- package/skills/repo-bootstrap/scripts/extract-quality-configs.sh +442 -0
- package/skills/repo-bootstrap/scripts/generate-agents.sh +2424 -0
- package/skills/repo-bootstrap/scripts/generate-file-map.sh +153 -0
- package/skills/repo-bootstrap/scripts/lib/config-root.sh +211 -0
- package/skills/repo-bootstrap/scripts/lib/summary.sh +244 -0
- package/skills/repo-bootstrap/scripts/lib/template.sh +397 -0
- package/skills/repo-bootstrap/scripts/validate-structure.sh +324 -0
- package/skills/repo-bootstrap/scripts/verify-commands.sh +615 -0
- package/skills/repo-bootstrap/scripts/verify-content.sh +302 -0
- package/skills/schema-api-contracts/SKILL.md +56 -0
- package/skills/secret-hygiene/SKILL.md +511 -0
- package/skills/secret-hygiene/assets/.gitkeep +9 -0
- package/skills/secret-hygiene/assets/config-balanced.toml +81 -0
- package/skills/secret-hygiene/assets/config-custom.toml +178 -0
- package/skills/secret-hygiene/assets/config-strict.toml +48 -0
- package/skills/secret-hygiene/assets/github-action.yml +181 -0
- package/skills/secret-hygiene/assets/gitlab-ci.yml +257 -0
- package/skills/secret-hygiene/assets/precommit-config.yaml +70 -0
- package/skills/secret-hygiene/references/EXAMPLE.md +40 -0
- package/skills/secret-hygiene/references/compliance_mapping.md +538 -0
- package/skills/secret-hygiene/references/detection_rules.md +276 -0
- package/skills/secret-hygiene/references/false_positives.md +598 -0
- package/skills/secret-hygiene/references/remediation_guide.md +530 -0
- package/skills/stack-selector/SKILL.md +56 -0
- package/skills/telegram-control/SKILL.md +110 -0
- package/skills/telegram-control/references/architecture.md +184 -0
- package/skills/telegram-control/references/convex.md +173 -0
- package/skills/telegram-control/references/error_handling.md +212 -0
- package/skills/telegram-control/references/initial_setup.md +165 -0
- package/skills/telegram-control/references/telegram_api.md +156 -0
- package/skills/telegram-control/scripts/cancel_message.ts +53 -0
- package/skills/telegram-control/scripts/list_scheduled.ts +103 -0
- package/skills/telegram-control/scripts/logger.ts +121 -0
- package/skills/telegram-control/scripts/proxy-util.ts +11 -0
- package/skills/telegram-control/scripts/schedule_message.ts +216 -0
- package/skills/telegram-control/scripts/send_message.ts +115 -0
- package/skills/telegram-control/scripts/setup.ts +185 -0
- package/skills/telegram-control/scripts/types.ts +75 -0
- package/skills/telegram-control/scripts/view_history.ts +74 -0
- package/skills/test-strategy/SKILL.md +352 -0
- package/skills/threat-model/SKILL.md +303 -0
- package/skills/threat-model/examples/example-output.md +196 -0
- package/skills/threat-model/template.md +96 -0
- package/skills/ts-lint/SKILL.md +80 -0
- package/skills/ui-flow/SKILL.md +668 -0
- package/skills/voice-command-router/SKILL.md +51 -0
- package/skills/widget-live-activity-sync/SKILL.md +66 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Checkov Compliance Framework Mapping
|
|
2
|
+
|
|
3
|
+
Mapping of Checkov checks to CIS, PCI-DSS, HIPAA, SOC2, NIST, and GDPR compliance requirements.
|
|
4
|
+
|
|
5
|
+
## CIS Benchmarks
|
|
6
|
+
|
|
7
|
+
### CIS AWS Foundations Benchmark v1.4
|
|
8
|
+
|
|
9
|
+
| Check ID | CIS Control | Description | Severity |
|
|
10
|
+
|----------|-------------|-------------|----------|
|
|
11
|
+
| CKV_AWS_19 | 2.1.1 | Ensure S3 bucket encryption at rest | HIGH |
|
|
12
|
+
| CKV_AWS_21 | 2.1.3 | Ensure S3 bucket versioning enabled | MEDIUM |
|
|
13
|
+
| CKV_AWS_18 | 2.1.5 | Ensure S3 bucket access logging | MEDIUM |
|
|
14
|
+
| CKV_AWS_23 | 4.1 | Security group ingress not 0.0.0.0/0 | HIGH |
|
|
15
|
+
| CKV_AWS_24 | 4.2 | Security group ingress not ::/0 | HIGH |
|
|
16
|
+
| CKV_AWS_40 | 1.16 | IAM policies no wildcard actions | HIGH |
|
|
17
|
+
| CKV_AWS_61 | 2.3.1 | RDS encryption at rest enabled | HIGH |
|
|
18
|
+
| CKV_AWS_16 | 2.3.1 | RDS storage encrypted | HIGH |
|
|
19
|
+
| CKV_AWS_17 | 2.3.2 | RDS backup retention period | MEDIUM |
|
|
20
|
+
| CKV_AWS_7 | 2.9 | EBS encryption by default | HIGH |
|
|
21
|
+
| CKV_AWS_93 | 2.4.1 | S3 bucket public access blocked | CRITICAL |
|
|
22
|
+
|
|
23
|
+
### CIS Kubernetes Benchmark v1.6
|
|
24
|
+
|
|
25
|
+
| Check ID | CIS Control | Description | Severity |
|
|
26
|
+
|----------|-------------|-------------|----------|
|
|
27
|
+
| CKV_K8S_16 | 5.2.1 | Container not privileged | HIGH |
|
|
28
|
+
| CKV_K8S_22 | 5.2.6 | Read-only root filesystem | HIGH |
|
|
29
|
+
| CKV_K8S_28 | 5.2.7 | Minimize capabilities | HIGH |
|
|
30
|
+
| CKV_K8S_10 | 5.2.13 | CPU requests configured | MEDIUM |
|
|
31
|
+
| CKV_K8S_11 | 5.2.13 | CPU limits configured | MEDIUM |
|
|
32
|
+
| CKV_K8S_12 | 5.2.14 | Memory requests configured | MEDIUM |
|
|
33
|
+
| CKV_K8S_13 | 5.2.14 | Memory limits configured | MEDIUM |
|
|
34
|
+
| CKV_K8S_8 | 5.2.15 | Liveness probe configured | MEDIUM |
|
|
35
|
+
| CKV_K8S_9 | 5.2.15 | Readiness probe configured | MEDIUM |
|
|
36
|
+
|
|
37
|
+
## PCI-DSS v3.2.1
|
|
38
|
+
|
|
39
|
+
### Requirement 2: Do not use vendor-supplied defaults
|
|
40
|
+
|
|
41
|
+
| Check ID | PCI Requirement | Description |
|
|
42
|
+
|----------|-----------------|-------------|
|
|
43
|
+
| CKV_AWS_41 | 2.1 | EKS encryption enabled |
|
|
44
|
+
| CKV_AWS_58 | 2.2 | EKS public access restricted |
|
|
45
|
+
| CKV_K8S_14 | 2.3 | Image tag not :latest |
|
|
46
|
+
|
|
47
|
+
### Requirement 3: Protect stored cardholder data
|
|
48
|
+
|
|
49
|
+
| Check ID | PCI Requirement | Description |
|
|
50
|
+
|----------|-----------------|-------------|
|
|
51
|
+
| CKV_AWS_19 | 3.4 | S3 bucket encrypted |
|
|
52
|
+
| CKV_AWS_61 | 3.4 | RDS encrypted at rest |
|
|
53
|
+
| CKV_AWS_7 | 3.4 | EBS encryption enabled |
|
|
54
|
+
| CKV_AWS_89 | 3.4 | DynamoDB encryption |
|
|
55
|
+
|
|
56
|
+
### Requirement 6: Develop and maintain secure systems
|
|
57
|
+
|
|
58
|
+
| Check ID | PCI Requirement | Description |
|
|
59
|
+
|----------|-----------------|-------------|
|
|
60
|
+
| CKV_AWS_23 | 6.2 | Security groups not open |
|
|
61
|
+
| CKV_AWS_40 | 6.5 | IAM no wildcard permissions |
|
|
62
|
+
| CKV_K8S_16 | 6.5 | No privileged containers |
|
|
63
|
+
|
|
64
|
+
### Requirement 10: Track and monitor all access
|
|
65
|
+
|
|
66
|
+
| Check ID | PCI Requirement | Description |
|
|
67
|
+
|----------|-----------------|-------------|
|
|
68
|
+
| CKV_AWS_18 | 10.2 | S3 access logging enabled |
|
|
69
|
+
| CKV_AWS_51 | 10.3 | ECR image scanning |
|
|
70
|
+
| CKV_AWS_46 | 10.5 | ECS task logging |
|
|
71
|
+
|
|
72
|
+
## HIPAA Security Rule
|
|
73
|
+
|
|
74
|
+
### Administrative Safeguards (§164.308)
|
|
75
|
+
|
|
76
|
+
| Check ID | HIPAA Control | Description |
|
|
77
|
+
|----------|---------------|-------------|
|
|
78
|
+
| CKV_AWS_40 | §164.308(a)(3) | IAM access controls |
|
|
79
|
+
| CKV_AWS_49 | §164.308(a)(4) | CloudTrail logging |
|
|
80
|
+
| CKV_AWS_38 | §164.308(a)(5) | EKS RBAC enabled |
|
|
81
|
+
|
|
82
|
+
### Physical Safeguards (§164.310)
|
|
83
|
+
|
|
84
|
+
| Check ID | HIPAA Control | Description |
|
|
85
|
+
|----------|---------------|-------------|
|
|
86
|
+
| CKV_AWS_19 | §164.310(d)(1) | Encryption at rest (S3) |
|
|
87
|
+
| CKV_AWS_7 | §164.310(d)(1) | Encryption at rest (EBS) |
|
|
88
|
+
| CKV_AWS_61 | §164.310(d)(1) | Encryption at rest (RDS) |
|
|
89
|
+
|
|
90
|
+
### Technical Safeguards (§164.312)
|
|
91
|
+
|
|
92
|
+
| Check ID | HIPAA Control | Description |
|
|
93
|
+
|----------|---------------|-------------|
|
|
94
|
+
| CKV_AWS_23 | §164.312(a)(1) | Access control (network) |
|
|
95
|
+
| CKV_AWS_18 | §164.312(b) | Audit logging (S3) |
|
|
96
|
+
| CKV_AWS_27 | §164.312(c)(1) | SQS encryption |
|
|
97
|
+
| CKV_AWS_20 | §164.312(e)(1) | S3 SSL/TLS enforced |
|
|
98
|
+
|
|
99
|
+
## SOC 2 Trust Service Criteria
|
|
100
|
+
|
|
101
|
+
### CC6.1: Logical and Physical Access Controls
|
|
102
|
+
|
|
103
|
+
| Check ID | TSC | Description |
|
|
104
|
+
|----------|-----|-------------|
|
|
105
|
+
| CKV_AWS_40 | CC6.1 | IAM least privilege |
|
|
106
|
+
| CKV_AWS_23 | CC6.1 | Network segmentation |
|
|
107
|
+
| CKV_K8S_21 | CC6.1 | Namespace defined |
|
|
108
|
+
|
|
109
|
+
### CC6.6: Encryption
|
|
110
|
+
|
|
111
|
+
| Check ID | TSC | Description |
|
|
112
|
+
|----------|-----|-------------|
|
|
113
|
+
| CKV_AWS_19 | CC6.6 | S3 encryption |
|
|
114
|
+
| CKV_AWS_7 | CC6.6 | EBS encryption |
|
|
115
|
+
| CKV_AWS_61 | CC6.6 | RDS encryption |
|
|
116
|
+
| CKV_AWS_20 | CC6.6 | S3 SSL enforced |
|
|
117
|
+
|
|
118
|
+
### CC7.2: System Monitoring
|
|
119
|
+
|
|
120
|
+
| Check ID | TSC | Description |
|
|
121
|
+
|----------|-----|-------------|
|
|
122
|
+
| CKV_AWS_18 | CC7.2 | S3 access logging |
|
|
123
|
+
| CKV_AWS_49 | CC7.2 | CloudTrail enabled |
|
|
124
|
+
| CKV_K8S_8 | CC7.2 | Liveness probe |
|
|
125
|
+
|
|
126
|
+
## NIST 800-53 Rev 5
|
|
127
|
+
|
|
128
|
+
### AC (Access Control)
|
|
129
|
+
|
|
130
|
+
| Check ID | NIST Control | Description |
|
|
131
|
+
|----------|--------------|-------------|
|
|
132
|
+
| CKV_AWS_40 | AC-3 | IAM least privilege |
|
|
133
|
+
| CKV_AWS_23 | AC-4 | Network access control |
|
|
134
|
+
| CKV_K8S_16 | AC-6 | Least privilege (containers) |
|
|
135
|
+
|
|
136
|
+
### AU (Audit and Accountability)
|
|
137
|
+
|
|
138
|
+
| Check ID | NIST Control | Description |
|
|
139
|
+
|----------|--------------|-------------|
|
|
140
|
+
| CKV_AWS_18 | AU-2 | S3 access logging |
|
|
141
|
+
| CKV_AWS_49 | AU-12 | CloudTrail logging |
|
|
142
|
+
| CKV_K8S_35 | AU-9 | Audit log protection |
|
|
143
|
+
|
|
144
|
+
### SC (System and Communications Protection)
|
|
145
|
+
|
|
146
|
+
| Check ID | NIST Control | Description |
|
|
147
|
+
|----------|--------------|-------------|
|
|
148
|
+
| CKV_AWS_19 | SC-28 | Encryption at rest (S3) |
|
|
149
|
+
| CKV_AWS_20 | SC-8 | Encryption in transit (S3) |
|
|
150
|
+
| CKV_AWS_7 | SC-28 | Encryption at rest (EBS) |
|
|
151
|
+
|
|
152
|
+
## GDPR
|
|
153
|
+
|
|
154
|
+
### Article 32: Security of Processing
|
|
155
|
+
|
|
156
|
+
| Check ID | GDPR Article | Description |
|
|
157
|
+
|----------|--------------|-------------|
|
|
158
|
+
| CKV_AWS_19 | Art. 32(1)(a) | Encryption of personal data |
|
|
159
|
+
| CKV_AWS_7 | Art. 32(1)(a) | EBS encryption |
|
|
160
|
+
| CKV_AWS_61 | Art. 32(1)(a) | RDS encryption |
|
|
161
|
+
| CKV_AWS_21 | Art. 32(1)(b) | Data backup (S3 versioning) |
|
|
162
|
+
| CKV_AWS_18 | Art. 32(1)(d) | Access logging |
|
|
163
|
+
|
|
164
|
+
### Article 25: Data Protection by Design
|
|
165
|
+
|
|
166
|
+
| Check ID | GDPR Article | Description |
|
|
167
|
+
|----------|--------------|-------------|
|
|
168
|
+
| CKV_AWS_93 | Art. 25 | S3 public access block |
|
|
169
|
+
| CKV_AWS_23 | Art. 25 | Network isolation |
|
|
170
|
+
| CKV_AWS_20 | Art. 25 | Secure transmission |
|
|
171
|
+
|
|
172
|
+
## Usage Examples
|
|
173
|
+
|
|
174
|
+
### Scan for CIS Compliance
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# CIS AWS Benchmark
|
|
178
|
+
checkov -d ./terraform --check CIS_AWS
|
|
179
|
+
|
|
180
|
+
# CIS Azure Benchmark
|
|
181
|
+
checkov -d ./terraform --check CIS_AZURE
|
|
182
|
+
|
|
183
|
+
# CIS Kubernetes Benchmark
|
|
184
|
+
checkov -d ./k8s --framework kubernetes --check CIS_KUBERNETES
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Scan for PCI-DSS Compliance
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Focus on encryption requirements (Req 3.4)
|
|
191
|
+
checkov -d ./terraform \
|
|
192
|
+
--check CKV_AWS_19,CKV_AWS_61,CKV_AWS_7,CKV_AWS_89
|
|
193
|
+
|
|
194
|
+
# Network security (Req 1, 2)
|
|
195
|
+
checkov -d ./terraform \
|
|
196
|
+
--check CKV_AWS_23,CKV_AWS_24,CKV_AWS_40
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Scan for HIPAA Compliance
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# HIPAA-focused scan
|
|
203
|
+
checkov -d ./terraform \
|
|
204
|
+
--check CKV_AWS_19,CKV_AWS_7,CKV_AWS_61,CKV_AWS_20,CKV_AWS_18,CKV_AWS_40
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Generate Compliance Report
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Comprehensive compliance report
|
|
211
|
+
checkov -d ./terraform \
|
|
212
|
+
-o json --output-file-path ./compliance-report \
|
|
213
|
+
--repo-id healthcare-infra \
|
|
214
|
+
--check CIS_AWS,PCI_DSS,HIPAA
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Compliance Matrix
|
|
218
|
+
|
|
219
|
+
| Framework | Checkov Support | Common Checks | Report Format |
|
|
220
|
+
|-----------|-----------------|---------------|---------------|
|
|
221
|
+
| CIS AWS | ✓ Full | 100+ checks | JSON, CLI, SARIF |
|
|
222
|
+
| CIS Azure | ✓ Full | 80+ checks | JSON, CLI, SARIF |
|
|
223
|
+
| CIS Kubernetes | ✓ Full | 50+ checks | JSON, CLI, SARIF |
|
|
224
|
+
| PCI-DSS 3.2.1 | ✓ Partial | 30+ checks | JSON, CLI |
|
|
225
|
+
| HIPAA | ✓ Partial | 40+ checks | JSON, CLI |
|
|
226
|
+
| SOC 2 | ✓ Partial | 35+ checks | JSON, CLI |
|
|
227
|
+
| NIST 800-53 | ✓ Mapping | 60+ checks | JSON, CLI |
|
|
228
|
+
| GDPR | ✓ Mapping | 25+ checks | JSON, CLI |
|
|
229
|
+
|
|
230
|
+
## Additional Resources
|
|
231
|
+
|
|
232
|
+
- [CIS Benchmarks](https://www.cisecurity.org/cis-benchmarks/)
|
|
233
|
+
- [PCI Security Standards](https://www.pcisecuritystandards.org/)
|
|
234
|
+
- [HIPAA Security Rule](https://www.hhs.gov/hipaa/for-professionals/security/index.html)
|
|
235
|
+
- [AICPA SOC 2](https://www.aicpa.org/soc4so)
|
|
236
|
+
- [NIST 800-53](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final)
|
|
237
|
+
- [GDPR Portal](https://gdpr.eu/)
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
# Checkov Custom Policy Development Guide
|
|
2
|
+
|
|
3
|
+
Complete guide for creating organization-specific security policies in Python and YAML.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Custom policies allow you to enforce organization-specific security requirements beyond Checkov's built-in checks. Policies can be written in:
|
|
8
|
+
|
|
9
|
+
- **Python**: Full programmatic control, graph-based analysis
|
|
10
|
+
- **YAML**: Simple attribute checks, easy to maintain
|
|
11
|
+
|
|
12
|
+
## Python-Based Custom Policies
|
|
13
|
+
|
|
14
|
+
### Basic Resource Check
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
# custom_checks/require_resource_tags.py
|
|
18
|
+
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
|
|
19
|
+
from checkov.common.models.enums import CheckResult, CheckCategories
|
|
20
|
+
|
|
21
|
+
class RequireResourceTags(BaseResourceCheck):
|
|
22
|
+
def __init__(self):
|
|
23
|
+
name = "Ensure all resources have required tags"
|
|
24
|
+
id = "CKV_AWS_CUSTOM_001"
|
|
25
|
+
supported_resources = ['aws_*'] # All AWS resources
|
|
26
|
+
categories = [CheckCategories.CONVENTION]
|
|
27
|
+
super().__init__(name=name, id=id, categories=categories,
|
|
28
|
+
supported_resources=supported_resources)
|
|
29
|
+
|
|
30
|
+
def scan_resource_conf(self, conf):
|
|
31
|
+
"""Check if resource has required tags."""
|
|
32
|
+
required_tags = ['Environment', 'Owner', 'CostCenter']
|
|
33
|
+
|
|
34
|
+
tags = conf.get('tags')
|
|
35
|
+
if not tags or not isinstance(tags, list):
|
|
36
|
+
return CheckResult.FAILED
|
|
37
|
+
|
|
38
|
+
tag_dict = tags[0] if tags else {}
|
|
39
|
+
|
|
40
|
+
for required_tag in required_tags:
|
|
41
|
+
if required_tag not in tag_dict:
|
|
42
|
+
self.evaluated_keys = ['tags']
|
|
43
|
+
return CheckResult.FAILED
|
|
44
|
+
|
|
45
|
+
return CheckResult.PASSED
|
|
46
|
+
|
|
47
|
+
check = RequireResourceTags()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Graph-Based Policy
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
# custom_checks/s3_bucket_policy_public.py
|
|
54
|
+
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
|
|
55
|
+
from checkov.common.models.enums import CheckResult, CheckCategories
|
|
56
|
+
|
|
57
|
+
class S3BucketPolicyNotPublic(BaseResourceCheck):
|
|
58
|
+
def __init__(self):
|
|
59
|
+
name = "Ensure S3 bucket policy doesn't allow public access"
|
|
60
|
+
id = "CKV_AWS_CUSTOM_002"
|
|
61
|
+
supported_resources = ['aws_s3_bucket_policy']
|
|
62
|
+
categories = [CheckCategories.IAM]
|
|
63
|
+
super().__init__(name=name, id=id, categories=categories,
|
|
64
|
+
supported_resources=supported_resources)
|
|
65
|
+
|
|
66
|
+
def scan_resource_conf(self, conf):
|
|
67
|
+
"""Scan S3 bucket policy for public access."""
|
|
68
|
+
policy = conf.get('policy')
|
|
69
|
+
if not policy:
|
|
70
|
+
return CheckResult.PASSED
|
|
71
|
+
|
|
72
|
+
import json
|
|
73
|
+
try:
|
|
74
|
+
policy_doc = json.loads(policy[0]) if isinstance(policy, list) else json.loads(policy)
|
|
75
|
+
except (json.JSONDecodeError, TypeError):
|
|
76
|
+
return CheckResult.UNKNOWN
|
|
77
|
+
|
|
78
|
+
statements = policy_doc.get('Statement', [])
|
|
79
|
+
for statement in statements:
|
|
80
|
+
effect = statement.get('Effect')
|
|
81
|
+
principal = statement.get('Principal', {})
|
|
82
|
+
|
|
83
|
+
# Check for public access
|
|
84
|
+
if effect == 'Allow':
|
|
85
|
+
if principal == '*' or principal.get('AWS') == '*':
|
|
86
|
+
return CheckResult.FAILED
|
|
87
|
+
|
|
88
|
+
return CheckResult.PASSED
|
|
89
|
+
|
|
90
|
+
check = S3BucketPolicyNotPublic()
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Connection-Aware Check (Graph)
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
# custom_checks/ec2_in_private_subnet.py
|
|
97
|
+
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck
|
|
98
|
+
from checkov.common.models.enums import CheckResult, CheckCategories
|
|
99
|
+
|
|
100
|
+
class EC2InPrivateSubnet(BaseResourceCheck):
|
|
101
|
+
def __init__(self):
|
|
102
|
+
name = "Ensure EC2 instances are in private subnets"
|
|
103
|
+
id = "CKV_AWS_CUSTOM_003"
|
|
104
|
+
supported_resources = ['aws_instance']
|
|
105
|
+
categories = [CheckCategories.NETWORKING]
|
|
106
|
+
super().__init__(name=name, id=id, categories=categories,
|
|
107
|
+
supported_resources=supported_resources)
|
|
108
|
+
|
|
109
|
+
def scan_resource_conf(self, conf, entity_type):
|
|
110
|
+
"""Check if EC2 instance is in private subnet."""
|
|
111
|
+
subnet_id = conf.get('subnet_id')
|
|
112
|
+
if not subnet_id:
|
|
113
|
+
return CheckResult.PASSED
|
|
114
|
+
|
|
115
|
+
# Use graph to find connected subnet
|
|
116
|
+
# This requires access to the graph context
|
|
117
|
+
# Implementation depends on Checkov version
|
|
118
|
+
|
|
119
|
+
return CheckResult.UNKNOWN # Implement graph logic
|
|
120
|
+
|
|
121
|
+
check = EC2InPrivateSubnet()
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## YAML-Based Custom Policies
|
|
125
|
+
|
|
126
|
+
### Simple Attribute Check
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
# custom_checks/s3_lifecycle.yaml
|
|
130
|
+
metadata:
|
|
131
|
+
id: "CKV_AWS_CUSTOM_004"
|
|
132
|
+
name: "Ensure S3 buckets have lifecycle policies"
|
|
133
|
+
category: "BACKUP_AND_RECOVERY"
|
|
134
|
+
severity: "MEDIUM"
|
|
135
|
+
|
|
136
|
+
definition:
|
|
137
|
+
cond_type: "attribute"
|
|
138
|
+
resource_types:
|
|
139
|
+
- "aws_s3_bucket"
|
|
140
|
+
attribute: "lifecycle_rule"
|
|
141
|
+
operator: "exists"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Complex Logic
|
|
145
|
+
|
|
146
|
+
```yaml
|
|
147
|
+
# custom_checks/rds_multi_az.yaml
|
|
148
|
+
metadata:
|
|
149
|
+
id: "CKV_AWS_CUSTOM_005"
|
|
150
|
+
name: "Ensure RDS instances are multi-AZ for production"
|
|
151
|
+
category: "BACKUP_AND_RECOVERY"
|
|
152
|
+
severity: "HIGH"
|
|
153
|
+
|
|
154
|
+
definition:
|
|
155
|
+
or:
|
|
156
|
+
- cond_type: "attribute"
|
|
157
|
+
resource_types:
|
|
158
|
+
- "aws_db_instance"
|
|
159
|
+
attribute: "multi_az"
|
|
160
|
+
operator: "equals"
|
|
161
|
+
value: true
|
|
162
|
+
|
|
163
|
+
- and:
|
|
164
|
+
- cond_type: "attribute"
|
|
165
|
+
resource_types:
|
|
166
|
+
- "aws_db_instance"
|
|
167
|
+
attribute: "tags.Environment"
|
|
168
|
+
operator: "not_equals"
|
|
169
|
+
value: "production"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Kubernetes Policy
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
# custom_checks/k8s_service_account.yaml
|
|
176
|
+
metadata:
|
|
177
|
+
id: "CKV_K8S_CUSTOM_001"
|
|
178
|
+
name: "Ensure pods use dedicated service accounts"
|
|
179
|
+
category: "IAM"
|
|
180
|
+
severity: "HIGH"
|
|
181
|
+
|
|
182
|
+
definition:
|
|
183
|
+
cond_type: "attribute"
|
|
184
|
+
resource_types:
|
|
185
|
+
- "Pod"
|
|
186
|
+
- "Deployment"
|
|
187
|
+
- "StatefulSet"
|
|
188
|
+
- "DaemonSet"
|
|
189
|
+
attribute: "spec.serviceAccountName"
|
|
190
|
+
operator: "not_equals"
|
|
191
|
+
value: "default"
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Policy Structure
|
|
195
|
+
|
|
196
|
+
### Python Policy Template
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
#!/usr/bin/env python3
|
|
200
|
+
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
|
|
201
|
+
from checkov.common.models.enums import CheckResult, CheckCategories
|
|
202
|
+
|
|
203
|
+
class MyCustomCheck(BaseResourceCheck):
|
|
204
|
+
def __init__(self):
|
|
205
|
+
# Metadata
|
|
206
|
+
name = "Check description"
|
|
207
|
+
id = "CKV_[PROVIDER]_CUSTOM_[NUMBER]" # e.g., CKV_AWS_CUSTOM_001
|
|
208
|
+
supported_resources = ['resource_type'] # e.g., ['aws_s3_bucket']
|
|
209
|
+
categories = [CheckCategories.CATEGORY] # See categories below
|
|
210
|
+
guideline = "https://docs.example.com/security-policy"
|
|
211
|
+
|
|
212
|
+
super().__init__(
|
|
213
|
+
name=name,
|
|
214
|
+
id=id,
|
|
215
|
+
categories=categories,
|
|
216
|
+
supported_resources=supported_resources,
|
|
217
|
+
guideline=guideline
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
def scan_resource_conf(self, conf, entity_type=None):
|
|
221
|
+
"""
|
|
222
|
+
Scan resource configuration for compliance.
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
conf: Resource configuration dictionary
|
|
226
|
+
entity_type: Resource type (optional)
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
CheckResult.PASSED, CheckResult.FAILED, or CheckResult.UNKNOWN
|
|
230
|
+
"""
|
|
231
|
+
# Implementation
|
|
232
|
+
if self.check_condition(conf):
|
|
233
|
+
return CheckResult.PASSED
|
|
234
|
+
|
|
235
|
+
self.evaluated_keys = ['attribute_that_failed']
|
|
236
|
+
return CheckResult.FAILED
|
|
237
|
+
|
|
238
|
+
def get_inspected_key(self):
|
|
239
|
+
"""Return the key that was checked."""
|
|
240
|
+
return 'attribute_name'
|
|
241
|
+
|
|
242
|
+
check = MyCustomCheck()
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Check Categories
|
|
246
|
+
|
|
247
|
+
```python
|
|
248
|
+
from checkov.common.models.enums import CheckCategories
|
|
249
|
+
|
|
250
|
+
# Available categories:
|
|
251
|
+
CheckCategories.IAM
|
|
252
|
+
CheckCategories.NETWORKING
|
|
253
|
+
CheckCategories.ENCRYPTION
|
|
254
|
+
CheckCategories.LOGGING
|
|
255
|
+
CheckCategories.BACKUP_AND_RECOVERY
|
|
256
|
+
CheckCategories.CONVENTION
|
|
257
|
+
CheckCategories.SECRETS
|
|
258
|
+
CheckCategories.KUBERNETES
|
|
259
|
+
CheckCategories.API_SECURITY
|
|
260
|
+
CheckCategories.SUPPLY_CHAIN
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Loading Custom Policies
|
|
264
|
+
|
|
265
|
+
### Directory Structure
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
custom_checks/
|
|
269
|
+
├── aws/
|
|
270
|
+
│ ├── require_tags.py
|
|
271
|
+
│ ├── s3_lifecycle.yaml
|
|
272
|
+
│ └── rds_backups.py
|
|
273
|
+
├── kubernetes/
|
|
274
|
+
│ ├── require_resource_limits.py
|
|
275
|
+
│ └── security_context.yaml
|
|
276
|
+
└── azure/
|
|
277
|
+
└── storage_encryption.py
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Load Policies
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
# Load from directory
|
|
284
|
+
checkov -d ./terraform --external-checks-dir ./custom_checks
|
|
285
|
+
|
|
286
|
+
# Load specific policy
|
|
287
|
+
checkov -d ./terraform --external-checks-git https://github.com/org/policies.git
|
|
288
|
+
|
|
289
|
+
# List loaded custom checks
|
|
290
|
+
checkov -d ./terraform --external-checks-dir ./custom_checks --list
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Testing Custom Policies
|
|
294
|
+
|
|
295
|
+
### Unit Testing
|
|
296
|
+
|
|
297
|
+
```python
|
|
298
|
+
# tests/test_require_tags.py
|
|
299
|
+
import unittest
|
|
300
|
+
from custom_checks.require_resource_tags import RequireResourceTags
|
|
301
|
+
from checkov.common.models.enums import CheckResult
|
|
302
|
+
|
|
303
|
+
class TestRequireResourceTags(unittest.TestCase):
|
|
304
|
+
def setUp(self):
|
|
305
|
+
self.check = RequireResourceTags()
|
|
306
|
+
|
|
307
|
+
def test_pass_with_all_tags(self):
|
|
308
|
+
resource_conf = {
|
|
309
|
+
'tags': [{
|
|
310
|
+
'Environment': 'production',
|
|
311
|
+
'Owner': 'team@example.com',
|
|
312
|
+
'CostCenter': 'engineering'
|
|
313
|
+
}]
|
|
314
|
+
}
|
|
315
|
+
result = self.check.scan_resource_conf(resource_conf)
|
|
316
|
+
self.assertEqual(result, CheckResult.PASSED)
|
|
317
|
+
|
|
318
|
+
def test_fail_missing_tag(self):
|
|
319
|
+
resource_conf = {
|
|
320
|
+
'tags': [{
|
|
321
|
+
'Environment': 'production',
|
|
322
|
+
'Owner': 'team@example.com'
|
|
323
|
+
# Missing CostCenter
|
|
324
|
+
}]
|
|
325
|
+
}
|
|
326
|
+
result = self.check.scan_resource_conf(resource_conf)
|
|
327
|
+
self.assertEqual(result, CheckResult.FAILED)
|
|
328
|
+
|
|
329
|
+
def test_fail_no_tags(self):
|
|
330
|
+
resource_conf = {}
|
|
331
|
+
result = self.check.scan_resource_conf(resource_conf)
|
|
332
|
+
self.assertEqual(result, CheckResult.FAILED)
|
|
333
|
+
|
|
334
|
+
if __name__ == '__main__':
|
|
335
|
+
unittest.main()
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Integration Testing
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# Test against sample infrastructure
|
|
342
|
+
checkov -d ./tests/fixtures/terraform \
|
|
343
|
+
--external-checks-dir ./custom_checks \
|
|
344
|
+
--check CKV_AWS_CUSTOM_001
|
|
345
|
+
|
|
346
|
+
# Verify output format
|
|
347
|
+
checkov -d ./tests/fixtures/terraform \
|
|
348
|
+
--external-checks-dir ./custom_checks \
|
|
349
|
+
-o json | jq '.results.failed_checks[] | select(.check_id == "CKV_AWS_CUSTOM_001")'
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Common Patterns
|
|
353
|
+
|
|
354
|
+
### Pattern 1: Naming Convention Check
|
|
355
|
+
|
|
356
|
+
```python
|
|
357
|
+
import re
|
|
358
|
+
|
|
359
|
+
class ResourceNamingConvention(BaseResourceCheck):
|
|
360
|
+
def scan_resource_conf(self, conf):
|
|
361
|
+
"""Enforce naming convention: env-app-resource"""
|
|
362
|
+
pattern = r'^(dev|staging|prod)-[a-z]+-[a-z0-9-]+$'
|
|
363
|
+
|
|
364
|
+
name = conf.get('name')
|
|
365
|
+
if not name or not isinstance(name, list):
|
|
366
|
+
return CheckResult.FAILED
|
|
367
|
+
|
|
368
|
+
resource_name = name[0] if isinstance(name[0], str) else str(name[0])
|
|
369
|
+
|
|
370
|
+
if not re.match(pattern, resource_name):
|
|
371
|
+
self.evaluated_keys = ['name']
|
|
372
|
+
return CheckResult.FAILED
|
|
373
|
+
|
|
374
|
+
return CheckResult.PASSED
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Pattern 2: Environment-Specific Requirements
|
|
378
|
+
|
|
379
|
+
```python
|
|
380
|
+
class ProductionEncryption(BaseResourceCheck):
|
|
381
|
+
def scan_resource_conf(self, conf):
|
|
382
|
+
"""Require encryption for production resources."""
|
|
383
|
+
tags = conf.get('tags', [{}])[0]
|
|
384
|
+
environment = tags.get('Environment', '')
|
|
385
|
+
|
|
386
|
+
# Only enforce for production
|
|
387
|
+
if environment.lower() != 'production':
|
|
388
|
+
return CheckResult.PASSED
|
|
389
|
+
|
|
390
|
+
# Check encryption
|
|
391
|
+
encryption_enabled = conf.get('server_side_encryption_configuration')
|
|
392
|
+
if not encryption_enabled:
|
|
393
|
+
return CheckResult.FAILED
|
|
394
|
+
|
|
395
|
+
return CheckResult.PASSED
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Pattern 3: Cost Optimization
|
|
399
|
+
|
|
400
|
+
```python
|
|
401
|
+
class EC2InstanceSizing(BaseResourceCheck):
|
|
402
|
+
def scan_resource_conf(self, conf):
|
|
403
|
+
"""Prevent oversized instances in non-production."""
|
|
404
|
+
tags = conf.get('tags', [{}])[0]
|
|
405
|
+
environment = tags.get('Environment', '')
|
|
406
|
+
|
|
407
|
+
# Only restrict non-production
|
|
408
|
+
if environment.lower() == 'production':
|
|
409
|
+
return CheckResult.PASSED
|
|
410
|
+
|
|
411
|
+
instance_type = conf.get('instance_type', [''])[0]
|
|
412
|
+
oversized_types = ['c5.9xlarge', 'c5.12xlarge', 'c5.18xlarge']
|
|
413
|
+
|
|
414
|
+
if instance_type in oversized_types:
|
|
415
|
+
self.evaluated_keys = ['instance_type']
|
|
416
|
+
return CheckResult.FAILED
|
|
417
|
+
|
|
418
|
+
return CheckResult.PASSED
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Best Practices
|
|
422
|
+
|
|
423
|
+
1. **ID Convention**: Use `CKV_[PROVIDER]_CUSTOM_[NUMBER]` format
|
|
424
|
+
2. **Documentation**: Include guideline URL in check metadata
|
|
425
|
+
3. **Error Handling**: Return `CheckResult.UNKNOWN` for ambiguous cases
|
|
426
|
+
4. **Performance**: Minimize complex operations in scan loops
|
|
427
|
+
5. **Testing**: Write unit tests for all custom policies
|
|
428
|
+
6. **Versioning**: Track policy versions in version control
|
|
429
|
+
7. **Review Process**: Require security team review before deployment
|
|
430
|
+
|
|
431
|
+
## Troubleshooting
|
|
432
|
+
|
|
433
|
+
### Policy Not Loading
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
# Debug loading
|
|
437
|
+
checkov -d ./terraform --external-checks-dir ./custom_checks -v
|
|
438
|
+
|
|
439
|
+
# Verify syntax
|
|
440
|
+
python3 custom_checks/my_policy.py
|
|
441
|
+
|
|
442
|
+
# Check for import errors
|
|
443
|
+
python3 -c "import custom_checks.my_policy"
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Policy Not Triggering
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
# Verify resource type matches
|
|
450
|
+
checkov -d ./terraform --external-checks-dir ./custom_checks --list
|
|
451
|
+
|
|
452
|
+
# Test with specific check
|
|
453
|
+
checkov -d ./terraform --check CKV_AWS_CUSTOM_001 -v
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
## Additional Resources
|
|
457
|
+
|
|
458
|
+
- [Checkov Custom Policies Documentation](https://www.checkov.io/3.Custom%20Policies/Custom%20Policies%20Overview.html)
|
|
459
|
+
- [Python Policy Examples](https://github.com/bridgecrewio/checkov/tree/master/checkov/terraform/checks)
|
|
460
|
+
- [YAML Policy Examples](https://github.com/bridgecrewio/checkov/tree/master/checkov/terraform/checks/graph_checks)
|