@documentation-robotics/cli 0.1.13 → 0.3.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/README.md +74 -2
- package/dist/analysis/relationship-classifier.js +2 -9
- package/dist/analysis/relationship-classifier.js.map +2 -2
- package/dist/analyzers/call-graph-utils.js +2 -2
- package/dist/analyzers/call-graph-utils.js.map +2 -2
- package/dist/analyzers/cards/build.js +171 -0
- package/dist/analyzers/cards/build.js.map +7 -0
- package/dist/analyzers/cards/classify.js +42 -0
- package/dist/analyzers/cards/classify.js.map +7 -0
- package/dist/analyzers/cards/edge-index.js +44 -0
- package/dist/analyzers/cards/edge-index.js.map +7 -0
- package/dist/analyzers/cards/facts.js +46 -0
- package/dist/analyzers/cards/facts.js.map +7 -0
- package/dist/analyzers/cards/graph.js +42 -0
- package/dist/analyzers/cards/graph.js.map +7 -0
- package/dist/analyzers/cards/index.js +8 -0
- package/dist/analyzers/cards/index.js.map +7 -0
- package/dist/analyzers/cards/tier0.js +18 -0
- package/dist/analyzers/cards/tier0.js.map +7 -0
- package/dist/analyzers/cards/types.js +1 -0
- package/dist/analyzers/cards/types.js.map +7 -0
- package/dist/analyzers/cbm-analyzer.js +195 -171
- package/dist/analyzers/cbm-analyzer.js.map +2 -2
- package/dist/analyzers/cbm-responses.js +336 -0
- package/dist/analyzers/cbm-responses.js.map +7 -0
- package/dist/analyzers/edge-relationships.js +45 -0
- package/dist/analyzers/edge-relationships.js.map +7 -0
- package/dist/analyzers/mapping-loader.js +9 -0
- package/dist/analyzers/mapping-loader.js.map +2 -2
- package/dist/analyzers/tier0-rules.js +153 -0
- package/dist/analyzers/tier0-rules.js.map +7 -0
- package/dist/analyzers/types.js.map +1 -1
- package/dist/analyzers/verify-engine.js +22 -19
- package/dist/analyzers/verify-engine.js.map +2 -2
- package/dist/audit/relationships/ai/prompts.js +10 -10
- package/dist/audit/relationships/ai/prompts.js.map +2 -2
- package/dist/audit/relationships/analysis/layer-templates.js +52 -52
- package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
- package/dist/cli.js +112 -28
- package/dist/cli.js.map +3 -3
- package/dist/coding-agents/agents/claude-code.js +3 -1
- package/dist/coding-agents/agents/claude-code.js.map +2 -2
- package/dist/coding-agents/claude-code-client.js +2 -1
- package/dist/coding-agents/claude-code-client.js.map +2 -2
- package/dist/coding-agents/copilot-client.js +17 -12
- package/dist/coding-agents/copilot-client.js.map +2 -2
- package/dist/coding-agents/default-permissions.js +152 -0
- package/dist/coding-agents/default-permissions.js.map +7 -0
- package/dist/coding-agents/drbot-mcp.js +167 -0
- package/dist/coding-agents/drbot-mcp.js.map +7 -0
- package/dist/commands/add.js +12 -7
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +134 -23
- package/dist/commands/analyzer.js.map +2 -2
- package/dist/commands/audit.js +6 -6
- package/dist/commands/audit.js.map +2 -2
- package/dist/commands/changeset-verify.js +55 -0
- package/dist/commands/changeset-verify.js.map +7 -0
- package/dist/commands/changeset.js +261 -147
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/delete.js +52 -19
- package/dist/commands/delete.js.map +3 -3
- package/dist/commands/element.js +3 -2
- package/dist/commands/element.js.map +2 -2
- package/dist/commands/farm.js +773 -0
- package/dist/commands/farm.js.map +7 -0
- package/dist/commands/init.js +11 -1
- package/dist/commands/init.js.map +2 -2
- package/dist/commands/mcp.js +122 -0
- package/dist/commands/mcp.js.map +7 -0
- package/dist/commands/relationship.js +251 -47
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/reports.js +1 -1
- package/dist/commands/reports.js.map +2 -2
- package/dist/commands/update.js +56 -24
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/upgrade.js +99 -11
- package/dist/commands/upgrade.js.map +3 -3
- package/dist/commands/validate.js +41 -3
- package/dist/commands/validate.js.map +2 -2
- package/dist/commands/version.js +2 -2
- package/dist/commands/version.js.map +2 -2
- package/dist/commands/visualize.js +4 -3
- package/dist/commands/visualize.js.map +2 -2
- package/dist/config.js +83 -0
- package/dist/config.js.map +7 -0
- package/dist/core/annotation-store.js +138 -0
- package/dist/core/annotation-store.js.map +7 -0
- package/dist/core/catalog-migration.js +33 -0
- package/dist/core/catalog-migration.js.map +7 -0
- package/dist/core/changeset-analysis.js +421 -0
- package/dist/core/changeset-analysis.js.map +7 -0
- package/dist/core/changeset-base-index.js +153 -0
- package/dist/core/changeset-base-index.js.map +7 -0
- package/dist/core/changeset-brief-delta.js +102 -0
- package/dist/core/changeset-brief-delta.js.map +7 -0
- package/dist/core/changeset-graph.js +281 -0
- package/dist/core/changeset-graph.js.map +7 -0
- package/dist/core/changeset-only-guard.js +32 -0
- package/dist/core/changeset-only-guard.js.map +7 -0
- package/dist/core/changeset-summary.js +68 -0
- package/dist/core/changeset-summary.js.map +7 -0
- package/dist/core/changeset-validator.js +66 -20
- package/dist/core/changeset-validator.js.map +2 -2
- package/dist/core/changeset-verify.js +518 -0
- package/dist/core/changeset-verify.js.map +7 -0
- package/dist/core/changeset.js +56 -9
- package/dist/core/changeset.js.map +2 -2
- package/dist/core/element-type-migration.js +145 -0
- package/dist/core/element-type-migration.js.map +7 -0
- package/dist/core/farm-manifest.js +140 -0
- package/dist/core/farm-manifest.js.map +7 -0
- package/dist/core/farm-sync-engine.js +346 -0
- package/dist/core/farm-sync-engine.js.map +7 -0
- package/dist/core/farm-sync-state.js +167 -0
- package/dist/core/farm-sync-state.js.map +7 -0
- package/dist/core/manifest.js +6 -3
- package/dist/core/manifest.js.map +2 -2
- package/dist/core/migration-registry.js +84 -1
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model-upgrade.js +102 -0
- package/dist/core/model-upgrade.js.map +7 -0
- package/dist/core/model.js +257 -44
- package/dist/core/model.js.map +3 -3
- package/dist/core/mutation-handler.js +71 -6
- package/dist/core/mutation-handler.js.map +2 -2
- package/dist/core/relationship-migration-table.js +6639 -0
- package/dist/core/relationship-migration-table.js.map +7 -0
- package/dist/core/relationship-migration.js +272 -0
- package/dist/core/relationship-migration.js.map +7 -0
- package/dist/core/relationship-prune.js +49 -0
- package/dist/core/relationship-prune.js.map +7 -0
- package/dist/core/relationship-staging.js +68 -0
- package/dist/core/relationship-staging.js.map +7 -0
- package/dist/core/relationships.js +26 -4
- package/dist/core/relationships.js.map +2 -2
- package/dist/core/report-data-model.js +7 -13
- package/dist/core/report-data-model.js.map +2 -2
- package/dist/core/staged-changeset-storage.js +64 -17
- package/dist/core/staged-changeset-storage.js.map +2 -2
- package/dist/core/staged-source-reference.js +28 -0
- package/dist/core/staged-source-reference.js.map +7 -0
- package/dist/core/staging-area.js +83 -18
- package/dist/core/staging-area.js.map +2 -2
- package/dist/core/virtual-projection.js +14 -5
- package/dist/core/virtual-projection.js.map +2 -2
- package/dist/export/archimate-exporter.js +1 -0
- package/dist/export/archimate-exporter.js.map +2 -2
- package/dist/generated/compiled-validators.js +2 -2
- package/dist/generated/compiled-validators.js.map +2 -2
- package/dist/generated/layer-registry.js +16 -16
- package/dist/generated/layer-registry.js.map +2 -2
- package/dist/generated/node-types.js +186 -168
- package/dist/generated/node-types.js.map +2 -2
- package/dist/generated/relationship-index.js +2209 -7727
- package/dist/generated/relationship-index.js.map +2 -2
- package/dist/integrations/claude_code/agents/dr-architect.md +16 -3
- package/dist/integrations/claude_code/agents/dr-extractor.md +1 -1
- package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
- package/dist/integrations/claude_code/commands/dr-map.md +13 -0
- package/dist/integrations/claude_code/commands/dr-plan.md +40 -0
- package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
- package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
- package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
- package/dist/integrations/claude_code/docs/MCP_SERVER.md +79 -0
- package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
- package/dist/integrations/claude_code/docs/README.md +52 -1
- package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
- package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
- package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
- package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
- package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
- package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
- package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
- package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
- package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
- package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
- package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
- package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
- package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +92 -15
- package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +119 -0
- package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +3 -0
- package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +1 -1
- package/dist/integrations/github_copilot/agents/dr-architect.md +1 -1
- package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
- package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
- package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
- package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
- package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
- package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
- package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
- package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
- package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
- package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
- package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
- package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
- package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +222 -102
- package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +119 -0
- package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
- package/dist/integrations/hash-utils.js.map +2 -2
- package/dist/mcp/api-key-manager.js +111 -0
- package/dist/mcp/api-key-manager.js.map +7 -0
- package/dist/mcp/changeset-only.js +34 -0
- package/dist/mcp/changeset-only.js.map +7 -0
- package/dist/mcp/http-transport.js +176 -0
- package/dist/mcp/http-transport.js.map +7 -0
- package/dist/mcp/resource-registry.js +97 -0
- package/dist/mcp/resource-registry.js.map +7 -0
- package/dist/mcp/tool-registry.js +60 -0
- package/dist/mcp/tool-registry.js.map +7 -0
- package/dist/mcp/tools/annotation-create.js +39 -0
- package/dist/mcp/tools/annotation-create.js.map +7 -0
- package/dist/mcp/tools/annotation-delete.js +29 -0
- package/dist/mcp/tools/annotation-delete.js.map +7 -0
- package/dist/mcp/tools/annotation-get.js +29 -0
- package/dist/mcp/tools/annotation-get.js.map +7 -0
- package/dist/mcp/tools/annotation-list.js +24 -0
- package/dist/mcp/tools/annotation-list.js.map +7 -0
- package/dist/mcp/tools/annotation-reply.js +34 -0
- package/dist/mcp/tools/annotation-reply.js.map +7 -0
- package/dist/mcp/tools/annotation-shared.js +10 -0
- package/dist/mcp/tools/annotation-shared.js.map +7 -0
- package/dist/mcp/tools/annotation-update.js +39 -0
- package/dist/mcp/tools/annotation-update.js.map +7 -0
- package/dist/mcp/tools/changeset-analysis-tools.js +78 -0
- package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
- package/dist/mcp/tools/changeset-editing.js +184 -0
- package/dist/mcp/tools/changeset-editing.js.map +7 -0
- package/dist/mcp/tools/changeset-lifecycle.js +83 -0
- package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
- package/dist/mcp/tools/changeset-list.js +33 -0
- package/dist/mcp/tools/changeset-list.js.map +7 -0
- package/dist/mcp/tools/changeset-shared.js +31 -0
- package/dist/mcp/tools/changeset-shared.js.map +7 -0
- package/dist/mcp/tools/changeset-show.js +55 -0
- package/dist/mcp/tools/changeset-show.js.map +7 -0
- package/dist/mcp/tools/changeset-verify.js +43 -0
- package/dist/mcp/tools/changeset-verify.js.map +7 -0
- package/dist/mcp/tools/chat-launch.js +50 -0
- package/dist/mcp/tools/chat-launch.js.map +7 -0
- package/dist/mcp/tools/chat-status.js +26 -0
- package/dist/mcp/tools/chat-status.js.map +7 -0
- package/dist/mcp/tools/index.js +65 -0
- package/dist/mcp/tools/index.js.map +7 -0
- package/dist/mcp/tools/model-add.js +107 -0
- package/dist/mcp/tools/model-add.js.map +7 -0
- package/dist/mcp/tools/model-delete.js +99 -0
- package/dist/mcp/tools/model-delete.js.map +7 -0
- package/dist/mcp/tools/model-export.js +72 -0
- package/dist/mcp/tools/model-export.js.map +7 -0
- package/dist/mcp/tools/model-info.js +51 -0
- package/dist/mcp/tools/model-info.js.map +7 -0
- package/dist/mcp/tools/model-list.js +53 -0
- package/dist/mcp/tools/model-list.js.map +7 -0
- package/dist/mcp/tools/model-reload.js +34 -0
- package/dist/mcp/tools/model-reload.js.map +7 -0
- package/dist/mcp/tools/model-search.js +102 -0
- package/dist/mcp/tools/model-search.js.map +7 -0
- package/dist/mcp/tools/model-show.js +68 -0
- package/dist/mcp/tools/model-show.js.map +7 -0
- package/dist/mcp/tools/model-stats.js +22 -0
- package/dist/mcp/tools/model-stats.js.map +7 -0
- package/dist/mcp/tools/model-trace.js +118 -0
- package/dist/mcp/tools/model-trace.js.map +7 -0
- package/dist/mcp/tools/model-update.js +121 -0
- package/dist/mcp/tools/model-update.js.map +7 -0
- package/dist/mcp/tools/model-validate.js +78 -0
- package/dist/mcp/tools/model-validate.js.map +7 -0
- package/dist/mcp/tools/relationship-tools.js +98 -0
- package/dist/mcp/tools/relationship-tools.js.map +7 -0
- package/dist/mcp/tools/shared.js +126 -0
- package/dist/mcp/tools/shared.js.map +7 -0
- package/dist/mcp/tools/spec-type.js +90 -0
- package/dist/mcp/tools/spec-type.js.map +7 -0
- package/dist/reports/model-layer-report-generator.js +5 -3
- package/dist/reports/model-layer-report-generator.js.map +2 -2
- package/dist/reports/model-readme-generator.js +116 -0
- package/dist/reports/model-readme-generator.js.map +7 -0
- package/dist/reports/model-report-data.js +37 -1
- package/dist/reports/model-report-data.js.map +2 -2
- package/dist/reports/model-report-orchestrator.js +29 -6
- package/dist/reports/model-report-orchestrator.js.map +2 -2
- package/dist/reports/model-report-utils.js +9 -0
- package/dist/reports/model-report-utils.js.map +7 -0
- package/dist/schemas/bundled/analyzers/cbm.json +1186 -68
- package/dist/schemas/bundled/analyzers/manifest.json +2 -2
- package/dist/schemas/bundled/api.json +1029 -1658
- package/dist/schemas/bundled/apm.json +499 -734
- package/dist/schemas/bundled/application.json +745 -370
- package/dist/schemas/bundled/base.json +3 -220
- package/dist/schemas/bundled/business.json +452 -366
- package/dist/schemas/bundled/data-model.json +403 -383
- package/dist/schemas/bundled/data-store.json +334 -558
- package/dist/schemas/bundled/manifest.json +18 -18
- package/dist/schemas/bundled/motivation.json +349 -368
- package/dist/schemas/bundled/navigation.json +415 -731
- package/dist/schemas/bundled/product.json +325 -159
- package/dist/schemas/bundled/security.json +864 -1232
- package/dist/schemas/bundled/technology.json +574 -703
- package/dist/schemas/bundled/testing.json +718 -1643
- package/dist/schemas/bundled/ux.json +739 -1352
- package/dist/server/schemas.js +8 -0
- package/dist/server/schemas.js.map +2 -2
- package/dist/server/server.js +234 -31
- package/dist/server/server.js.map +2 -2
- package/dist/server-entry.js +2 -1
- package/dist/server-entry.js.map +2 -2
- package/dist/telemetry/config.js +2 -40
- package/dist/telemetry/config.js.map +2 -2
- package/dist/telemetry/index.js +1 -1
- package/dist/types/index.js.map +2 -2
- package/dist/utils/ansi-suppressor.js +23 -0
- package/dist/utils/ansi-suppressor.js.map +7 -0
- package/dist/utils/attribute-patch.js +41 -0
- package/dist/utils/attribute-patch.js.map +7 -0
- package/dist/utils/color-utils.js +34 -0
- package/dist/utils/color-utils.js.map +7 -0
- package/dist/utils/element-reference-shape.js +15 -1
- package/dist/utils/element-reference-shape.js.map +3 -3
- package/dist/utils/error-hints.js +29 -0
- package/dist/utils/error-hints.js.map +7 -0
- package/dist/utils/errors.js +75 -10
- package/dist/utils/errors.js.map +2 -2
- package/dist/utils/globals.js +17 -1
- package/dist/utils/globals.js.map +2 -2
- package/dist/utils/project-paths.js +50 -3
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/reference-path-parser.js +49 -0
- package/dist/utils/reference-path-parser.js.map +7 -0
- package/dist/utils/source-reference.js +17 -10
- package/dist/utils/source-reference.js.map +2 -2
- package/dist/utils/spec-version.js +10 -2
- package/dist/utils/spec-version.js.map +2 -2
- package/dist/validators/composed-reference-validator.js +240 -0
- package/dist/validators/composed-reference-validator.js.map +7 -0
- package/dist/validators/reference-validator.js +57 -13
- package/dist/validators/reference-validator.js.map +3 -3
- package/dist/validators/relationship-schema-validator.js +33 -5
- package/dist/validators/relationship-schema-validator.js.map +3 -3
- package/dist/validators/schema-validator.js +27 -9
- package/dist/validators/schema-validator.js.map +2 -2
- package/dist/validators/types.js.map +1 -1
- package/dist/viewer/README.md +6 -6
- package/dist/viewer/assets/main-CxzcuU_o.js +84 -0
- package/dist/viewer/assets/main-j-7ULYpm.css +1 -0
- package/dist/viewer/index.html +2 -2
- package/dist/viewer/manifest.json +10 -10
- package/dist/viewer/version.json +1 -1
- package/package.json +7 -3
- package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
- package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
|
@@ -92,51 +92,60 @@ This layer uses a **custom YAML specification** designed to cover authentication
|
|
|
92
92
|
|
|
93
93
|
## Intra-Layer Relationships
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
├── contains → SecurityPolicies []
|
|
117
|
-
│ └── each SecurityPolicy contains → PolicyRules []
|
|
118
|
-
│ └── each PolicyRule contains → PolicyActions []
|
|
119
|
-
├── contains → DataClassification
|
|
120
|
-
├── contains → SocialDependencies []
|
|
121
|
-
├── contains → AccountabilityRequirements []
|
|
122
|
-
│ └── each AccountabilityRequirement contains → Evidence []
|
|
123
|
-
└── contains → Threats []
|
|
124
|
-
└── each Threat contains → Countermeasures []
|
|
125
|
-
```
|
|
95
|
+
Containment is recorded with `aggregates` / `composes`; behavior and access rules use the predicates below. Record each link with `dr relationship add`.
|
|
96
|
+
|
|
97
|
+
Access follows one chain: actors are `assigned-to` roles, roles `aggregates` permissions, and
|
|
98
|
+
permissions `authorizes` resource operations. A policy `composes` its rules, and a rule `uses` its
|
|
99
|
+
conditions and `triggers` its actions. Policies `mandates` countermeasures, and only countermeasures
|
|
100
|
+
`mitigates` threats. Audit configs and rules `generates` evidence, which retention policies govern.
|
|
101
|
+
Other layers link to the individual duty rule (separation of duty, binding of duty, need to know),
|
|
102
|
+
not to the constraints container, and data elements `references` their classification.
|
|
103
|
+
|
|
104
|
+
### Containment
|
|
105
|
+
|
|
106
|
+
| Source Type | Predicate | Target Type | Example |
|
|
107
|
+
| ------------------- | ---------- | -------------------- | ---------------------------------------------------------- |
|
|
108
|
+
| SecurityModel | composes | AuthenticationConfig | "Application Security" composes "OAuth2 Google" |
|
|
109
|
+
| SecurityModel | composes | SecurityPolicy | "Application Security" composes "Data Access Policy" |
|
|
110
|
+
| SecurityModel | aggregates | Role | "Application Security" aggregates "Admin", "User", "Guest" |
|
|
111
|
+
| SecurityModel | aggregates | Threat | "Application Security" aggregates "SQL Injection" |
|
|
112
|
+
| SecureResource | composes | ResourceOperation | "User API" composes "List Users", "Create User" |
|
|
113
|
+
| SecureResource | composes | FieldAccessControl | "Customer Record" composes "Mask SSN For Support" |
|
|
114
|
+
| SecurityPolicy | composes | PolicyRule | "Data Access Policy" composes "Owner Can Write" |
|
|
115
|
+
| SecurityConstraints | aggregates | SeparationOfDuty | "Payment Controls" aggregates "Approve Payment SoD" |
|
|
126
116
|
|
|
127
117
|
### Key Relationship Patterns
|
|
128
118
|
|
|
129
|
-
| Source
|
|
130
|
-
|
|
|
131
|
-
| Actor
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
| Role
|
|
135
|
-
| Permission
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
119
|
+
| Source Type | Predicate | Target Type | Example |
|
|
120
|
+
| ------------------------- | -------------- | ------------------------- | ------------------------------------------------------------- |
|
|
121
|
+
| Actor | assigned-to | Role | "Support Agent" assigned-to "Support" |
|
|
122
|
+
| AuthenticationConfig | authenticates | Actor | "mTLS Client Certificate" authenticates "Service Account" |
|
|
123
|
+
| Role | aggregates | Permission | "Admin" aggregates "users.write" |
|
|
124
|
+
| Role | specializes | Role | "Admin" specializes "User" |
|
|
125
|
+
| Permission | authorizes | ResourceOperation | "users.read" authorizes "List Users" |
|
|
126
|
+
| ResourceOperation | constrained-by | AccessCondition | "Update Invoice" constrained-by "Is Owner" |
|
|
127
|
+
| ResourceOperation | references | AuditConfig | "Delete User" references "Admin Action Audit" |
|
|
128
|
+
| AuthenticationConfig | uses | PasswordPolicy | "Internal JWT Login" uses "Corporate Password Policy" |
|
|
129
|
+
| AuthenticationConfig | protects | SecureResource | "OAuth2 Google" protects "User API" |
|
|
130
|
+
| FieldAccessControl | requires | Permission | "SSN Field Read" requires "pii.read" |
|
|
131
|
+
| PolicyRule | uses | AccessCondition | "Owner Can Write" uses "Is Owner" |
|
|
132
|
+
| PolicyRule | triggers | PolicyAction | "Block After 5 Failures" triggers "Lock Account" |
|
|
133
|
+
| PolicyRule | authorizes | Permission | "Business Hours Only" authorizes "payments.approve" |
|
|
134
|
+
| Delegation | authorizes | Role | "Budget Approval Delegation" authorizes "Approver" |
|
|
135
|
+
| Delegation | requires | Actor | "Budget Approval Delegation" requires "CFO" (delegatee) |
|
|
136
|
+
| InformationRight | assigned-to | Actor | "Read Customer PII" assigned-to "Support Agent" |
|
|
137
|
+
| InformationRight | accesses | InformationEntity | "Read Customer PII" accesses "Customer PII" |
|
|
138
|
+
| NeedToKnow | protects | InformationEntity | "Support Needs Ticket Context" protects "Customer PII" |
|
|
139
|
+
| SeparationOfDuty | constrains | Role | "Approve Payment SoD" constrains "Payment Creator" |
|
|
140
|
+
| BindingOfDuty | governs | ResourceOperation | "Refund Same Handler" governs "Complete Refund" |
|
|
141
|
+
| DataClassification | governs | SecureResource | "Confidential" governs "Customer Record" |
|
|
142
|
+
| Threat | targets | SecureResource | "SQL Injection" targets "Orders Database" |
|
|
143
|
+
| Countermeasure | mitigates | Threat | "Parameterized Queries" mitigates "SQL Injection" |
|
|
144
|
+
| Countermeasure | protects | SecureResource | "WAF Rules" protects "Public API" |
|
|
145
|
+
| AuditConfig | monitors | SecureResource | "Admin Action Audit" monitors "User API" |
|
|
146
|
+
| AuditConfig | satisfies | AccountabilityRequirement | "Admin Action Audit" satisfies "Non-Repudiation Of Admin Ops" |
|
|
147
|
+
| AccountabilityRequirement | requires | Evidence | "Non-Repudiation Of Admin Ops" requires "Signed Audit Entry" |
|
|
148
|
+
| RetentionPolicy | governs | AuditConfig | "7-Year Audit Retention" governs "Admin Action Audit" |
|
|
140
149
|
|
|
141
150
|
---
|
|
142
151
|
|
|
@@ -144,31 +153,41 @@ SecurityModel
|
|
|
144
153
|
|
|
145
154
|
### Outgoing References (Security → Other Layers)
|
|
146
155
|
|
|
147
|
-
|
|
|
148
|
-
| ------------------------- |
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
-
|
|
156
|
+
| Source Type | Predicate | Target Type | Example |
|
|
157
|
+
| ------------------------- | ---------- | -------------------------- | --------------------------------------------------------------- |
|
|
158
|
+
| Countermeasure | satisfies | `motivation.requirement` | "Parameterized Queries" satisfies "Prevent Injection Attacks" |
|
|
159
|
+
| Countermeasure | realizes | `motivation.goal` | "Encrypt PII At Rest" realizes "Protect Customer Privacy" |
|
|
160
|
+
| SecurityPolicy | satisfies | `motivation.requirement` | "Data Access Policy" satisfies "GDPR Article 32" |
|
|
161
|
+
| SecurityPolicy | satisfies | `motivation.principle` | "Default Deny Policy" satisfies "Least Privilege" |
|
|
162
|
+
| SecurityConstraints | satisfies | `motivation.constraint` | "Payment Controls" satisfies "SOX Dual Control" |
|
|
163
|
+
| AccountabilityRequirement | satisfies | `motivation.requirement` | "Non-Repudiation Of Admin Ops" satisfies "Audit Trail Required" |
|
|
164
|
+
| Threat | references | `motivation.driver` | "Credential Stuffing" references "Account Takeover Risk" |
|
|
165
|
+
| Role | references | `business.businessrole` | "Admin" references "System Administrator" |
|
|
166
|
+
| SeparationOfDuty | constrains | `business.businessrole` | "Approve Payment SoD" constrains "Accounts Payable Clerk" |
|
|
167
|
+
| SecurityPolicy | governs | `business.businessprocess` | "Refund Approval Policy" governs "Process Refund" |
|
|
168
|
+
| SecurityPolicy | governs | `business.businessservice` | "PCI Policy" governs "Card Payments" |
|
|
169
|
+
| Countermeasure | protects | `business.businessprocess` | "Fraud Scoring" protects "Checkout" |
|
|
170
|
+
| SecureResource | references | `business.businessobject` | "Customer Record" references "Customer" |
|
|
171
|
+
| Threat | targets | `business.businessservice` | "Card Testing Attack" targets "Card Payments" |
|
|
172
|
+
|
|
173
|
+
### Incoming References (Other Layers → Security)
|
|
174
|
+
|
|
175
|
+
| Source Type | Predicate | Target Type | Example |
|
|
176
|
+
| ---------------------------------- | -------------- | -------------------- | ------------------------------------------------------- |
|
|
177
|
+
| `application.applicationinterface` | exposes | SecureResource | "User REST API" exposes "User API" resource |
|
|
178
|
+
| `application.applicationcomponent` | realizes | Countermeasure | "Fetch Interceptor" realizes "Bearer Token Injection" |
|
|
179
|
+
| `application.applicationservice` | requires | AuthenticationConfig | "Order API" requires "Internal JWT" |
|
|
180
|
+
| `application.applicationservice` | constrained-by | SecurityPolicy | "Patient Records Service" constrained-by "HIPAA Policy" |
|
|
181
|
+
| `api.operation` | requires | Permission | "GET /users" requires "users.read" |
|
|
182
|
+
| `api.securityscheme` | realizes | SecurityPolicy | "bearerAuth" realizes "API Authentication Policy" |
|
|
183
|
+
| `api.ratelimit` | realizes | Countermeasure | "100 req/min per key" realizes "Rate Limiting" |
|
|
184
|
+
| `business.businessprocess` | constrained-by | SeparationOfDuty | "Approve Payment" constrained-by "Approve Payment SoD" |
|
|
185
|
+
| `data-model.schemaproperty` | satisfies | FieldAccessControl | "Customer.ssn" satisfies "Mask SSN For Support" |
|
|
186
|
+
| `data-store.field` | references | DataClassification | "customers.ssn" references "Restricted" |
|
|
187
|
+
| `navigation.navigationguard` | requires | Role | "AdminGuard" requires "Admin" |
|
|
188
|
+
| `ux.view` | requires | Permission | "User Admin Screen" requires "users.write" |
|
|
189
|
+
| `apm.logconfiguration` | satisfies | AuditConfig | "Audit Log Pipeline" satisfies "Admin Action Audit" |
|
|
190
|
+
| `testing.testcasesketch` | tests | Threat | "Injection payloads on search" tests "SQL Injection" |
|
|
172
191
|
|
|
173
192
|
---
|
|
174
193
|
|
|
@@ -310,7 +329,7 @@ def get_user_by_email(email: str):
|
|
|
310
329
|
|
|
311
330
|
- Threat: "SQL Injection" (likelihood: high, impact: critical)
|
|
312
331
|
- Countermeasure: "Parameterized Queries"
|
|
313
|
-
-
|
|
332
|
+
- Countermeasure mitigates Threat
|
|
314
333
|
|
|
315
334
|
---
|
|
316
335
|
|
|
@@ -370,24 +389,19 @@ dr add security resource-operation "create-user" \
|
|
|
370
389
|
--description "Create new user operation"
|
|
371
390
|
```
|
|
372
391
|
|
|
373
|
-
### Step 4: Define Security Actors
|
|
392
|
+
### Step 4: Define Security Actors (STS-ml)
|
|
374
393
|
|
|
375
394
|
```bash
|
|
376
395
|
# Security actors
|
|
377
396
|
dr add security actor "support-agent" \
|
|
378
397
|
--description "Customer support team member"
|
|
379
398
|
|
|
380
|
-
#
|
|
381
|
-
dr add security
|
|
382
|
-
--
|
|
383
|
-
|
|
384
|
-
# Link objective to motivation layer
|
|
385
|
-
dr relationship add security.actor-objective.resolve-customer-issues \
|
|
386
|
-
motivation.goal.customer-satisfaction --predicate supports
|
|
399
|
+
# Assign the actor to a role and the authentication it must use
|
|
400
|
+
dr relationship add security.actor.support-agent \
|
|
401
|
+
security.role.user --predicate assigned-to
|
|
387
402
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
--description "Support agent requires customer data to resolve issues"
|
|
403
|
+
dr relationship add security.authenticationconfig.oauth2-google \
|
|
404
|
+
security.actor.support-agent --predicate authenticates
|
|
391
405
|
```
|
|
392
406
|
|
|
393
407
|
### Step 5: Define Information Entities and Rights
|
|
@@ -432,9 +446,12 @@ dr add security threat "sql-injection" \
|
|
|
432
446
|
dr add security countermeasure "parameterized-queries" \
|
|
433
447
|
--description "Use parameterized queries for all database operations"
|
|
434
448
|
|
|
435
|
-
# Link threat to
|
|
436
|
-
dr relationship add security.
|
|
437
|
-
|
|
449
|
+
# Link countermeasure to threat, and to the requirement it satisfies
|
|
450
|
+
dr relationship add security.countermeasure.parameterized-queries \
|
|
451
|
+
security.threat.sql-injection --predicate mitigates
|
|
452
|
+
|
|
453
|
+
dr relationship add security.countermeasure.parameterized-queries \
|
|
454
|
+
motivation.requirement.prevent-injection-attacks --predicate satisfies
|
|
438
455
|
```
|
|
439
456
|
|
|
440
457
|
### Step 8: Define Policies (ABAC)
|
|
@@ -456,17 +473,21 @@ dr add security access-condition "is-owner" \
|
|
|
456
473
|
### Step 9: Cross-Layer Integration
|
|
457
474
|
|
|
458
475
|
```bash
|
|
459
|
-
#
|
|
460
|
-
dr relationship add
|
|
461
|
-
|
|
476
|
+
# Application interface exposes the secure resource
|
|
477
|
+
dr relationship add application.applicationinterface.user-api-rest \
|
|
478
|
+
security.secureresource.user-api --predicate exposes
|
|
462
479
|
|
|
463
|
-
#
|
|
464
|
-
dr relationship add
|
|
465
|
-
|
|
480
|
+
# API operation requires a permission
|
|
481
|
+
dr relationship add api.operation.get-users \
|
|
482
|
+
security.permission.users-read --predicate requires
|
|
466
483
|
|
|
467
|
-
#
|
|
468
|
-
dr relationship add security.
|
|
469
|
-
|
|
484
|
+
# Security role references a business role
|
|
485
|
+
dr relationship add security.role.admin \
|
|
486
|
+
business.businessrole.system-administrator --predicate references
|
|
487
|
+
|
|
488
|
+
# Security policy satisfies a motivation requirement
|
|
489
|
+
dr relationship add security.securitypolicy.data-access-policy \
|
|
490
|
+
motivation.requirement.gdpr-article-32 --predicate satisfies
|
|
470
491
|
```
|
|
471
492
|
|
|
472
493
|
### Step 10: Validate
|
|
@@ -484,36 +505,37 @@ dr validate --relationships
|
|
|
484
505
|
|
|
485
506
|
```
|
|
486
507
|
Role: "Admin" (hierarchy: 1)
|
|
487
|
-
├──
|
|
488
|
-
│ ├──
|
|
489
|
-
│ │ └──
|
|
490
|
-
│ └──
|
|
491
|
-
|
|
492
|
-
└──
|
|
508
|
+
├── specializes → Role: "Manager" (hierarchy: 2)
|
|
509
|
+
│ ├── specializes → Role: "User" (hierarchy: 3)
|
|
510
|
+
│ │ └── specializes → Role: "Guest" (hierarchy: 4)
|
|
511
|
+
│ └── aggregates → Permission: "users.write"
|
|
512
|
+
└── aggregates → Permission: "admin.all"
|
|
513
|
+
└── authorizes → ResourceOperation: "delete-user"
|
|
493
514
|
```
|
|
494
515
|
|
|
495
516
|
### Pattern 2: Goal-Oriented Security (STS-ml)
|
|
496
517
|
|
|
497
518
|
```
|
|
498
519
|
Actor: "Data Analyst"
|
|
499
|
-
├──
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
520
|
+
├── assigned-to → Role: "Analyst"
|
|
521
|
+
└── ← assigned-to — InformationRight: "Read Sales Data"
|
|
522
|
+
└── governs → InformationEntity: "Sales Data"
|
|
523
|
+
├── constrained-by → DataClassification: "Internal"
|
|
524
|
+
└── ← protects — NeedToKnow: "Access sales data only for reporting"
|
|
525
|
+
Countermeasure: "Row-Level Security On Sales Data"
|
|
526
|
+
└── realizes → motivation.goal: "Data-Driven Decisions"
|
|
505
527
|
```
|
|
506
528
|
|
|
507
529
|
### Pattern 3: Delegation Chain
|
|
508
530
|
|
|
509
531
|
```
|
|
510
532
|
Actor: "CEO"
|
|
511
|
-
└──
|
|
512
|
-
├──
|
|
513
|
-
├──
|
|
514
|
-
├── retain-oversight: true
|
|
515
|
-
└──
|
|
516
|
-
├──
|
|
533
|
+
└── associated-with → Delegation: "Budget Approval"
|
|
534
|
+
├── requires → Actor: "CFO" (delegatee)
|
|
535
|
+
├── authorizes → Role: "Budget Approver"
|
|
536
|
+
├── type: "approval", retain-oversight: true
|
|
537
|
+
└── (CFO) associated-with → Delegation: "Department Budget"
|
|
538
|
+
├── requires → Actor: "Department Head" (delegatee)
|
|
517
539
|
└── retain-oversight: true
|
|
518
540
|
```
|
|
519
541
|
|
|
@@ -524,12 +546,10 @@ Threat: "Unauthorized API Access"
|
|
|
524
546
|
├── likelihood: "high"
|
|
525
547
|
├── impact: "critical"
|
|
526
548
|
├── category: "broken-authentication"
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
└── mitigated-by → Countermeasure: "API Key Rotation"
|
|
532
|
-
└── status: "planned"
|
|
549
|
+
├── aggregates → Countermeasure: "JWT Authentication" (status: implemented)
|
|
550
|
+
├── aggregates → Countermeasure: "Rate Limiting" (status: implemented)
|
|
551
|
+
└── aggregates → Countermeasure: "API Key Rotation" (status: planned)
|
|
552
|
+
(each Countermeasure also mitigates → Threat: "Unauthorized API Access")
|
|
533
553
|
```
|
|
534
554
|
|
|
535
555
|
---
|
|
@@ -540,7 +560,7 @@ The Security Layer integrates **STS-ml 2.0** (Socio-Technical Security Modeling
|
|
|
540
560
|
|
|
541
561
|
### 1. Goal-Oriented Security
|
|
542
562
|
|
|
543
|
-
- **
|
|
563
|
+
- **Countermeasures and policies** link to Motivation Layer goals, principles and requirements (`realizes`, `satisfies`)
|
|
544
564
|
- Security is justified by business goals
|
|
545
565
|
- Traceability: Why do we need this security control?
|
|
546
566
|
|
|
@@ -594,15 +614,15 @@ The Security Layer integrates **STS-ml 2.0** (Socio-Technical Security Modeling
|
|
|
594
614
|
|
|
595
615
|
## Validation Tips
|
|
596
616
|
|
|
597
|
-
| Issue | Cause | Fix
|
|
598
|
-
| ---------------------------- | ---------------------------------------------- |
|
|
599
|
-
| Orphaned Actor | Actor
|
|
600
|
-
| Unmapped Threat | Threat has no countermeasures | Add countermeasures or accept risk
|
|
601
|
-
| Unused Permission | Permission not assigned to roles or operations | Assign to roles or remove
|
|
602
|
-
| Missing Field-Level Security | Sensitive data lacks FieldAccessControl | Add field-level access rules
|
|
603
|
-
| Unlinked
|
|
604
|
-
| No Evidence | AccountabilityRequirement lacks evidence | Define required evidence types
|
|
605
|
-
| Incomplete Delegation | Delegation chain missing delegatee | Complete delegation or remove
|
|
617
|
+
| Issue | Cause | Fix |
|
|
618
|
+
| ---------------------------- | ---------------------------------------------- | ---------------------------------- |
|
|
619
|
+
| Orphaned Actor | Actor not assigned to any role | Assign to a Role or remove actor |
|
|
620
|
+
| Unmapped Threat | Threat has no countermeasures | Add countermeasures or accept risk |
|
|
621
|
+
| Unused Permission | Permission not assigned to roles or operations | Assign to roles or remove |
|
|
622
|
+
| Missing Field-Level Security | Sensitive data lacks FieldAccessControl | Add field-level access rules |
|
|
623
|
+
| Unlinked Countermeasure | Countermeasure doesn't satisfy a requirement | Add cross-layer link |
|
|
624
|
+
| No Evidence | AccountabilityRequirement lacks evidence | Define required evidence types |
|
|
625
|
+
| Incomplete Delegation | Delegation chain missing delegatee | Complete delegation or remove |
|
|
606
626
|
|
|
607
627
|
---
|
|
608
628
|
|
|
@@ -617,7 +637,6 @@ dr add security role <name> --description <description>
|
|
|
617
637
|
dr add security permission <name> --description <description>
|
|
618
638
|
dr add security secure-resource <name> --description <description>
|
|
619
639
|
dr add security actor <name> --description <description>
|
|
620
|
-
dr add security actor-objective <name> --description <description>
|
|
621
640
|
dr add security information-entity <name> --description <description>
|
|
622
641
|
dr add security threat <name> --description <description>
|
|
623
642
|
dr add security countermeasure <name> --description <description>
|
|
@@ -627,16 +646,17 @@ dr add security delegation <name> --description <description>
|
|
|
627
646
|
**Relationship Commands:**
|
|
628
647
|
|
|
629
648
|
```bash
|
|
630
|
-
dr relationship add <actor> <
|
|
631
|
-
dr relationship add <
|
|
632
|
-
dr relationship add <
|
|
633
|
-
dr relationship add <
|
|
649
|
+
dr relationship add <actor> <role> --predicate assigned-to
|
|
650
|
+
dr relationship add <role> <permission> --predicate aggregates
|
|
651
|
+
dr relationship add <permission> <resource-operation> --predicate authorizes
|
|
652
|
+
dr relationship add <countermeasure> <threat> --predicate mitigates
|
|
634
653
|
```
|
|
635
654
|
|
|
636
655
|
**Cross-Layer Commands:**
|
|
637
656
|
|
|
638
657
|
```bash
|
|
639
|
-
dr relationship add <
|
|
640
|
-
dr relationship add <
|
|
641
|
-
dr relationship add <
|
|
658
|
+
dr relationship add <countermeasure> <motivation-requirement> --predicate satisfies
|
|
659
|
+
dr relationship add <security-role> <business-role> --predicate maps-to
|
|
660
|
+
dr relationship add <application-interface> <secure-resource> --predicate exposes
|
|
661
|
+
dr relationship add <api-operation> <permission> --predicate requires
|
|
642
662
|
```
|