mh-cto-sdlc-security-arch
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-05-13
- Stars
- ★ 2
- Forks
- 0
02 资源文件 2
- 其他customize.toml636 B
- 参考文档mh-skill-manifest.yaml666 B
03 SKILL.md 正文
Security Architecture
Mode: synthesize-first (D34). Read the system diagram, data model, and integration contracts. Derive threats and failure modes from structure. Ask only where business risk tolerance or compliance requirements are not in the artifacts.
Elite character: Security architecture is not a checklist. It is threat modeling — asking "what could go wrong, how bad would it be, and what would it cost to prevent?" Every trust boundary is a decision about who is allowed to do what to whom. Every failure mode not named here will be discovered in production.
Scope: This skill covers sub-phases 4.7 (security architecture) and 4.8 (resilience surface mapping) — both concern system boundaries where things go wrong.
Step 1 — Load Artifacts
Confirm present:
- System diagram (
system-diagram.md) ✓ / ✗ — REQUIRED - Data model (
data-model.md) ✓ / ✗ — REQUIRED - Integration contracts (
integration-contracts.md) ✓ / ✗ - Arch drivers (
arch-drivers.md) ✓ / ✗
Step 2 — Threat Modeling (STRIDE)
For each component and integration in the system diagram, apply STRIDE:
| Category | Question |
|---|---|
| Spoofing | Can an attacker impersonate a user, service, or system? |
| Tampering | Can an attacker modify data in transit or at rest? |
| Repudiation | Can a user deny performing an action? Is there an audit trail? |
| Information Disclosure | Can an attacker read data they shouldn't? |
| Denial of Service | Can an attacker make the service unavailable? |
| Elevation of Privilege | Can a user gain access beyond their authorization level? |
For each relevant threat:
- Threat: [STRIDE category — specific attack vector]
- Target: [which component / data / user]
- Likelihood: High / Medium / Low
- Impact: High / Medium / Low
- Mitigation: [specific control — or "accepted risk" with rationale]
Do not list threats you have no intention of mitigating — that is theater. If the risk is accepted, say so explicitly with the rationale.
Step 3 — Define Trust Boundaries
From the system diagram, every boundary where trust level changes is a trust boundary.
For each boundary:
- Boundary: [e.g. "Public internet → API Gateway", "API Gateway → internal services", "Service → database"]
- What crosses it: [data types, user actions, service calls]
- Trust model: [what is verified at this boundary]
- Controls: [authentication, authorization, input validation, encryption in transit]
Internet-facing boundaries require the most scrutiny:
- Input validation: what is the maximum input size? What characters are allowed?
- Rate limiting: requests per IP / per user per time window
- Authentication: which endpoints are public vs. authenticated?
Step 4 — Authentication and Authorization Strategy
Authentication strategy:
- How are users authenticated? (JWT, session cookies, OAuth2/OIDC, API keys)
- Where are tokens issued and validated? (which service owns the auth boundary)
- Token expiry and refresh strategy
- Multi-factor authentication: required / optional / not applicable
Authorization model:
- Model type: RBAC (roles) / ABAC (attributes) / simple per-resource ownership
- Where authorization decisions are made: centralized auth service / per-service / middleware
- Who can do what: define the permission matrix from stories and personas
Sensitive data protection:
- Which fields from the data model contain PII or regulated data? (cross-reference data model PII flags)
- Encryption at rest: which data stores, which fields
- Encryption in transit: TLS required everywhere (state explicitly)
- Key management: where secrets live (environment variables / secrets manager / vault)
Step 5 — Resilience Surface Mapping (sub-phase 4.8)
For each service and critical path in the system, name the failure modes:
Single Points of Failure:
- Which services, if they fail, bring the entire product down?
- For each SPOF: is this acceptable? If not, what redundancy or graceful degradation pattern resolves it?
Failure cascade risk:
- Which failures can propagate to other services?
- Where does a slow service starve the thread pool of a healthy service?
- What is the isolation boundary?
Data corruption risk:
- Where can partial writes leave the system in an inconsistent state?
- What are the recovery procedures?
External dependency failures:
- For each critical integration: what is the graceful degradation mode?
- Cross-reference integration-contracts.md fallback strategies — ensure they exist.
Failure severity classification:
| Failure | Impact | RTO (Recovery Time Objective) | RPO (Recovery Point Objective) |
|---|---|---|---|
| {service down} | {user impact} | {minutes to acceptable state} | {max data loss acceptable} |
Step 6 — Write ADR Entries (D27)
For security and resilience decisions that qualify:
Save to docs/adr/000{N}-{slug}.md. Scan for current highest number.
Candidates: authentication mechanism choice, authorization model, encryption-at-rest strategy, session management approach, SPOF acceptance.
Step 7 — Write Output
Save to _mh-output/cto/sdlc/security-arch/{YYYY-MM-DD}_{r###}_threat-model.md and {YYYY-MM-DD}_{r###}_resilience-surface-map.md:
# Threat Model
**Product:** {name}
**Date:** {date}
## Threat Register
| Threat | STRIDE | Target | Likelihood | Impact | Mitigation |
| -------- | ----------- | ----------- | ---------- | ------ | ---------- |
| {threat} | S/T/R/I/D/E | {component} | H/M/L | H/M/L | {control} |
## Trust Boundaries
| Boundary | What Crosses | Controls |
| --------------- | -------------- | -------------------------------- |
| {boundary name} | {data / calls} | {auth + validation + encryption} |
## Auth Strategy
- **Authentication:** {mechanism}
- **Authorization:** {model + where decisions are made}
- **Sensitive data:** {PII fields + encryption approach}
- **Key management:** {secrets strategy}
## ADRs Written
{List}
# Resilience Surface Map
**Product:** {name}
**Date:** {date}
## Single Points of Failure
| Component | SPOF? | Mitigation / Accepted Risk |
| --------- | -------- | ---------------------------------------------- |
| {name} | Yes / No | {redundancy / graceful degradation / accepted} |
## Failure Mode Register
| Failure | Cascade Risk | RTO | RPO | Phase 5/6 Action |
| --------- | ----------------- | --------- | ----------- | ------------------------------- |
| {failure} | {what it affects} | {minutes} | {data loss} | {test / circuit breaker / etc.} |
## Degraded Mode Definitions
{For each SPOF — what the product does when it is unavailable}
Step 8 — Present Summary
Security Architecture complete.
Threats identified: {N} total — {N} High, {N} Medium, {N} Low impact.
Trust boundaries: {N} defined, {N} internet-facing with strict controls.
Auth strategy: {one sentence — e.g. "JWT-based, centralized auth service, RBAC with 3 roles"}
SPOFs: {N} identified — {N} mitigated, {N} accepted with documented rationale.
ADRs written: {N}
Phase 5 inputs: {N} failure modes require chaos test coverage.
Next step: Run /mh-cto-sdlc-tech-selection to lock technology choices with all architectural context in hand.
04 同仓库更多 Skills
mh-vo-vault-brief
Weekly vault intelligence report — health score, pipeline status, OS alignment, and top issues. Use when the user says vault brief, weekly vault report, vault intelligence, run the vault brief, or weekly review brief.
mh-vo-output-bridge
Scan _mh-output/ for new artifacts and create or update corresponding vault entries. Use when the user says run the bridge, sync outputs to vault, output bridge, create vault entries, sync mh-output to vault, or bridge outputs.
mh-vo-moc-builder
Create or update Maps of Content for vault sections and ensure every note is reachable from a MOC. Use when the user says build MOCs, update MOCs, rebuild maps of content, MOC builder, create maps of content, or update the MOCs.
mh-vo-link-architect
Identify missing vault connections and generate precise link recommendations. Use when the user says recommend links, find missing connections, link architect, what should be connected, or identify missing links.
mh-vo-base-builder
Generate Obsidian Bases (.base files) for live database views of vault data. Use when the user says build base views, create base files, generate bases, build live views, or create database views.
mh-vo-taxonomy-enforcer
Audit vault tags and frontmatter, find drift, and apply corrections. Use when the user says fix the taxonomy, enforce tags, fix frontmatter, clean up tags, taxonomy enforcer, or fix tags.