@umacloud/knowledge 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/00-governance/governance-capabilities.md +557 -0
- package/00-governance/knowledge-map.md +39 -0
- package/00-governance/maintenance-policy.md +76 -0
- package/00-governance/review-checklist.md +81 -0
- package/README.md +13 -0
- package/ai/01-standards/agent-development-complete.md +691 -0
- package/ai/01-standards/llm-application-complete.md +488 -0
- package/ai/01-standards/mlops-complete.md +798 -0
- package/ai/01-standards/prompt-engineering-complete.md +646 -0
- package/ai/01-standards/rag-architecture-complete.md +649 -0
- package/ai/02-playbooks/llm-evaluation-playbook.md +847 -0
- package/ai/03-checklists/ai-project-checklist.md +215 -0
- package/ai/04-antipatterns/ai-antipatterns.md +661 -0
- package/ai/05-cases/case-rag-production.md +147 -0
- package/ai/06-glossary/ai-glossary.md +162 -0
- package/ai/agent-evaluation-benchmark.md +53 -0
- package/ai/ai-agent-memory-context-management.md +41 -0
- package/ai/ai-cost-capacity-optimization-playbook.md +42 -0
- package/ai/ai-data-security-and-compliance-playbook.md +37 -0
- package/ai/ai-domain-index-and-checklist.md +40 -0
- package/ai/ai-governance-maturity-model.md +50 -0
- package/ai/ai-model-selection-and-routing-strategy.md +47 -0
- package/ai/ai-observability-and-oncall-runbook.md +52 -0
- package/ai/ai-rag-engineering-playbook.md +42 -0
- package/ai/ai-red-team-and-safety-evaluation.md +42 -0
- package/ai/ai-release-readiness-and-rollback-gate.md +42 -0
- package/ai/llm-agent-engineering-deep-dive.md +57 -0
- package/ai/prompt-and-tool-guardrails.md +52 -0
- package/api/01-standards/enterprise-api-standards.md +198 -0
- package/api/01-standards/rest-api-design-guide.md +63 -0
- package/api/02-playbooks/api-pagination-playbook.md +93 -0
- package/api/02-playbooks/graphql-production-playbook.md +176 -0
- package/api/03-checklists/api-review-checklist.md +55 -0
- package/api/04-antipatterns/api-antipatterns.md +112 -0
- package/architecture/01-standards/api-gateway-patterns.md +496 -0
- package/architecture/01-standards/cloud-native-patterns.md +644 -0
- package/architecture/01-standards/distributed-systems-patterns.md +591 -0
- package/architecture/01-standards/event-driven-architecture.md +595 -0
- package/architecture/01-standards/microservices-patterns-complete.md +968 -0
- package/architecture/01-standards/microservices-patterns.md +495 -0
- package/architecture/01-standards/system-design-interview.md +664 -0
- package/architecture/02-playbooks/microservices-patterns-playbook.md +137 -0
- package/architecture/02-playbooks/migration-playbook.md +780 -0
- package/architecture/02-playbooks/system-design-playbook.md +779 -0
- package/architecture/03-checklists/architecture-decision-checklist.md +297 -0
- package/architecture/04-antipatterns/architecture-antipatterns.md +417 -0
- package/architecture/05-cases/case-netflix-microservices.md +413 -0
- package/architecture/06-glossary/architecture-glossary.md +164 -0
- package/architecture/adr-template-and-examples.md +38 -0
- package/architecture/api-gateway-deep-dive.md +1291 -0
- package/architecture/configuration-management.md +1162 -0
- package/architecture/distributed-transactions.md +1220 -0
- package/architecture/microservices-complete.md +735 -0
- package/architecture/resilience-and-disaster-patterns.md +37 -0
- package/architecture/service-governance.md +1198 -0
- package/architecture/system-architecture-deep-dive.md +37 -0
- package/backend/01-standards/analytics-and-growth.md +65 -0
- package/backend/01-standards/api-and-error-conventions.md +120 -0
- package/backend/01-standards/application-layering-and-packaging.md +160 -0
- package/backend/01-standards/auth-implementation.md +104 -0
- package/backend/01-standards/backend-framework-idioms.md +74 -0
- package/backend/01-standards/background-jobs-and-async.md +66 -0
- package/backend/01-standards/caching-strategies-complete.md +390 -0
- package/backend/01-standards/config-and-observability.md +77 -0
- package/backend/01-standards/data-modeling-and-persistence.md +94 -0
- package/backend/01-standards/django-complete.md +1765 -0
- package/backend/01-standards/email-and-notifications.md +64 -0
- package/backend/01-standards/fastapi-complete.md +925 -0
- package/backend/01-standards/file-upload-and-storage.md +66 -0
- package/backend/01-standards/graphql-api-complete.md +416 -0
- package/backend/01-standards/llm-application-standard.md +78 -0
- package/backend/01-standards/message-queue-patterns.md +379 -0
- package/backend/01-standards/microservices-and-distributed.md +78 -0
- package/backend/01-standards/nestjs-complete.md +2167 -0
- package/backend/01-standards/payment-integration.md +80 -0
- package/backend/01-standards/rate-limiting-complete.md +451 -0
- package/backend/01-standards/realtime-and-websocket.md +65 -0
- package/backend/01-standards/search-and-filtering.md +64 -0
- package/backend/01-standards/spring-boot-complete.md +445 -0
- package/backend/02-playbooks/api-design-playbook.md +718 -0
- package/backend/02-playbooks/email-send-playbook.md +130 -0
- package/backend/02-playbooks/file-upload-s3-playbook.md +153 -0
- package/backend/02-playbooks/typescript-enterprise-playbook.md +133 -0
- package/backend/02-playbooks/websocket-realtime-playbook.md +154 -0
- package/backend/03-checklists/api-launch-checklist.md +189 -0
- package/backend/04-antipatterns/backend-antipatterns.md +1051 -0
- package/blockchain/01-standards/blockchain-basics.md +557 -0
- package/blockchain/01-standards/smart-contract-development.md +1315 -0
- package/cicd/01-standards/deployment-and-delivery-standard.md +96 -0
- package/cicd/01-standards/github-actions-complete.md +473 -0
- package/cicd/01-standards/release-and-store-submission.md +75 -0
- package/cicd/02-playbooks/cicd-pipeline-playbook.md +144 -0
- package/cicd/02-playbooks/release-management-playbook.md +605 -0
- package/cicd/03-checklists/pipeline-security-checklist.md +168 -0
- package/cicd/04-antipatterns/cicd-antipatterns.md +589 -0
- package/cicd/05-cases/case-deployment-automation.md +221 -0
- package/cicd/05-cases/case-gitops-transformation.md +212 -0
- package/cicd/06-glossary/cicd-glossary.md +114 -0
- package/cicd/cicd-blueprint-deep-dive.md +38 -0
- package/cicd/release-readiness-gate.md +37 -0
- package/cloud-native/01-standards/container-security.md +741 -0
- package/cloud-native/01-standards/kubernetes-complete.md +812 -0
- package/cloud-native/02-playbooks/api-gateway-playbook.md +155 -0
- package/cloud-native/02-playbooks/gitops-with-argocd.md +760 -0
- package/cloud-native/02-playbooks/k8s-troubleshooting-playbook.md +1942 -0
- package/cloud-native/02-playbooks/message-queue-playbook.md +129 -0
- package/cloud-native/02-playbooks/multicloud-governance.md +726 -0
- package/cloud-native/02-playbooks/serverless-patterns.md +788 -0
- package/cloud-native/02-playbooks/service-mesh-playbook.md +612 -0
- package/cloud-native/02-playbooks/terraform-iac-playbook.md +143 -0
- package/cloud-native/03-checklists/container-security-checklist.md +431 -0
- package/cloud-native/03-checklists/k8s-production-readiness-checklist.md +460 -0
- package/cloud-native/04-antipatterns/container-antipatterns.md +660 -0
- package/cloud-native/04-antipatterns/k8s-antipatterns.md +743 -0
- package/cloud-native/05-cases/case-k8s-migration.md +478 -0
- package/cloud-native/05-cases/case-k8s-scaling.md +642 -0
- package/cloud-native/05-cases/case-k8s-security-incident.md +397 -0
- package/cloud-native/06-glossary/cloud-native-glossary.md +337 -0
- package/cross-platform/01-standards/cross-platform-frameworks.md +83 -0
- package/cross-platform/01-standards/platform-selection-and-architecture.md +77 -0
- package/data/01-standards/elasticsearch-complete.md +2098 -0
- package/data/01-standards/postgresql-complete.md +1613 -0
- package/data/01-standards/redis-complete.md +1527 -0
- package/data/02-playbooks/database-optimization-playbook.md +403 -0
- package/data/02-playbooks/elasticsearch-production-playbook.md +132 -0
- package/data/03-checklists/database-launch-checklist.md +187 -0
- package/data/04-antipatterns/database-antipatterns.md +873 -0
- package/data/05-cases/case-database-migration.md +310 -0
- package/data/06-glossary/database-glossary.md +440 -0
- package/data/data-governance-and-modeling-deep-dive.md +39 -0
- package/data-engineering/01-standards/airflow-complete.md +523 -0
- package/data-engineering/01-standards/kafka-complete.md +1521 -0
- package/data-engineering/02-playbooks/spark-etl-playbook.md +496 -0
- package/data-engineering/03-checklists/pipeline-launch-checklist.md +194 -0
- package/data-engineering/04-antipatterns/data-pipeline-antipatterns.md +684 -0
- package/data-engineering/05-cases/case-real-time-pipeline.md +355 -0
- package/data-engineering/06-glossary/data-engineering-glossary.md +429 -0
- package/database/01-standards/database-schema-standards.md +147 -0
- package/database/02-playbooks/postgresql-optimization-quick.md +52 -0
- package/database/02-playbooks/postgresql-performance-optimization.md +58 -0
- package/database/02-playbooks/postgresql-production-playbook.md +146 -0
- package/database/02-playbooks/redis-caching-playbook.md +117 -0
- package/database/03-checklists/database-review-checklist.md +50 -0
- package/database/04-antipatterns/database-antipatterns.md +112 -0
- package/design/01-standards/ui-design-system-complete.md +423 -0
- package/design/02-playbooks/design-handoff-playbook.md +254 -0
- package/design/02-playbooks/design-review-playbook.md +388 -0
- package/design/03-checklists/design-review-checklist.md +246 -0
- package/design/04-antipatterns/design-antipatterns.md +378 -0
- package/design/05-cases/case-design-system-adoption.md +328 -0
- package/design/06-glossary/design-glossary.md +329 -0
- package/design/ui-full-lifecycle-cross-platform-playbook.md +571 -0
- package/design/ux-system-deep-dive.md +38 -0
- package/design-systems/00-craft-rules.md +71 -0
- package/design-systems/aesthetic-families.md +43 -0
- package/design-systems/anti-ai-slop.md +162 -0
- package/design-systems/bold-geometric.md +120 -0
- package/design-systems/brutalist-bold.md +103 -0
- package/design-systems/editorial-clean.md +109 -0
- package/design-systems/glass-aurora.md +108 -0
- package/design-systems/modern-minimal.md +145 -0
- package/design-systems/premium-luxury.md +106 -0
- package/design-systems/product-type-design-map.md +48 -0
- package/design-systems/soft-warm.md +123 -0
- package/design-systems/tech-utility.md +113 -0
- package/desktop/01-standards/desktop-app-standard.md +72 -0
- package/desktop/01-standards/desktop-design.md +71 -0
- package/development/00-governance/document-template.md +41 -0
- package/development/01-standards/api-versioning-strategies.md +432 -0
- package/development/01-standards/authentication-patterns-complete.md +479 -0
- package/development/01-standards/css-architecture-complete.md +550 -0
- package/development/01-standards/database-migration-strategies.md +484 -0
- package/development/01-standards/elasticsearch-complete.md +347 -0
- package/development/01-standards/git-complete.md +371 -0
- package/development/01-standards/golang-complete.md +1565 -0
- package/development/01-standards/graphql-complete.md +298 -0
- package/development/01-standards/javascript-bundlers-complete.md +469 -0
- package/development/01-standards/javascript-typescript-complete.md +528 -0
- package/development/01-standards/jest-complete.md +275 -0
- package/development/01-standards/linux-complete.md +234 -0
- package/development/01-standards/logging-observability-complete.md +526 -0
- package/development/01-standards/microservices-communication.md +502 -0
- package/development/01-standards/mongodb-complete.md +406 -0
- package/development/01-standards/oauth2-complete.md +285 -0
- package/development/01-standards/performance-optimization-complete.md +289 -0
- package/development/01-standards/playwright-complete.md +247 -0
- package/development/01-standards/postgresql-complete.md +456 -0
- package/development/01-standards/pytest-complete.md +340 -0
- package/development/01-standards/python-async-programming.md +902 -0
- package/development/01-standards/python-complete.md +956 -0
- package/development/01-standards/python-decorators-complete.md +799 -0
- package/development/01-standards/python-design-patterns.md +2854 -0
- package/development/01-standards/python-packaging-distribution.md +420 -0
- package/development/01-standards/python-testing-strategies.md +607 -0
- package/development/01-standards/python-web-frameworks-comparison.md +471 -0
- package/development/01-standards/redis-complete.md +317 -0
- package/development/01-standards/rest-api-complete.md +316 -0
- package/development/01-standards/rust-complete.md +578 -0
- package/development/01-standards/typescript-advanced-types.md +1513 -0
- package/development/01-standards/web-security-complete.md +292 -0
- package/development/02-playbooks/api-design-playbook.md +810 -0
- package/development/02-playbooks/database-migration-playbook.md +580 -0
- package/development/02-playbooks/debugging-playbook.md +692 -0
- package/development/02-playbooks/feature-delivery-playbook.md +430 -0
- package/development/02-playbooks/incident-hotfix-playbook.md +387 -0
- package/development/02-playbooks/performance-optimization-playbook.md +531 -0
- package/development/02-playbooks/performance-tuning-playbook.md +652 -0
- package/development/02-playbooks/refactor-playbook.md +403 -0
- package/development/02-playbooks/release-playbook.md +469 -0
- package/development/03-checklists/architecture-review-checklist.md +168 -0
- package/development/03-checklists/data-migration-checklist.md +157 -0
- package/development/03-checklists/oncall-handover-checklist.md +173 -0
- package/development/03-checklists/pr-checklist.md +158 -0
- package/development/03-checklists/production-readiness-checklist.md +190 -0
- package/development/03-checklists/release-readiness-checklist.md +154 -0
- package/development/03-checklists/security-review-checklist.md +182 -0
- package/development/04-antipatterns/api-antipatterns.md +657 -0
- package/development/04-antipatterns/architecture-antipatterns.md +686 -0
- package/development/04-antipatterns/backend-antipatterns.md +648 -0
- package/development/04-antipatterns/cicd-antipatterns.md +540 -0
- package/development/04-antipatterns/code-smell-antipatterns.md +571 -0
- package/development/04-antipatterns/data-antipatterns.md +658 -0
- package/development/04-antipatterns/database-antipatterns.md +578 -0
- package/development/04-antipatterns/frontend-antipatterns.md +635 -0
- package/development/04-antipatterns/reliability-antipatterns.md +700 -0
- package/development/04-antipatterns/security-antipatterns.md +747 -0
- package/development/05-cases/case-api-version-migration.md +428 -0
- package/development/05-cases/case-authorization-hardening.md +383 -0
- package/development/05-cases/case-bluegreen-rollback.md +466 -0
- package/development/05-cases/case-cache-snowball-protection.md +485 -0
- package/development/05-cases/case-ci-cd-pipeline.md +544 -0
- package/development/05-cases/case-database-scaling.md +500 -0
- package/development/05-cases/case-db-hotspot-optimization.md +487 -0
- package/development/05-cases/case-incident-mttr-reduction.md +563 -0
- package/development/05-cases/case-microservice-migration.md +375 -0
- package/development/05-cases/case-performance-optimization.md +406 -0
- package/development/05-cases/case-security-incident-response.md +345 -0
- package/development/06-glossary/full-stack-glossary.md +166 -0
- package/development/09-maturity/quarterly-audit-template.md +35 -0
- package/development/11-ui-excellence/ui-aesthetic-system.md +41 -0
- package/development/11-ui-excellence/ui-engineering-excellence.md +435 -0
- package/development/12-scenarios/development-scenarios-guide.md +565 -0
- package/development/13-implementation-assets/implementation-toolkit.md +282 -0
- package/development/13-implementation-assets/knowledge-gates-execution.md +43 -0
- package/development/14-full-lifecycle/software-lifecycle-gates.md +511 -0
- package/development/15-lifecycle-templates/project-templates-collection.md +791 -0
- package/development/api-contract-and-versioning-guide.md +36 -0
- package/development/api-governance-complete.md +43 -0
- package/development/backend-engineering-complete.md +43 -0
- package/development/code-review-quality-complete.md +43 -0
- package/development/concurrency-reliability-complete.md +43 -0
- package/development/database-engineering-complete.md +43 -0
- package/development/engineering-effectiveness-complete.md +43 -0
- package/development/engineering-standards-deep-dive.md +38 -0
- package/development/frontend-engineering-complete.md +43 -0
- package/development/performance-capacity-complete.md +43 -0
- package/development/refactor-migration-complete.md +42 -0
- package/development/refactoring-and-techdebt-playbook.md +37 -0
- package/development/security-in-development-complete.md +43 -0
- package/devops/01-standards/cicd-pipeline-complete.md +262 -0
- package/devops/01-standards/docker-complete.md +1490 -0
- package/devops/01-standards/github-actions-complete.md +337 -0
- package/devops/01-standards/kubernetes-complete.md +638 -0
- package/devops/01-standards/terraform-complete.md +2117 -0
- package/devops/02-playbooks/docker-compose-playbook.md +233 -0
- package/devops/02-playbooks/docker-k8s-production-playbook.md +186 -0
- package/devops/02-playbooks/docker-production-playbook.md +952 -0
- package/edge-iot/01-standards/edge-iot-complete.md +473 -0
- package/experts/architect/api-design.md +178 -0
- package/experts/architect/methodology.md +124 -0
- package/experts/architect/security.md +75 -0
- package/experts/backend-lead/methodology.md +216 -0
- package/experts/devops/methodology.md +160 -0
- package/experts/frontend-lead/methodology.md +178 -0
- package/experts/product-manager/industry/ecommerce.md +43 -0
- package/experts/product-manager/industry/saas.md +40 -0
- package/experts/product-manager/methodology.md +97 -0
- package/experts/qa-lead/methodology.md +123 -0
- package/experts/qa-lead/test-strategy.md +128 -0
- package/experts/uiux-designer/methodology.md +125 -0
- package/frontend/01-standards/accessibility-complete.md +532 -0
- package/frontend/01-standards/accessibility-standard.md +74 -0
- package/frontend/01-standards/admin-dashboard-and-crud.md +72 -0
- package/frontend/01-standards/design-tokens-complete.md +444 -0
- package/frontend/01-standards/forms-and-validation.md +77 -0
- package/frontend/01-standards/frontend-architecture-and-layering.md +119 -0
- package/frontend/01-standards/i18n-and-localization.md +65 -0
- package/frontend/01-standards/nextjs-complete.md +451 -0
- package/frontend/01-standards/react-complete.md +713 -0
- package/frontend/01-standards/react-hooks-complete-guide.md +1100 -0
- package/frontend/01-standards/react-hooks-complete.md +1171 -0
- package/frontend/01-standards/seo-and-web-vitals.md +77 -0
- package/frontend/01-standards/state-management-complete.md +444 -0
- package/frontend/01-standards/vue-complete.md +499 -0
- package/frontend/01-standards/vue3-complete.md +2002 -0
- package/frontend/01-standards/web-framework-best-practices.md +64 -0
- package/frontend/01-standards/web-performance-complete.md +495 -0
- package/frontend/02-playbooks/accessibility-a11y-playbook.md +161 -0
- package/frontend/02-playbooks/frontend-performance-playbook.md +707 -0
- package/frontend/02-playbooks/i18n-internationalization-playbook.md +120 -0
- package/frontend/02-playbooks/performance-optimization-playbook.md +163 -0
- package/frontend/02-playbooks/react-nextjs-production-playbook.md +167 -0
- package/frontend/02-playbooks/react-state-management-playbook.md +173 -0
- package/frontend/03-checklists/component-quality-checklist.md +166 -0
- package/frontend/03-checklists/frontend-launch-checklist.md +299 -0
- package/frontend/04-antipatterns/frontend-antipatterns.md +886 -0
- package/frontend/05-cases/case-performance-optimization.md +274 -0
- package/harmony/01-standards/harmonyos-arkts-standard.md +75 -0
- package/harmony/01-standards/harmonyos-design.md +65 -0
- package/high-quality-engineering-playbook.md +54 -0
- package/incident/01-standards/incident-response-complete.md +303 -0
- package/incident/02-playbooks/chaos-engineering-playbook.md +883 -0
- package/incident/02-playbooks/postmortem-playbook.md +398 -0
- package/incident/03-checklists/incident-readiness-checklist.md +181 -0
- package/incident/04-antipatterns/incident-antipatterns.md +490 -0
- package/incident/05-cases/case-cascade-failure.md +176 -0
- package/incident/06-glossary/incident-glossary.md +114 -0
- package/incident/postmortem-and-response-deep-dive.md +39 -0
- package/industries/ecommerce/ecommerce-complete.md +631 -0
- package/industries/education/education-complete.md +555 -0
- package/industries/fintech/fintech-complete.md +501 -0
- package/industries/gaming/gaming-complete.md +587 -0
- package/industries/healthcare/healthcare-complete.md +452 -0
- package/low-code/01-standards/low-code-complete.md +944 -0
- package/miniprogram/01-standards/ai-common-mistakes.md +61 -0
- package/miniprogram/01-standards/miniprogram-custom-navbar-capsule.md +77 -0
- package/miniprogram/01-standards/miniprogram-design.md +61 -0
- package/miniprogram/01-standards/miniprogram-standard.md +81 -0
- package/mobile/01-standards/android-material-design.md +70 -0
- package/mobile/01-standards/flutter-complete.md +384 -0
- package/mobile/01-standards/ios-design-hig.md +78 -0
- package/mobile/01-standards/mobile-app-standard.md +85 -0
- package/mobile/01-standards/react-native-complete.md +352 -0
- package/mobile/02-playbooks/mobile-cross-platform-playbook.md +175 -0
- package/mobile/02-playbooks/mobile-performance.md +473 -0
- package/mobile/03-checklists/mobile-release-checklist.md +234 -0
- package/mobile/04-antipatterns/mobile-antipatterns.md +798 -0
- package/mobile/05-cases/case-app-performance.md +500 -0
- package/mobile/05-cases/case-app-startup-optimization.md +218 -0
- package/mobile/06-glossary/mobile-glossary.md +484 -0
- package/observability/01-standards/observability-standards.md +103 -0
- package/observability/02-playbooks/prometheus-grafana-playbook.md +135 -0
- package/observability/02-playbooks/structured-logging-playbook.md +73 -0
- package/observability/03-checklists/observability-checklist.md +54 -0
- package/observability/04-antipatterns/observability-antipatterns.md +106 -0
- package/operations/01-standards/prometheus-monitoring-complete.md +1578 -0
- package/operations/02-playbooks/capacity-planning-playbook.md +620 -0
- package/operations/03-checklists/production-launch-checklist.md +365 -0
- package/operations/04-antipatterns/operations-antipatterns.md +664 -0
- package/operations/05-cases/case-sre-practices.md +581 -0
- package/operations/06-glossary/operations-glossary.md +120 -0
- package/operations/aiops-anomaly-detection.md +758 -0
- package/operations/capacity-planning.md +1061 -0
- package/operations/chaos-engineering.md +659 -0
- package/operations/incident-command-system.md +38 -0
- package/operations/observability-complete.md +442 -0
- package/operations/slo-sli-playbook.md +517 -0
- package/operations/sre-operations-deep-dive.md +39 -0
- package/package.json +8 -0
- package/performance/01-standards/performance-and-scalability.md +80 -0
- package/performance/01-standards/performance-standards.md +156 -0
- package/performance/02-playbooks/query-optimization-playbook.md +103 -0
- package/performance/03-checklists/performance-checklist.md +56 -0
- package/performance/04-antipatterns/performance-antipatterns.md +146 -0
- package/product/01-standards/product-management-complete.md +285 -0
- package/product/02-playbooks/feature-launch-playbook.md +207 -0
- package/product/02-playbooks/user-research-playbook.md +532 -0
- package/product/03-checklists/feature-launch-checklist.md +275 -0
- package/product/04-antipatterns/product-antipatterns.md +355 -0
- package/product/05-cases/case-mvp-to-scale.md +384 -0
- package/product/06-glossary/product-glossary.md +462 -0
- package/product/feature-prioritization-framework.md +40 -0
- package/product/kpi-and-metric-tree.md +37 -0
- package/product/product-discovery-and-prd-deep-dive.md +41 -0
- package/quantum/01-standards/quantum-complete.md +1186 -0
- package/security/01-standards/api-security-complete.md +511 -0
- package/security/01-standards/container-runtime-security.md +574 -0
- package/security/01-standards/data-protection-gdpr.md +543 -0
- package/security/01-standards/owasp-top10-complete.md +1890 -0
- package/security/01-standards/secure-coding-baseline.md +90 -0
- package/security/01-standards/supply-chain-security.md +441 -0
- package/security/01-standards/web-security-checklist.md +108 -0
- package/security/01-standards/zero-trust-architecture.md +521 -0
- package/security/02-playbooks/auth-sso-playbook.md +166 -0
- package/security/02-playbooks/incident-response-security-playbook.md +588 -0
- package/security/02-playbooks/owasp-api-security-playbook.md +129 -0
- package/security/02-playbooks/payment-integration-playbook.md +119 -0
- package/security/02-playbooks/penetration-testing-playbook.md +517 -0
- package/security/03-checklists/security-audit-checklist.md +356 -0
- package/security/04-antipatterns/security-coding-antipatterns.md +580 -0
- package/security/05-cases/case-log4shell-incident.md +537 -0
- package/security/05-cases/case-major-breaches.md +468 -0
- package/security/06-glossary/security-glossary.md +212 -0
- package/security/compliance-automation.md +993 -0
- package/security/container-security.md +680 -0
- package/security/devsecops-complete.md +426 -0
- package/security/sast-dast-sca.md +775 -0
- package/security/secrets-management.md +594 -0
- package/security/security-architecture-deep-dive.md +37 -0
- package/security/threat-modeling-stride-playbook.md +40 -0
- package/seed-templates/auth-system.md +59 -0
- package/seed-templates/blog-content.md +94 -0
- package/seed-templates/dashboard.md +89 -0
- package/seed-templates/docs-site.md +73 -0
- package/seed-templates/e-commerce.md +50 -0
- package/seed-templates/saas-landing.md +92 -0
- package/seed-templates/settings-page.md +51 -0
- package/testing/01-standards/test-strategy-and-layering.md +83 -0
- package/testing/01-standards/testing-strategy-complete.md +422 -0
- package/testing/01-standards/unit-testing-best-practices.md +118 -0
- package/testing/02-playbooks/e2e-testing-playbook.md +988 -0
- package/testing/02-playbooks/testing-strategy-playbook.md +126 -0
- package/testing/03-checklists/test-strategy-checklist.md +208 -0
- package/testing/04-antipatterns/testing-antipatterns.md +718 -0
- package/testing/05-cases/case-testing-transformation.md +300 -0
- package/testing/06-glossary/testing-glossary.md +110 -0
- package/testing/risk-based-test-matrix.md +36 -0
- package/testing/testing-strategy-deep-dive.md +37 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 安全事件响应作战手册
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
last_updated: 2026-03-28
|
|
5
|
+
owner: security-team
|
|
6
|
+
tags: [incident-response, forensics, SIEM, containment, recovery, post-mortem]
|
|
7
|
+
status: production
|
|
8
|
+
domain: security
|
|
9
|
+
difficulty: intermediate
|
|
10
|
+
quality_score: 70
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# 开发:Excellent(11964948@qq.com)
|
|
14
|
+
# 功能:安全事件响应全流程作战手册
|
|
15
|
+
# 作用:指导安全团队完成安全事件的检测、遏制、取证、修复、通报与复盘
|
|
16
|
+
# 创建时间:2026-03-28
|
|
17
|
+
# 最后修改:2026-03-28
|
|
18
|
+
|
|
19
|
+
## 目标
|
|
20
|
+
|
|
21
|
+
建立安全事件响应标准化流程,确保:
|
|
22
|
+
- 安全事件从发现到遏制控制在 30 分钟以内(P0 级别)
|
|
23
|
+
- 取证证据链完整、合法、可用于后续法律程序
|
|
24
|
+
- 根因溯源准确率 > 90%
|
|
25
|
+
- 复盘产出可落地改进项并跟踪闭环
|
|
26
|
+
- 通报流程符合等保/GDPR/网络安全法要求
|
|
27
|
+
|
|
28
|
+
## 适用场景
|
|
29
|
+
|
|
30
|
+
- 数据泄露事件(用户数据/商业机密/源代码外泄)
|
|
31
|
+
- 入侵事件(服务器被控/Web Shell/后门植入)
|
|
32
|
+
- 勒索攻击(文件加密/数据库锁定/DDoS 勒索)
|
|
33
|
+
- 内部威胁(员工违规操作/数据拷贝/账号滥用)
|
|
34
|
+
- 供应链攻击(依赖库投毒/CI-CD 管道污染)
|
|
35
|
+
- 钓鱼攻击(邮件钓鱼/社工攻击/凭据窃取)
|
|
36
|
+
|
|
37
|
+
## 前置条件
|
|
38
|
+
|
|
39
|
+
### 环境与工具
|
|
40
|
+
|
|
41
|
+
| 项目 | 要求 |
|
|
42
|
+
|------|------|
|
|
43
|
+
| SIEM 平台 | ELK Stack / Splunk / Wazuh 已部署并接收日志 |
|
|
44
|
+
| 取证工具 | Volatility 3 / Autopsy / The Sleuth Kit 已安装 |
|
|
45
|
+
| 网络抓包 | tcpdump / Wireshark / Zeek 可用 |
|
|
46
|
+
| 备份系统 | 最近备份可在 30 分钟内恢复 |
|
|
47
|
+
| 通信渠道 | 安全事件专用 Slack Channel / 企业微信群已建立 |
|
|
48
|
+
| 联系清单 | 安全负责人/法务/公关/管理层联系方式已更新 |
|
|
49
|
+
|
|
50
|
+
### 预案就绪检查
|
|
51
|
+
|
|
52
|
+
- [ ] 安全事件分级标准已定义并在团队内培训
|
|
53
|
+
- [ ] 值班表已排好(7x24 覆盖)
|
|
54
|
+
- [ ] 取证用隔离网段已准备
|
|
55
|
+
- [ ] 日志保留策略 >= 180 天
|
|
56
|
+
- [ ] 应急响应演练 >= 每季度 1 次
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 一、事件检测与分类
|
|
61
|
+
|
|
62
|
+
### 1.1 检测来源
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
自动检测:
|
|
66
|
+
SIEM 告警: 异常登录/暴力破解/大量数据外传
|
|
67
|
+
WAF 告警: SQL 注入/XSS/路径遍历/CC 攻击
|
|
68
|
+
EDR 告警: 恶意进程/可疑文件写入/提权行为
|
|
69
|
+
IDS/IPS: 已知攻击特征匹配
|
|
70
|
+
HIDS: 文件完整性变更/异常 crontab
|
|
71
|
+
|
|
72
|
+
人工发现:
|
|
73
|
+
用户报告: 账号异常/收到钓鱼邮件
|
|
74
|
+
开发人员: 发现可疑代码提交/依赖异常
|
|
75
|
+
第三方通报: 安全研究员/合作方/监管机构
|
|
76
|
+
暗网监控: 发现泄露数据/售卖信息
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 1.2 事件分级
|
|
80
|
+
|
|
81
|
+
| 级别 | 定义 | SLA | 通报范围 |
|
|
82
|
+
|------|------|-----|---------|
|
|
83
|
+
| P0 - 严重 | 数据大规模泄露/核心系统被控/勒索攻击 | 30 分钟响应 | CEO + CTO + 法务 + 公关 |
|
|
84
|
+
| P1 - 高危 | 单系统入侵/小范围数据泄露/供应链攻击 | 1 小时响应 | CTO + 安全负责人 + 运维负责人 |
|
|
85
|
+
| P2 - 中危 | 钓鱼攻击成功/异常访问行为/弱口令利用 | 4 小时响应 | 安全负责人 + 相关系统负责人 |
|
|
86
|
+
| P3 - 低危 | 扫描探测/已阻断攻击/误操作 | 24 小时响应 | 安全团队内部 |
|
|
87
|
+
|
|
88
|
+
### 1.3 初步确认
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# 确认告警是否为真实事件(排除误报)
|
|
92
|
+
# 1. 检查 SIEM 原始日志
|
|
93
|
+
# Elasticsearch 查询示例
|
|
94
|
+
curl -s "http://elk:9200/security-*/_search" -H 'Content-Type: application/json' -d '{
|
|
95
|
+
"query": {
|
|
96
|
+
"bool": {
|
|
97
|
+
"must": [
|
|
98
|
+
{ "match": { "source.ip": "攻击IP" } },
|
|
99
|
+
{ "range": { "@timestamp": { "gte": "now-1h" } } }
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"sort": [{ "@timestamp": "desc" }],
|
|
104
|
+
"size": 50
|
|
105
|
+
}'
|
|
106
|
+
|
|
107
|
+
# 2. 关联多个数据源交叉验证
|
|
108
|
+
# - WAF 日志是否有同源 IP 攻击记录
|
|
109
|
+
# - 系统日志是否有异常登录
|
|
110
|
+
# - 网络流量是否有异常外传
|
|
111
|
+
|
|
112
|
+
# 3. 确认影响范围
|
|
113
|
+
# - 受影响系统列表
|
|
114
|
+
# - 受影响用户/数据量估算
|
|
115
|
+
# - 攻击是否仍在进行
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 二、遏制阶段
|
|
121
|
+
|
|
122
|
+
### 2.1 短期遏制(止血)
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# 网络层隔离
|
|
126
|
+
# 1. 防火墙封禁攻击 IP
|
|
127
|
+
iptables -I INPUT -s <attacker-ip> -j DROP
|
|
128
|
+
# 或云 WAF / 安全组规则
|
|
129
|
+
aws ec2 revoke-security-group-ingress --group-id sg-xxx --protocol tcp --port 0-65535 --cidr <attacker-ip>/32
|
|
130
|
+
|
|
131
|
+
# 2. 隔离受感染主机(不要关机,保留内存取证)
|
|
132
|
+
# 网络隔离但保持运行
|
|
133
|
+
iptables -I OUTPUT -j DROP
|
|
134
|
+
iptables -I INPUT -j DROP
|
|
135
|
+
# 仅允许取证跳板机访问
|
|
136
|
+
iptables -I INPUT -s <forensic-jumpbox-ip> -j ACCEPT
|
|
137
|
+
|
|
138
|
+
# 3. 禁用被入侵账号
|
|
139
|
+
# Linux
|
|
140
|
+
passwd -l compromised_user
|
|
141
|
+
# 应用层
|
|
142
|
+
curl -X POST https://admin-api/users/compromised_user/disable -H "Authorization: Bearer $ADMIN_TOKEN"
|
|
143
|
+
|
|
144
|
+
# 4. 撤销泄露的凭据
|
|
145
|
+
# API Key / Token / 数据库密码
|
|
146
|
+
# 在密钥管理系统中轮换 (Vault / AWS Secrets Manager)
|
|
147
|
+
vault write secret/db/password value=$(openssl rand -base64 32)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 2.2 长期遏制
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 1. 部署增强监控
|
|
154
|
+
# 受影响系统提升日志级别
|
|
155
|
+
# 关键进程添加 audit 规则
|
|
156
|
+
auditctl -w /etc/passwd -p wa -k passwd_changes
|
|
157
|
+
auditctl -w /etc/shadow -p wa -k shadow_changes
|
|
158
|
+
auditctl -w /var/www/ -p wa -k webroot_changes
|
|
159
|
+
|
|
160
|
+
# 2. 清除攻击者持久化机制
|
|
161
|
+
# 检查 crontab
|
|
162
|
+
crontab -l -u root
|
|
163
|
+
crontab -l -u www-data
|
|
164
|
+
# 检查开机启动
|
|
165
|
+
systemctl list-unit-files --state=enabled
|
|
166
|
+
# 检查 SSH authorized_keys
|
|
167
|
+
find / -name authorized_keys -exec cat {} \; 2>/dev/null
|
|
168
|
+
# 检查异常进程
|
|
169
|
+
ps auxf | grep -v '\[' | sort -k3 -rn | head -20
|
|
170
|
+
|
|
171
|
+
# 3. 修补漏洞入口
|
|
172
|
+
# 更新受影响组件
|
|
173
|
+
apt update && apt upgrade -y <package>
|
|
174
|
+
# 应用安全补丁
|
|
175
|
+
# 临时 WAF 规则加固
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 三、取证阶段
|
|
181
|
+
|
|
182
|
+
### 3.1 证据采集原则
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
证据链要求:
|
|
186
|
+
- 采集前先计算哈希(MD5 + SHA256)
|
|
187
|
+
- 使用只读方式挂载磁盘镜像
|
|
188
|
+
- 所有操作记录时间戳和操作人
|
|
189
|
+
- 证据存储在专用加密存储中
|
|
190
|
+
- 证据交接需签署交接记录
|
|
191
|
+
|
|
192
|
+
采集优先级:
|
|
193
|
+
1. 易失性数据(内存/网络连接/进程列表)
|
|
194
|
+
2. 系统日志(auth.log/syslog/audit.log)
|
|
195
|
+
3. 应用日志(access.log/error.log/应用日志)
|
|
196
|
+
4. 磁盘镜像(完整 bit-for-bit 拷贝)
|
|
197
|
+
5. 网络流量包(PCAP)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 3.2 易失性数据采集
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# 内存转储
|
|
204
|
+
# Linux - 使用 LiME
|
|
205
|
+
insmod lime-$(uname -r).ko "path=/evidence/memory.lime format=lime"
|
|
206
|
+
|
|
207
|
+
# 当前进程快照
|
|
208
|
+
ps auxf > /evidence/processes.txt
|
|
209
|
+
lsof -i > /evidence/open-connections.txt
|
|
210
|
+
netstat -antup > /evidence/network-connections.txt
|
|
211
|
+
ss -tlnp > /evidence/listening-sockets.txt
|
|
212
|
+
|
|
213
|
+
# 登录会话
|
|
214
|
+
w > /evidence/active-sessions.txt
|
|
215
|
+
last -50 > /evidence/recent-logins.txt
|
|
216
|
+
lastb -50 > /evidence/failed-logins.txt
|
|
217
|
+
|
|
218
|
+
# 网络连接详情
|
|
219
|
+
cat /proc/net/tcp > /evidence/proc-net-tcp.txt
|
|
220
|
+
|
|
221
|
+
# 计算采集文件哈希
|
|
222
|
+
sha256sum /evidence/* > /evidence/hash-manifest.txt
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 3.3 日志采集与分析
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# 系统日志收集
|
|
229
|
+
cp /var/log/auth.log /evidence/logs/
|
|
230
|
+
cp /var/log/syslog /evidence/logs/
|
|
231
|
+
cp /var/log/audit/audit.log /evidence/logs/
|
|
232
|
+
cp /var/log/kern.log /evidence/logs/
|
|
233
|
+
|
|
234
|
+
# Web 日志收集
|
|
235
|
+
cp /var/log/nginx/access.log /evidence/logs/
|
|
236
|
+
cp /var/log/nginx/error.log /evidence/logs/
|
|
237
|
+
# 或 Apache
|
|
238
|
+
cp /var/log/apache2/access.log /evidence/logs/
|
|
239
|
+
|
|
240
|
+
# 应用日志
|
|
241
|
+
cp /var/log/app/*.log /evidence/logs/
|
|
242
|
+
|
|
243
|
+
# 日志时间线分析
|
|
244
|
+
# 提取攻击时间窗口内的认证日志
|
|
245
|
+
awk '/Mar 2[0-5]/' /evidence/logs/auth.log | grep -i "failed\|accepted\|invalid"
|
|
246
|
+
|
|
247
|
+
# 提取可疑 IP 的所有访问记录
|
|
248
|
+
grep "<attacker-ip>" /evidence/logs/access.log | awk '{print $1, $4, $7, $9}' | sort
|
|
249
|
+
|
|
250
|
+
# 检查文件修改时间线
|
|
251
|
+
find / -newer /tmp/ref-timestamp -not -path '/proc/*' -not -path '/sys/*' -ls 2>/dev/null \
|
|
252
|
+
> /evidence/modified-files.txt
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### 3.4 磁盘取证
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# 创建磁盘镜像(bit-for-bit)
|
|
259
|
+
dd if=/dev/sda of=/evidence/disk-image.dd bs=4M status=progress
|
|
260
|
+
sha256sum /evidence/disk-image.dd > /evidence/disk-image.dd.sha256
|
|
261
|
+
|
|
262
|
+
# 使用 Autopsy / Sleuth Kit 分析
|
|
263
|
+
# 1. 挂载为只读
|
|
264
|
+
mount -o ro,loop /evidence/disk-image.dd /mnt/evidence
|
|
265
|
+
|
|
266
|
+
# 2. 时间线分析
|
|
267
|
+
fls -r -m "/" /evidence/disk-image.dd > /evidence/bodyfile.txt
|
|
268
|
+
mactime -b /evidence/bodyfile.txt -d > /evidence/timeline.csv
|
|
269
|
+
|
|
270
|
+
# 3. 恢复已删除文件
|
|
271
|
+
foremost -i /evidence/disk-image.dd -o /evidence/recovered-files/
|
|
272
|
+
|
|
273
|
+
# 内存分析(Volatility 3)
|
|
274
|
+
vol -f /evidence/memory.lime linux.pslist
|
|
275
|
+
vol -f /evidence/memory.lime linux.bash
|
|
276
|
+
vol -f /evidence/memory.lime linux.netscan
|
|
277
|
+
vol -f /evidence/memory.lime linux.malfind
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 四、溯源阶段
|
|
283
|
+
|
|
284
|
+
### 4.1 攻击路径还原
|
|
285
|
+
|
|
286
|
+
```yaml
|
|
287
|
+
溯源分析框架:
|
|
288
|
+
入口确认:
|
|
289
|
+
- Web 漏洞利用(日志中的攻击 payload)
|
|
290
|
+
- 钓鱼邮件(邮件头分析/附件沙箱分析)
|
|
291
|
+
- 暴力破解(auth.log 中的失败记录)
|
|
292
|
+
- 供应链(package-lock.json / requirements.txt 变更)
|
|
293
|
+
- 0-day(无已知 CVE 匹配时需提交样本分析)
|
|
294
|
+
|
|
295
|
+
横向移动:
|
|
296
|
+
- SSH 跳板(authorized_keys 变更记录)
|
|
297
|
+
- 内网扫描(同网段异常连接)
|
|
298
|
+
- Pass-the-Hash(Windows 事件日志 4624 Type 3)
|
|
299
|
+
- 服务间调用(微服务 Token 复用/越权)
|
|
300
|
+
|
|
301
|
+
持久化:
|
|
302
|
+
- Crontab / Systemd Service
|
|
303
|
+
- Web Shell
|
|
304
|
+
- SSH 后门
|
|
305
|
+
- 修改 PAM 模块
|
|
306
|
+
- 内核 rootkit
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### 4.2 攻击者画像
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# IP 情报查询
|
|
313
|
+
# 使用威胁情报平台(VirusTotal / AlienVault OTX / AbuseIPDB)
|
|
314
|
+
curl -s "https://www.virustotal.com/api/v3/ip_addresses/<attacker-ip>" \
|
|
315
|
+
-H "x-apikey: $VT_API_KEY" | jq '.data.attributes.last_analysis_stats'
|
|
316
|
+
|
|
317
|
+
# 恶意样本分析
|
|
318
|
+
sha256sum /evidence/malware-sample
|
|
319
|
+
# 上传至沙箱分析
|
|
320
|
+
curl -s --request POST \
|
|
321
|
+
--url "https://www.virustotal.com/api/v3/files" \
|
|
322
|
+
--header "x-apikey: $VT_API_KEY" \
|
|
323
|
+
--form file=@/evidence/malware-sample
|
|
324
|
+
|
|
325
|
+
# WHOIS 与历史记录
|
|
326
|
+
whois <attacker-ip>
|
|
327
|
+
# 检查是否为已知 APT 组织的基础设施
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### 4.3 影响评估
|
|
331
|
+
|
|
332
|
+
```yaml
|
|
333
|
+
评估维度:
|
|
334
|
+
数据影响:
|
|
335
|
+
- 泄露数据类型(PII/财务/医疗/商业机密)
|
|
336
|
+
- 泄露数据量(记录数/文件数/大小)
|
|
337
|
+
- 数据分级(公开/内部/机密/绝密)
|
|
338
|
+
|
|
339
|
+
系统影响:
|
|
340
|
+
- 受影响系统数量与业务关键度
|
|
341
|
+
- 服务中断时长
|
|
342
|
+
- 是否存在后门/持久化机制
|
|
343
|
+
|
|
344
|
+
业务影响:
|
|
345
|
+
- 直接经济损失
|
|
346
|
+
- 客户信任度影响
|
|
347
|
+
- 合规违规风险(GDPR 罚款/等保处罚)
|
|
348
|
+
|
|
349
|
+
法律影响:
|
|
350
|
+
- 是否需要向监管机构报告
|
|
351
|
+
- 是否需要通知受影响用户
|
|
352
|
+
- 是否需要执法机构介入
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## 五、修复阶段
|
|
358
|
+
|
|
359
|
+
### 5.1 系统恢复
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# 1. 从已验证的干净备份恢复
|
|
363
|
+
# 确认备份时间早于入侵时间
|
|
364
|
+
pg_restore -h db-host -U postgres -d production /backups/pre-incident.dump
|
|
365
|
+
|
|
366
|
+
# 2. 重建受感染主机(推荐而非修补)
|
|
367
|
+
# 使用 Infrastructure as Code 重建
|
|
368
|
+
terraform destroy -target=aws_instance.compromised
|
|
369
|
+
terraform apply
|
|
370
|
+
|
|
371
|
+
# 3. 全量凭据轮换
|
|
372
|
+
# 数据库密码
|
|
373
|
+
vault write database/rotate-root/production
|
|
374
|
+
# API Keys
|
|
375
|
+
for key in $(vault list -format=json secret/api-keys | jq -r '.[]'); do
|
|
376
|
+
vault write "secret/api-keys/${key}" value=$(openssl rand -hex 32)
|
|
377
|
+
done
|
|
378
|
+
# SSH Keys
|
|
379
|
+
ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N ""
|
|
380
|
+
# SSL 证书(如私钥泄露)
|
|
381
|
+
certbot revoke --cert-path /etc/letsencrypt/live/target.com/cert.pem
|
|
382
|
+
certbot certonly --nginx -d target.com
|
|
383
|
+
|
|
384
|
+
# 4. 漏洞修补
|
|
385
|
+
# 更新受影响组件至修复版本
|
|
386
|
+
pip install --upgrade vulnerable-package==safe-version
|
|
387
|
+
npm audit fix --force
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### 5.2 安全加固
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
# 1. 网络层加固
|
|
394
|
+
# 收紧安全组规则
|
|
395
|
+
# 启用 Network Segmentation
|
|
396
|
+
# 部署入侵检测系统
|
|
397
|
+
|
|
398
|
+
# 2. 应用层加固
|
|
399
|
+
# 启用 MFA
|
|
400
|
+
# 实施最小权限原则
|
|
401
|
+
# 增加 WAF 规则
|
|
402
|
+
|
|
403
|
+
# 3. 监控增强
|
|
404
|
+
# 添加针对本次攻击手法的检测规则
|
|
405
|
+
# SIEM 告警阈值调优
|
|
406
|
+
# 关键文件完整性监控
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## 六、通报阶段
|
|
412
|
+
|
|
413
|
+
### 6.1 内部通报
|
|
414
|
+
|
|
415
|
+
```yaml
|
|
416
|
+
通报模板:
|
|
417
|
+
标题: "[安全事件通报] P0 - 用户数据泄露事件"
|
|
418
|
+
时间线:
|
|
419
|
+
- "2026-03-20 14:30 SIEM 告警触发"
|
|
420
|
+
- "2026-03-20 14:45 安全团队确认事件"
|
|
421
|
+
- "2026-03-20 15:00 完成网络隔离"
|
|
422
|
+
- "2026-03-20 18:00 完成取证"
|
|
423
|
+
- "2026-03-21 10:00 完成根因分析"
|
|
424
|
+
- "2026-03-22 12:00 完成系统恢复"
|
|
425
|
+
影响范围: "XX 万用户 email + 手机号泄露"
|
|
426
|
+
根因: "XX 系统存在 SQL 注入漏洞,攻击者利用该漏洞导出数据库"
|
|
427
|
+
修复措施: "已修补漏洞,已轮换凭据,已加固 WAF 规则"
|
|
428
|
+
后续计划: "全系统安全审计 / 用户通知 / 监管报告"
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### 6.2 监管通报
|
|
432
|
+
|
|
433
|
+
```yaml
|
|
434
|
+
通报要求:
|
|
435
|
+
中国(网络安全法 / 等保):
|
|
436
|
+
- 重大安全事件 24 小时内向网信办报告
|
|
437
|
+
- 个人信息泄露通知受影响个人
|
|
438
|
+
- 向公安机关备案
|
|
439
|
+
|
|
440
|
+
GDPR(适用于欧盟用户数据):
|
|
441
|
+
- 72 小时内向监管机构报告
|
|
442
|
+
- 通知受影响的数据主体
|
|
443
|
+
- 记录完整的数据泄露档案
|
|
444
|
+
|
|
445
|
+
PCI-DSS(涉及支付卡数据):
|
|
446
|
+
- 立即通知收单银行
|
|
447
|
+
- 聘请 PFI 进行取证调查
|
|
448
|
+
- 90 天内完成合规整改
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### 6.3 用户通知
|
|
452
|
+
|
|
453
|
+
```yaml
|
|
454
|
+
通知内容:
|
|
455
|
+
- 事件概述(避免过多技术细节)
|
|
456
|
+
- 泄露了哪些数据
|
|
457
|
+
- 已采取的保护措施
|
|
458
|
+
- 用户应采取的行动(修改密码/监控账户)
|
|
459
|
+
- 客服联系方式
|
|
460
|
+
- 后续沟通安排
|
|
461
|
+
|
|
462
|
+
通知渠道:
|
|
463
|
+
- 站内信 / App Push(第一时间)
|
|
464
|
+
- 邮件通知(24 小时内)
|
|
465
|
+
- 官网公告(如影响面广)
|
|
466
|
+
- 必要时媒体声明
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## 七、复盘阶段
|
|
472
|
+
|
|
473
|
+
### 7.1 复盘会议结构
|
|
474
|
+
|
|
475
|
+
```yaml
|
|
476
|
+
参与人员: 安全团队 + 运维团队 + 开发团队 + 管理层
|
|
477
|
+
会议时间: 事件关闭后 3-5 个工作日内
|
|
478
|
+
时长: 1-2 小时
|
|
479
|
+
|
|
480
|
+
议程:
|
|
481
|
+
1. 事件回顾(15 分钟):
|
|
482
|
+
- 完整时间线回放
|
|
483
|
+
- 关键决策点标注
|
|
484
|
+
|
|
485
|
+
2. 做得好的(15 分钟):
|
|
486
|
+
- 检测速度
|
|
487
|
+
- 遏制效果
|
|
488
|
+
- 团队协作
|
|
489
|
+
|
|
490
|
+
3. 需要改进的(30 分钟):
|
|
491
|
+
- 检测盲区
|
|
492
|
+
- 响应延迟环节
|
|
493
|
+
- 工具/流程不足
|
|
494
|
+
- 沟通问题
|
|
495
|
+
|
|
496
|
+
4. 改进行动项(30 分钟):
|
|
497
|
+
- 每个改进项指定负责人和截止时间
|
|
498
|
+
- 分为短期(1 周)/ 中期(1 月)/ 长期(1 季度)
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### 7.2 复盘报告模板
|
|
502
|
+
|
|
503
|
+
```markdown
|
|
504
|
+
# 安全事件复盘报告
|
|
505
|
+
|
|
506
|
+
## 事件摘要
|
|
507
|
+
- 事件编号:SEC-2026-001
|
|
508
|
+
- 事件级别:P0
|
|
509
|
+
- 发现时间 → 关闭时间
|
|
510
|
+
- MTTD(平均检测时间):XX 分钟
|
|
511
|
+
- MTTC(平均遏制时间):XX 分钟
|
|
512
|
+
- MTTR(平均恢复时间):XX 小时
|
|
513
|
+
|
|
514
|
+
## 时间线
|
|
515
|
+
| 时间 | 事件 | 责任方 |
|
|
516
|
+
|------|------|--------|
|
|
517
|
+
| ... | ... | ... |
|
|
518
|
+
|
|
519
|
+
## 根因分析(5 Why)
|
|
520
|
+
1. 为什么数据泄露?→ SQL 注入漏洞被利用
|
|
521
|
+
2. 为什么存在 SQL 注入?→ 输入验证不完整
|
|
522
|
+
3. 为什么输入验证不完整?→ 代码审查未覆盖安全检查
|
|
523
|
+
4. 为什么代码审查未覆盖?→ 安全编码检查清单缺失
|
|
524
|
+
5. 为什么检查清单缺失?→ 安全培训未纳入开发流程
|
|
525
|
+
|
|
526
|
+
## 改进行动项
|
|
527
|
+
| 编号 | 行动项 | 负责人 | 截止日期 | 优先级 |
|
|
528
|
+
|------|--------|--------|---------|--------|
|
|
529
|
+
| 1 | 全系统 SQL 注入扫描 | 安全团队 | T+7d | P0 |
|
|
530
|
+
| 2 | 安全编码培训 | 安全+开发 | T+14d | P1 |
|
|
531
|
+
| 3 | CI 集成 SAST 扫描 | DevOps | T+30d | P1 |
|
|
532
|
+
| 4 | 季度渗透测试制度 | 安全团队 | T+30d | P2 |
|
|
533
|
+
|
|
534
|
+
## 经验教训
|
|
535
|
+
- [具体可复用的经验总结]
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## 八、回滚
|
|
541
|
+
|
|
542
|
+
### 回滚场景与策略
|
|
543
|
+
|
|
544
|
+
| 场景 | 回滚策略 |
|
|
545
|
+
|------|---------|
|
|
546
|
+
| 误封正常 IP | 立即从防火墙/WAF 规则中移除 |
|
|
547
|
+
| 误禁正常账号 | 立即恢复账号并通知用户 |
|
|
548
|
+
| 凭据轮换导致服务中断 | 使用旧凭据恢复服务后重新规划轮换 |
|
|
549
|
+
| 系统恢复后功能异常 | 回退到更早的备份点,逐步前滚 |
|
|
550
|
+
| 安全加固策略过严 | 临时放宽规则,收集正常流量特征后调优 |
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
# 快速回滚防火墙规则
|
|
554
|
+
iptables -D INPUT -s <blocked-ip> -j DROP
|
|
555
|
+
|
|
556
|
+
# 恢复被禁用账号
|
|
557
|
+
passwd -u username
|
|
558
|
+
# 或应用层
|
|
559
|
+
curl -X POST https://admin-api/users/username/enable -H "Authorization: Bearer $ADMIN_TOKEN"
|
|
560
|
+
|
|
561
|
+
# 数据库回滚到特定时间点(如使用 PITR)
|
|
562
|
+
pg_restore --target-time="2026-03-20 14:00:00" -d production
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
## Agent Checklist
|
|
568
|
+
|
|
569
|
+
供自动化 Agent 在执行安全事件响应流程时逐项核查:
|
|
570
|
+
|
|
571
|
+
- [ ] 事件已检测并确认为真实安全事件(非误报)
|
|
572
|
+
- [ ] 事件级别已按标准分级(P0/P1/P2/P3)
|
|
573
|
+
- [ ] 相关人员已按级别通报
|
|
574
|
+
- [ ] 短期遏制措施已执行(IP 封禁/账号禁用/网络隔离)
|
|
575
|
+
- [ ] 易失性证据已采集(内存/进程/网络连接)
|
|
576
|
+
- [ ] 系统日志与应用日志已保全
|
|
577
|
+
- [ ] 磁盘镜像已创建并计算哈希
|
|
578
|
+
- [ ] 攻击路径已还原(入口/横向移动/持久化)
|
|
579
|
+
- [ ] 影响范围已评估(数据/系统/业务/法律)
|
|
580
|
+
- [ ] 系统已从干净备份恢复或重建
|
|
581
|
+
- [ ] 所有凭据已轮换
|
|
582
|
+
- [ ] 漏洞入口已修补
|
|
583
|
+
- [ ] 安全加固措施已部署
|
|
584
|
+
- [ ] 监管通报已按要求完成
|
|
585
|
+
- [ ] 受影响用户已通知
|
|
586
|
+
- [ ] 复盘会议已召开
|
|
587
|
+
- [ ] 改进行动项已指定负责人和截止日期
|
|
588
|
+
- [ ] 复盘报告已归档
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: owasp-api-security-playbook
|
|
3
|
+
title: OWASP API Security Top 10 企业级防护手册
|
|
4
|
+
domain: security
|
|
5
|
+
category: 02-playbooks
|
|
6
|
+
difficulty: advanced
|
|
7
|
+
tags: [security, owasp, api, bola, jwt, oauth2, rbac, rate-limiting, input-validation, cors, authorization, authentication, enterprise]
|
|
8
|
+
quality_score: 95
|
|
9
|
+
maintainer: security-team@umadev.com
|
|
10
|
+
last_updated: 2026-06-14
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# OWASP API Security Top 10 企业级防护手册
|
|
14
|
+
|
|
15
|
+
> 基于 [OWASP API Security Top 10 (2023)](https://owasp.org/API-Security/) + 2025 企业级实践
|
|
16
|
+
|
|
17
|
+
## API1:2023 — Broken Object Level Authorization (BOLA)
|
|
18
|
+
|
|
19
|
+
**风险**:用户 A 能访问用户 B 的数据(最常见、最严重的 API 漏洞)。
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
# ❌ 只检查是否登录,没检查资源归属
|
|
23
|
+
@app.get("/api/orders/{order_id}")
|
|
24
|
+
def get_order(order_id, current_user=Depends(get_current_user)):
|
|
25
|
+
return db.query(Order).get(order_id) # 任何用户都能看任何订单!
|
|
26
|
+
|
|
27
|
+
# ✅ 检查资源归属
|
|
28
|
+
@app.get("/api/orders/{order_id}")
|
|
29
|
+
def get_order(order_id, current_user=Depends(get_current_user)):
|
|
30
|
+
order = db.query(Order).get(order_id)
|
|
31
|
+
if order.user_id != current_user.id and not current_user.is_admin:
|
|
32
|
+
raise HTTPException(403, "Forbidden")
|
|
33
|
+
return order
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API2:2023 — Broken Authentication
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
# ❌ 弱密码策略 + 无锁定 + JWT 永不过期
|
|
40
|
+
jwt_token = create_jwt(user_id, expires_in=NEVER)
|
|
41
|
+
|
|
42
|
+
# ✅ 强密码 + 锁定 + 短 TTL JWT + 刷新令牌
|
|
43
|
+
@app.post("/api/auth/login")
|
|
44
|
+
def login(email, password):
|
|
45
|
+
user = verify_credentials(email, password)
|
|
46
|
+
# 5 次失败锁定 15 分钟
|
|
47
|
+
if failed_attempts(email) >= 5:
|
|
48
|
+
lock_account(email, duration=900)
|
|
49
|
+
return {
|
|
50
|
+
"access_token": create_jwt(user_id, expires_in=900), # 15min
|
|
51
|
+
"refresh_token": create_refresh_token(user_id, expires_in=604800), # 7d
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## API3:2023 — Broken Object Property Level Authorization
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# ❌ Mass assignment — 用户可以修改不该改的字段
|
|
59
|
+
@app.patch("/api/users/{id}")
|
|
60
|
+
def update_user(id, data: dict):
|
|
61
|
+
return db.update(User, id, **data) # data 含 role="admin"?!
|
|
62
|
+
|
|
63
|
+
# ✅ 白名单字段
|
|
64
|
+
class UpdateUserRequest(BaseModel):
|
|
65
|
+
name: str | None = None
|
|
66
|
+
email: str | None = None
|
|
67
|
+
# 不暴露 role, is_admin, password_hash
|
|
68
|
+
|
|
69
|
+
@app.patch("/api/users/{id}")
|
|
70
|
+
def update_user(id, data: UpdateUserRequest):
|
|
71
|
+
return db.update(User, id, **data.dict(exclude_unset=True))
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## API4:2023 — Unrestricted Resource Consumption
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
# ❌ 无限制(OOM/DoS 风险)
|
|
78
|
+
@app.post("/api/upload")
|
|
79
|
+
def upload(file: UploadFile):
|
|
80
|
+
save(file) # 10GB 文件?
|
|
81
|
+
|
|
82
|
+
@app.get("/api/users")
|
|
83
|
+
def list_users():
|
|
84
|
+
return db.query(User).all() # 100 万行?
|
|
85
|
+
|
|
86
|
+
# ✅ 限制 + 分页 + 速率
|
|
87
|
+
@app.post("/api/upload")
|
|
88
|
+
async def upload(file: UploadFile = File(max_size=10_000_000)): # 10MB 上限
|
|
89
|
+
save(file)
|
|
90
|
+
|
|
91
|
+
@app.get("/api/users")
|
|
92
|
+
@rate_limit(100, per_minute=True)
|
|
93
|
+
def list_users(page: int = 1, limit: int = Field(default=20, le=100)):
|
|
94
|
+
return db.query(User).offset((page-1)*limit).limit(limit).all()
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## API5:2023 — Broken Function Level Authorization
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
# ❌ 只在前端隐藏 admin 按钮,API 无权限检查
|
|
101
|
+
@app.delete("/api/users/{id}")
|
|
102
|
+
def delete_user(id):
|
|
103
|
+
db.delete(User, id) # 任何登录用户都能删任何人
|
|
104
|
+
|
|
105
|
+
# ✅ 后端 RBAC
|
|
106
|
+
@app.delete("/api/users/{id}")
|
|
107
|
+
@requires_role("admin") # 装饰器检查
|
|
108
|
+
def delete_user(id, current_user):
|
|
109
|
+
db.delete(User, id)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## JWT 硬化清单
|
|
113
|
+
|
|
114
|
+
| 配置项 | 推荐值 | 说明 |
|
|
115
|
+
|--------|--------|------|
|
|
116
|
+
| 算法 | RS256/ES256 | 不用 HS256(对称密钥泄露风险)|
|
|
117
|
+
| Access TTL | 15min | 短 TTL 降低泄露影响 |
|
|
118
|
+
| Refresh TTL | 7d | 带轮换(每次刷新换新 token)|
|
|
119
|
+
| 密钥轮换 | 90d | 定期换签名密钥 |
|
|
120
|
+
| 不存 localStorage | — | 用 HttpOnly Cookie 防 XSS |
|
|
121
|
+
| 撤销列表 | Redis | JWT 默认无状态,需黑名单机制 |
|
|
122
|
+
|
|
123
|
+
## OAuth2 企业级要点
|
|
124
|
+
|
|
125
|
+
- **不用 implicit flow**(已弃用)— 用 Authorization Code + PKCE
|
|
126
|
+
- **redirect_uri 白名单** — 精确匹配,不允许通配
|
|
127
|
+
- **state 参数** — 防 CSRF
|
|
128
|
+
- **scope 最小化** — 只申请必需权限
|
|
129
|
+
- **token 撤销端点** — 支持主动撤销
|