@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,302 @@
|
|
|
1
|
+
# Observability
|
|
2
|
+
|
|
3
|
+
**Directive:** When generating or reviewing any production workload, ALWAYS include metrics exposure, structured logging, and health probes. Observability is not optional -- if you cannot measure it, you cannot operate it. Default security posture is PSS "restricted" profile.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Consult this reference whenever the task involves:
|
|
8
|
+
- Deploying any workload to a production or staging cluster
|
|
9
|
+
- Setting up monitoring, alerting, or dashboards
|
|
10
|
+
- Investigating incidents or performing post-mortems
|
|
11
|
+
- Capacity planning or performance analysis
|
|
12
|
+
- Configuring log aggregation or distributed tracing
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Probes as the Foundation
|
|
17
|
+
|
|
18
|
+
Liveness, readiness, and startup probes are the most basic form of observability -- they tell Kubernetes whether your application is alive, ready, and initialized. See **fragile-rollouts.md** for detailed probe configuration rules. Without correct probes, no amount of metrics or logging will prevent cascading failures.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Prometheus Metrics Exposure
|
|
23
|
+
|
|
24
|
+
### Annotations pattern (works without prometheus-operator)
|
|
25
|
+
|
|
26
|
+
Add annotations to the Pod template so Prometheus discovers and scrapes the target:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
apiVersion: apps/v1
|
|
30
|
+
kind: Deployment
|
|
31
|
+
metadata:
|
|
32
|
+
name: order-service
|
|
33
|
+
namespace: orders
|
|
34
|
+
spec:
|
|
35
|
+
replicas: 3
|
|
36
|
+
selector:
|
|
37
|
+
matchLabels:
|
|
38
|
+
app: order-service
|
|
39
|
+
template:
|
|
40
|
+
metadata:
|
|
41
|
+
labels:
|
|
42
|
+
app: order-service
|
|
43
|
+
annotations:
|
|
44
|
+
prometheus.io/scrape: "true"
|
|
45
|
+
prometheus.io/port: "9090"
|
|
46
|
+
prometheus.io/path: "/metrics"
|
|
47
|
+
spec:
|
|
48
|
+
automountServiceAccountToken: false
|
|
49
|
+
securityContext:
|
|
50
|
+
runAsNonRoot: true
|
|
51
|
+
runAsUser: 10000
|
|
52
|
+
runAsGroup: 10000
|
|
53
|
+
seccompProfile:
|
|
54
|
+
type: RuntimeDefault
|
|
55
|
+
containers:
|
|
56
|
+
- name: app
|
|
57
|
+
image: registry.example.com/order-service:v1.8.3
|
|
58
|
+
ports:
|
|
59
|
+
- name: http
|
|
60
|
+
containerPort: 8080
|
|
61
|
+
- name: metrics
|
|
62
|
+
containerPort: 9090
|
|
63
|
+
securityContext:
|
|
64
|
+
allowPrivilegeEscalation: false
|
|
65
|
+
readOnlyRootFilesystem: true
|
|
66
|
+
capabilities:
|
|
67
|
+
drop: ["ALL"]
|
|
68
|
+
resources:
|
|
69
|
+
requests:
|
|
70
|
+
cpu: 100m
|
|
71
|
+
memory: 128Mi
|
|
72
|
+
limits:
|
|
73
|
+
memory: 256Mi
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### ServiceMonitor (prometheus-operator)
|
|
77
|
+
|
|
78
|
+
When using prometheus-operator, prefer ServiceMonitor CRDs over annotations for type-safe configuration:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
apiVersion: monitoring.coreos.com/v1
|
|
82
|
+
kind: ServiceMonitor
|
|
83
|
+
metadata:
|
|
84
|
+
name: order-service
|
|
85
|
+
namespace: orders
|
|
86
|
+
labels:
|
|
87
|
+
release: kube-prometheus-stack # must match Prometheus operator selector
|
|
88
|
+
spec:
|
|
89
|
+
selector:
|
|
90
|
+
matchLabels:
|
|
91
|
+
app: order-service
|
|
92
|
+
endpoints:
|
|
93
|
+
- port: metrics # must match Service port name
|
|
94
|
+
interval: 30s
|
|
95
|
+
path: /metrics
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
PodMonitor follows the same pattern but targets pods directly (useful when no Service exists, e.g., CronJobs with metrics).
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Key Metrics -- the RED Method
|
|
103
|
+
|
|
104
|
+
Every service should expose at minimum:
|
|
105
|
+
|
|
106
|
+
| Signal | Metric | Example |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| **R**ate | Request throughput | `http_requests_total` (counter) |
|
|
109
|
+
| **E**rrors | Failed request count | `http_requests_total{status=~"5.."}` or a dedicated error counter |
|
|
110
|
+
| **D**uration | Request latency | `http_request_duration_seconds` (histogram with buckets) |
|
|
111
|
+
|
|
112
|
+
For resource-oriented services (queues, databases), add **saturation** metrics: queue depth, connection pool usage, disk I/O utilization.
|
|
113
|
+
|
|
114
|
+
Use histogram buckets aligned to your SLOs:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
http_request_duration_seconds_bucket{le="0.05"} # 50ms - fast API
|
|
118
|
+
http_request_duration_seconds_bucket{le="0.1"}
|
|
119
|
+
http_request_duration_seconds_bucket{le="0.25"}
|
|
120
|
+
http_request_duration_seconds_bucket{le="0.5"}
|
|
121
|
+
http_request_duration_seconds_bucket{le="1.0"}
|
|
122
|
+
http_request_duration_seconds_bucket{le="2.5"}
|
|
123
|
+
http_request_duration_seconds_bucket{le="5.0"}
|
|
124
|
+
http_request_duration_seconds_bucket{le="10.0"}
|
|
125
|
+
http_request_duration_seconds_bucket{le="+Inf"}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Logging
|
|
131
|
+
|
|
132
|
+
### Structured JSON to stdout
|
|
133
|
+
|
|
134
|
+
Applications MUST log structured JSON to stdout/stderr. Never log to files inside the container -- it defeats node-level collection and fills the writable layer.
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{"timestamp":"2025-03-15T10:23:45Z","level":"error","msg":"payment failed","trace_id":"abc123","order_id":"ord-789","error":"timeout after 5s"}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Rules:
|
|
141
|
+
- Use `timestamp`, `level`, `msg` as standard fields.
|
|
142
|
+
- Include `trace_id` and `span_id` for correlation with distributed traces.
|
|
143
|
+
- Never log secrets, tokens, PII, or full request bodies.
|
|
144
|
+
- Use `stderr` for error-level logs and `stdout` for everything else (some collectors distinguish).
|
|
145
|
+
|
|
146
|
+
### Log aggregation -- DaemonSet pattern
|
|
147
|
+
|
|
148
|
+
Fluent Bit runs as a DaemonSet on every node, reads container logs from `/var/log/containers/`, and forwards to a sink:
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
apiVersion: apps/v1
|
|
152
|
+
kind: DaemonSet
|
|
153
|
+
metadata:
|
|
154
|
+
name: fluent-bit
|
|
155
|
+
namespace: logging
|
|
156
|
+
spec:
|
|
157
|
+
selector:
|
|
158
|
+
matchLabels:
|
|
159
|
+
app: fluent-bit
|
|
160
|
+
template:
|
|
161
|
+
metadata:
|
|
162
|
+
labels:
|
|
163
|
+
app: fluent-bit
|
|
164
|
+
spec:
|
|
165
|
+
serviceAccountName: fluent-bit
|
|
166
|
+
containers:
|
|
167
|
+
- name: fluent-bit
|
|
168
|
+
image: fluent/fluent-bit:3.0
|
|
169
|
+
volumeMounts:
|
|
170
|
+
- name: varlog
|
|
171
|
+
mountPath: /var/log
|
|
172
|
+
readOnly: true
|
|
173
|
+
- name: containers
|
|
174
|
+
mountPath: /var/lib/docker/containers
|
|
175
|
+
readOnly: true
|
|
176
|
+
resources:
|
|
177
|
+
requests:
|
|
178
|
+
cpu: 50m
|
|
179
|
+
memory: 64Mi
|
|
180
|
+
limits:
|
|
181
|
+
memory: 128Mi
|
|
182
|
+
volumes:
|
|
183
|
+
- name: varlog
|
|
184
|
+
hostPath:
|
|
185
|
+
path: /var/log
|
|
186
|
+
- name: containers
|
|
187
|
+
hostPath:
|
|
188
|
+
path: /var/lib/docker/containers
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Node-level collection (DaemonSet) is preferred over sidecar collection for most workloads. Use sidecars only when you need per-pod log transformation or the application cannot log to stdout.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Distributed Tracing -- OpenTelemetry
|
|
196
|
+
|
|
197
|
+
### Auto-instrumentation with the OTel Operator
|
|
198
|
+
|
|
199
|
+
The OpenTelemetry Operator can inject instrumentation sidecars via annotation:
|
|
200
|
+
|
|
201
|
+
```yaml
|
|
202
|
+
metadata:
|
|
203
|
+
annotations:
|
|
204
|
+
instrumentation.opentelemetry.io/inject-java: "true" # or inject-python, inject-nodejs
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### OTel Collector sidecar pattern
|
|
208
|
+
|
|
209
|
+
For fine-grained control, run the OTel Collector as a sidecar:
|
|
210
|
+
|
|
211
|
+
```yaml
|
|
212
|
+
- name: otel-collector
|
|
213
|
+
image: otel/opentelemetry-collector-contrib:0.98.0
|
|
214
|
+
args: ["--config=/etc/otel/config.yaml"]
|
|
215
|
+
ports:
|
|
216
|
+
- containerPort: 4317 # gRPC OTLP receiver
|
|
217
|
+
- containerPort: 4318 # HTTP OTLP receiver
|
|
218
|
+
securityContext:
|
|
219
|
+
allowPrivilegeEscalation: false
|
|
220
|
+
readOnlyRootFilesystem: true
|
|
221
|
+
capabilities:
|
|
222
|
+
drop: ["ALL"]
|
|
223
|
+
resources:
|
|
224
|
+
requests:
|
|
225
|
+
cpu: 50m
|
|
226
|
+
memory: 64Mi
|
|
227
|
+
limits:
|
|
228
|
+
memory: 128Mi
|
|
229
|
+
volumeMounts:
|
|
230
|
+
- name: otel-config
|
|
231
|
+
mountPath: /etc/otel
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Propagate trace context (`traceparent` header / W3C Trace Context) across all service boundaries. Without propagation, traces are fragmented and useless.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Alerting -- PrometheusRule
|
|
239
|
+
|
|
240
|
+
Write symptom-based alerts (what the user experiences), not cause-based alerts (what broke internally):
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
apiVersion: monitoring.coreos.com/v1
|
|
244
|
+
kind: PrometheusRule
|
|
245
|
+
metadata:
|
|
246
|
+
name: order-service-alerts
|
|
247
|
+
namespace: orders
|
|
248
|
+
spec:
|
|
249
|
+
groups:
|
|
250
|
+
- name: order-service.rules
|
|
251
|
+
rules:
|
|
252
|
+
- alert: HighErrorRate
|
|
253
|
+
expr: |
|
|
254
|
+
sum(rate(http_requests_total{job="order-service",status=~"5.."}[5m]))
|
|
255
|
+
/ sum(rate(http_requests_total{job="order-service"}[5m])) > 0.05
|
|
256
|
+
for: 5m
|
|
257
|
+
labels:
|
|
258
|
+
severity: critical
|
|
259
|
+
annotations:
|
|
260
|
+
summary: "Order service error rate above 5%"
|
|
261
|
+
runbook_url: "https://wiki.example.com/runbooks/order-service-errors"
|
|
262
|
+
- alert: HighLatencyP99
|
|
263
|
+
expr: |
|
|
264
|
+
histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{job="order-service"}[5m])) by (le)) > 2.0
|
|
265
|
+
for: 10m
|
|
266
|
+
labels:
|
|
267
|
+
severity: warning
|
|
268
|
+
annotations:
|
|
269
|
+
summary: "Order service p99 latency above 2s"
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Every alert MUST have a `runbook_url` annotation pointing to actionable remediation steps.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Deployment Annotations for Grafana
|
|
277
|
+
|
|
278
|
+
Annotate deployments in Grafana to correlate metric changes with releases:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
curl -s -X POST http://grafana.monitoring.svc:3000/api/annotations \
|
|
282
|
+
-H "Content-Type: application/json" \
|
|
283
|
+
-H "Authorization: Bearer $GRAFANA_API_KEY" \
|
|
284
|
+
-d "{\"text\":\"Deployed order-service v1.8.3\",\"tags\":[\"deployment\",\"orders\"]}"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Integrate this into your CI/CD pipeline as a post-deploy step.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## LLM Mistake Checklist
|
|
292
|
+
|
|
293
|
+
Before finalizing any workload manifest or observability configuration, verify each item:
|
|
294
|
+
|
|
295
|
+
- [ ] **Prometheus annotations** are on the Pod template `metadata.annotations`, not on the Deployment metadata.
|
|
296
|
+
- [ ] **Metrics port** is declared in the container `ports` list and matches the annotation value.
|
|
297
|
+
- [ ] **Logs are structured JSON to stdout** -- no file-based logging, no unstructured text.
|
|
298
|
+
- [ ] **Trace context propagation** is configured -- auto-instrumentation annotation or SDK integration present.
|
|
299
|
+
- [ ] **Alerts are symptom-based** (error rate, latency) not cause-based (pod restarted, CPU high).
|
|
300
|
+
- [ ] **Every alert has a `runbook_url`** annotation -- alerts without runbooks are noise.
|
|
301
|
+
- [ ] **Histogram buckets** are aligned to SLO thresholds, not arbitrary defaults.
|
|
302
|
+
- [ ] **Resource requests and limits** are set on all sidecar containers (OTel Collector, Fluent Bit) to prevent them from starving the main workload.
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Privilege Sprawl
|
|
2
|
+
|
|
3
|
+
**Directive:** When generating RBAC resources, ServiceAccounts, or secret references, ALWAYS apply least-privilege principles. Default security posture is PSS "restricted" profile. Never grant permissions broader than the workload requires.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Consult this reference whenever the task involves:
|
|
8
|
+
- Creating or modifying Roles, ClusterRoles, RoleBindings, or ClusterRoleBindings
|
|
9
|
+
- Creating ServiceAccounts or referencing them in pod specs
|
|
10
|
+
- Mounting or referencing Kubernetes Secrets
|
|
11
|
+
- Designing access patterns for controllers, operators, or application workloads
|
|
12
|
+
|
|
13
|
+
## Symptoms of privilege sprawl
|
|
14
|
+
|
|
15
|
+
| Symptom | Risk |
|
|
16
|
+
|---|---|
|
|
17
|
+
| ClusterRoleBinding with `cluster-admin` attached to a workload SA | Full cluster takeover if pod is compromised |
|
|
18
|
+
| Rules containing `verbs: ["*"]` or `resources: ["*"]` | Unrestricted access far beyond what the workload needs |
|
|
19
|
+
| Pods running with the `default` ServiceAccount | Every pod in the namespace shares the same identity |
|
|
20
|
+
| `automountServiceAccountToken: true` (the default) on pods that never call the API | Leaked token exposes unnecessary attack surface |
|
|
21
|
+
| Secrets injected as environment variables | Visible in `kubectl describe pod`, process listings, crash dumps |
|
|
22
|
+
| Team assumes base64-encoded Secrets are encrypted | Secrets stored in plaintext in etcd unless encryption-at-rest is configured |
|
|
23
|
+
|
|
24
|
+
## Root causes
|
|
25
|
+
|
|
26
|
+
1. Copy-pasting cluster-admin bindings from quickstart guides.
|
|
27
|
+
2. Using wildcards to "get it working" and never scoping down.
|
|
28
|
+
3. Not creating dedicated ServiceAccounts per workload.
|
|
29
|
+
4. Misunderstanding that Kubernetes Secrets are base64-encoded, NOT encrypted.
|
|
30
|
+
5. Injecting secrets via `env:` instead of volume mounts or external operators.
|
|
31
|
+
|
|
32
|
+
## Prevention rules
|
|
33
|
+
|
|
34
|
+
### RBAC least privilege
|
|
35
|
+
|
|
36
|
+
- **Role** is namespace-scoped. **ClusterRole** is cluster-scoped. Prefer Role unless access truly spans namespaces.
|
|
37
|
+
- **RoleBinding** binds a Role (or ClusterRole) within a single namespace. **ClusterRoleBinding** grants access cluster-wide.
|
|
38
|
+
- Never bind `cluster-admin` to any workload ServiceAccount. Reserve it for break-glass human access only.
|
|
39
|
+
- List specific verbs: `get`, `list`, `watch`, `create`, `update`, `patch`, `delete`. Never use `"*"`.
|
|
40
|
+
- List specific resources: `pods`, `deployments`, `configmaps`, etc. Never use `"*"`.
|
|
41
|
+
- Always specify `apiGroups` explicitly. An empty string `""` means core API group, not "all groups."
|
|
42
|
+
|
|
43
|
+
### ServiceAccount hardening
|
|
44
|
+
|
|
45
|
+
- Create a dedicated ServiceAccount for every workload that needs API access.
|
|
46
|
+
- Set `automountServiceAccountToken: false` on the ServiceAccount AND the Pod spec for workloads that do not call the Kubernetes API.
|
|
47
|
+
- Use projected token volumes with audience and expiration for workloads that do need API access.
|
|
48
|
+
|
|
49
|
+
### Secret management
|
|
50
|
+
|
|
51
|
+
- Kubernetes Secrets are base64-encoded, NOT encrypted. Anyone with `get secrets` RBAC in the namespace can read them.
|
|
52
|
+
- Enable etcd encryption at rest via `EncryptionConfiguration` as a baseline.
|
|
53
|
+
- Prefer external secret management: `external-secrets-operator` syncing from AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault.
|
|
54
|
+
- `sealed-secrets` is an alternative: encrypt secrets client-side so they are safe to commit to git.
|
|
55
|
+
- Mount secrets as files (`volumeMounts`), not environment variables. File-mounted secrets can be rotated without pod restart and are not exposed in `kubectl describe`.
|
|
56
|
+
|
|
57
|
+
## Patterns and examples
|
|
58
|
+
|
|
59
|
+
### GOOD: Scoped RBAC + dedicated ServiceAccount + external secrets
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
apiVersion: v1
|
|
63
|
+
kind: ServiceAccount
|
|
64
|
+
metadata:
|
|
65
|
+
name: order-processor
|
|
66
|
+
namespace: orders
|
|
67
|
+
annotations:
|
|
68
|
+
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/order-processor
|
|
69
|
+
automountServiceAccountToken: false
|
|
70
|
+
---
|
|
71
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
72
|
+
kind: Role
|
|
73
|
+
metadata:
|
|
74
|
+
name: order-processor-role
|
|
75
|
+
namespace: orders
|
|
76
|
+
rules:
|
|
77
|
+
- apiGroups: [""]
|
|
78
|
+
resources: ["configmaps"]
|
|
79
|
+
verbs: ["get", "watch"]
|
|
80
|
+
resourceNames: ["order-config"]
|
|
81
|
+
- apiGroups: [""]
|
|
82
|
+
resources: ["events"]
|
|
83
|
+
verbs: ["create"]
|
|
84
|
+
---
|
|
85
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
86
|
+
kind: RoleBinding
|
|
87
|
+
metadata:
|
|
88
|
+
name: order-processor-binding
|
|
89
|
+
namespace: orders
|
|
90
|
+
roleRef:
|
|
91
|
+
apiGroup: rbac.authorization.k8s.io
|
|
92
|
+
kind: Role
|
|
93
|
+
name: order-processor-role
|
|
94
|
+
subjects:
|
|
95
|
+
- kind: ServiceAccount
|
|
96
|
+
name: order-processor
|
|
97
|
+
namespace: orders
|
|
98
|
+
---
|
|
99
|
+
apiVersion: external-secrets.io/v1beta1
|
|
100
|
+
kind: ExternalSecret
|
|
101
|
+
metadata:
|
|
102
|
+
name: order-db-creds
|
|
103
|
+
namespace: orders
|
|
104
|
+
spec:
|
|
105
|
+
refreshInterval: 1h
|
|
106
|
+
secretStoreRef:
|
|
107
|
+
name: aws-secrets-manager
|
|
108
|
+
kind: ClusterSecretStore
|
|
109
|
+
target:
|
|
110
|
+
name: order-db-creds
|
|
111
|
+
data:
|
|
112
|
+
- secretKey: password
|
|
113
|
+
remoteRef:
|
|
114
|
+
key: prod/orders/db-password
|
|
115
|
+
---
|
|
116
|
+
apiVersion: apps/v1
|
|
117
|
+
kind: Deployment
|
|
118
|
+
metadata:
|
|
119
|
+
name: order-processor
|
|
120
|
+
namespace: orders
|
|
121
|
+
spec:
|
|
122
|
+
replicas: 3
|
|
123
|
+
selector:
|
|
124
|
+
matchLabels:
|
|
125
|
+
app: order-processor
|
|
126
|
+
template:
|
|
127
|
+
metadata:
|
|
128
|
+
labels:
|
|
129
|
+
app: order-processor
|
|
130
|
+
spec:
|
|
131
|
+
serviceAccountName: order-processor
|
|
132
|
+
automountServiceAccountToken: false
|
|
133
|
+
securityContext:
|
|
134
|
+
runAsNonRoot: true
|
|
135
|
+
seccompProfile:
|
|
136
|
+
type: RuntimeDefault
|
|
137
|
+
containers:
|
|
138
|
+
- name: processor
|
|
139
|
+
image: registry.example.com/order-processor:v2.4.1
|
|
140
|
+
securityContext:
|
|
141
|
+
allowPrivilegeEscalation: false
|
|
142
|
+
capabilities:
|
|
143
|
+
drop: ["ALL"]
|
|
144
|
+
readOnlyRootFilesystem: true
|
|
145
|
+
volumeMounts:
|
|
146
|
+
- name: db-creds
|
|
147
|
+
mountPath: /etc/secrets/db
|
|
148
|
+
readOnly: true
|
|
149
|
+
volumes:
|
|
150
|
+
- name: db-creds
|
|
151
|
+
secret:
|
|
152
|
+
secretName: order-db-creds
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### BAD: cluster-admin binding + default SA + env var secrets
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
# DO NOT DO THIS
|
|
159
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
160
|
+
kind: ClusterRoleBinding
|
|
161
|
+
metadata:
|
|
162
|
+
name: order-processor-admin
|
|
163
|
+
roleRef:
|
|
164
|
+
apiGroup: rbac.authorization.k8s.io
|
|
165
|
+
kind: ClusterRole
|
|
166
|
+
name: cluster-admin # grants full cluster control to a workload
|
|
167
|
+
subjects:
|
|
168
|
+
- kind: ServiceAccount
|
|
169
|
+
name: default # shared by every pod in the namespace
|
|
170
|
+
namespace: orders
|
|
171
|
+
---
|
|
172
|
+
apiVersion: apps/v1
|
|
173
|
+
kind: Deployment
|
|
174
|
+
metadata:
|
|
175
|
+
name: order-processor
|
|
176
|
+
namespace: orders
|
|
177
|
+
spec:
|
|
178
|
+
replicas: 3
|
|
179
|
+
selector:
|
|
180
|
+
matchLabels:
|
|
181
|
+
app: order-processor
|
|
182
|
+
template:
|
|
183
|
+
metadata:
|
|
184
|
+
labels:
|
|
185
|
+
app: order-processor
|
|
186
|
+
spec:
|
|
187
|
+
# serviceAccountName omitted -- uses "default"
|
|
188
|
+
# automountServiceAccountToken defaults to true -- token exposed
|
|
189
|
+
containers:
|
|
190
|
+
- name: processor
|
|
191
|
+
image: registry.example.com/order-processor:latest
|
|
192
|
+
env:
|
|
193
|
+
- name: DB_PASSWORD # visible in describe, logs, crash dumps
|
|
194
|
+
value: "hunter2" # hardcoded plaintext password
|
|
195
|
+
- name: DB_PASSWORD_FROM_SECRET
|
|
196
|
+
valueFrom:
|
|
197
|
+
secretKeyRef:
|
|
198
|
+
name: db-creds
|
|
199
|
+
key: password # still exposed via env, not file mount
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Token projection for workloads that need API access
|
|
203
|
+
|
|
204
|
+
```yaml
|
|
205
|
+
apiVersion: v1
|
|
206
|
+
kind: Pod
|
|
207
|
+
metadata:
|
|
208
|
+
name: api-consumer
|
|
209
|
+
namespace: orders
|
|
210
|
+
spec:
|
|
211
|
+
serviceAccountName: order-processor
|
|
212
|
+
automountServiceAccountToken: false # disable the default mount
|
|
213
|
+
containers:
|
|
214
|
+
- name: app
|
|
215
|
+
image: registry.example.com/api-consumer:v1.0.0
|
|
216
|
+
volumeMounts:
|
|
217
|
+
- name: kube-api-token
|
|
218
|
+
mountPath: /var/run/secrets/tokens
|
|
219
|
+
readOnly: true
|
|
220
|
+
volumes:
|
|
221
|
+
- name: kube-api-token
|
|
222
|
+
projected:
|
|
223
|
+
sources:
|
|
224
|
+
- serviceAccountToken:
|
|
225
|
+
audience: "https://kubernetes.default.svc"
|
|
226
|
+
expirationSeconds: 3600
|
|
227
|
+
path: token
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## LLM mistake checklist
|
|
231
|
+
|
|
232
|
+
Before finalizing any RBAC or secret-related manifest, verify each item:
|
|
233
|
+
|
|
234
|
+
- [ ] No rule uses `verbs: ["*"]` -- every verb is listed explicitly
|
|
235
|
+
- [ ] No rule uses `resources: ["*"]` -- every resource is listed explicitly
|
|
236
|
+
- [ ] No rule uses `apiGroups: ["*"]` -- each API group is listed explicitly
|
|
237
|
+
- [ ] No ClusterRoleBinding references `cluster-admin` for a workload ServiceAccount
|
|
238
|
+
- [ ] A dedicated ServiceAccount is created (not relying on `default`)
|
|
239
|
+
- [ ] `automountServiceAccountToken: false` is set on pods that do not need API access
|
|
240
|
+
- [ ] Secrets are mounted as volumes, not injected as environment variables
|
|
241
|
+
- [ ] No hardcoded secret values appear in the manifest (use ExternalSecret, SealedSecret, or at minimum a Secret resource)
|
|
242
|
+
- [ ] `resourceNames` is used where possible to restrict access to specific named resources
|
|
243
|
+
- [ ] RoleBinding is preferred over ClusterRoleBinding unless cluster-wide scope is required
|
|
244
|
+
- [ ] Pod securityContext sets `runAsNonRoot: true`, drops all capabilities, enables seccomp
|
|
245
|
+
|
|
246
|
+
## Verification commands
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Check what a specific ServiceAccount can do
|
|
250
|
+
kubectl auth can-i --list --as=system:serviceaccount:orders:order-processor -n orders
|
|
251
|
+
|
|
252
|
+
# Check if a ServiceAccount can perform a specific action
|
|
253
|
+
kubectl auth can-i get secrets --as=system:serviceaccount:orders:order-processor -n orders
|
|
254
|
+
|
|
255
|
+
# Find all ClusterRoleBindings that reference cluster-admin
|
|
256
|
+
kubectl get clusterrolebindings -o json | \
|
|
257
|
+
jq -r '.items[] | select(.roleRef.name=="cluster-admin") | .metadata.name + " -> " + (.subjects[]? | .kind + "/" + .name)'
|
|
258
|
+
|
|
259
|
+
# Find RBAC rules with wildcard verbs or resources
|
|
260
|
+
kubectl get roles,clusterroles -A -o json | \
|
|
261
|
+
jq -r '.items[] | select(.rules[]? | .verbs[]? == "*" or .resources[]? == "*") | .metadata.namespace + "/" + .metadata.name'
|
|
262
|
+
|
|
263
|
+
# List all pods using the default ServiceAccount
|
|
264
|
+
kubectl get pods -A -o json | \
|
|
265
|
+
jq -r '.items[] | select(.spec.serviceAccountName == "default" or .spec.serviceAccountName == null) | .metadata.namespace + "/" + .metadata.name'
|
|
266
|
+
|
|
267
|
+
# Check if etcd encryption at rest is enabled (control plane access required)
|
|
268
|
+
kubectl get apiserver -o=jsonpath='{.items[0].spec.encryption}'
|
|
269
|
+
|
|
270
|
+
# Audit secrets exposed as environment variables
|
|
271
|
+
kubectl get pods -A -o json | \
|
|
272
|
+
jq -r '.items[] | .metadata.namespace + "/" + .metadata.name as $pod | .spec.containers[]?.env[]? | select(.valueFrom.secretKeyRef != null) | $pod + " env:" + .name'
|
|
273
|
+
```
|