@radicaltools/cli 0.3.0 → 0.3.2

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.
Files changed (57) hide show
  1. package/README.md +332 -44
  2. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  3. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  4. package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
  5. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  6. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  7. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  8. package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
  9. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  10. package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
  11. package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
  12. package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
  13. package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
  14. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
  15. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  16. package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
  17. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  18. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  19. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  20. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  21. package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
  22. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  23. package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
  24. package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
  25. package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
  26. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  27. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  28. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  29. package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
  30. package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
  31. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  32. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  33. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
  34. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  35. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
  36. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
  37. package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
  38. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
  39. package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
  40. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  41. package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
  42. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  43. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
  44. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  45. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  46. package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
  47. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  48. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  49. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  50. package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
  51. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  52. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  53. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
  54. package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
  55. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  56. package/dist/index.js +10608 -6579
  57. package/package.json +1 -1
@@ -19,7 +19,7 @@
19
19
  "trigger": "LIST RELATIONS WHERE (source.type = \"person\" OR source.external = true) AND target.external != true AND (target.type = \"system\" OR target.type = \"container\" OR target.type = \"webapp\" OR target.type = \"component\")",
20
20
  "applyTo": "target",
21
21
  "why": "people or other systems use these elements, so what each of them may see and do has to be decided.",
22
- "group": "identity"
22
+ "group": "security"
23
23
  },
24
24
  "sources": [
25
25
  {
@@ -38,9 +38,21 @@
38
38
  "title": "NIST Role Based Access Control (RBAC) project and standard",
39
39
  "url": "https://csrc.nist.gov/projects/role-based-access-control"
40
40
  },
41
+ {
42
+ "title": "NIST SP 800-162, Guide to Attribute Based Access Control (ABAC) Definition and Considerations",
43
+ "url": "https://csrc.nist.gov/pubs/sp/800/162/upd2/final"
44
+ },
45
+ {
46
+ "title": "NIST SP 800-53 Rev. 5, Security and Privacy Controls (AC-2, AC-6, AU-9)",
47
+ "url": "https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final"
48
+ },
41
49
  {
42
50
  "title": "Open Policy Agent documentation",
43
51
  "url": "https://www.openpolicyagent.org/docs/latest/"
52
+ },
53
+ {
54
+ "title": "Google Zanzibar: Consistent, Global Authorization System (2019)",
55
+ "url": "https://research.google/pubs/zanzibar-googles-consistent-global-authorization-system/"
44
56
  }
45
57
  ],
46
58
  "templateParams": [
@@ -68,8 +80,8 @@
68
80
  },
69
81
  {
70
82
  "value": "flat",
71
- "label": "everyone may do everything",
72
- "description": "Every signed-in caller may do everything. Pick it only while nothing the element offers is meant for some callers only, such as an internal tool for one small team."
83
+ "label": "one level of access for every caller",
84
+ "description": "Every signed-in caller may do everything. Pick it only while nothing the element offers is meant for some callers only, such as an internal tool for one small team; the next two questions are then moot."
73
85
  }
74
86
  ]
75
87
  },
@@ -77,7 +89,7 @@
77
89
  "key": "ENFORCE",
78
90
  "title": "Decision point",
79
91
  "label": "Where are permissions decided?",
80
- "hint": "Checks spread through handlers drift apart; a policy decision point keeps them in one place at the price of a dependency on the request path.",
92
+ "hint": "Checks spread through handlers drift apart; a policy decision point keeps them in one place at the price of a dependency on the request path. Only when permissions are given (not with one level of access for every caller).",
81
93
  "defaultValue": "code",
82
94
  "options": [
83
95
  {
@@ -120,7 +132,7 @@
120
132
  "key": "REVIEW",
121
133
  "title": "Taking back",
122
134
  "label": "How are permissions taken back?",
123
- "hint": "People change jobs and keep what they had; without a mechanism to take permissions back, every account ends up with more than it needs.",
135
+ "hint": "People change jobs and keep what they had; without a mechanism to take permissions back, every account ends up with more than it needs. Only when permissions are given (not with one level of access for every caller).",
124
136
  "defaultValue": "periodic",
125
137
  "options": [
126
138
  {
@@ -137,13 +149,13 @@
137
149
  },
138
150
  {
139
151
  "key": "REVIEW_DAYS",
140
- "label": "How often are grants reviewed (days)?",
152
+ "label": "How often are grants reviewed (days)? (periodic reviews only)",
141
153
  "defaultValue": "90",
142
154
  "type": "number"
143
155
  },
144
156
  {
145
157
  "key": "ELEVATION_HOURS",
146
- "label": "How long may an elevation last (hours)?",
158
+ "label": "How long may an elevation last (hours)? (just-in-time elevation only)",
147
159
  "defaultValue": "4",
148
160
  "type": "number"
149
161
  }
@@ -158,7 +170,7 @@
158
170
  "y": 0,
159
171
  "kind": "brief",
160
172
  "source": "Hub concern pack: Authorization",
161
- "description": "People with different jobs, and other systems, use the same element. Each may see and change only what their role, their relation to the record or the policy allows: a check missing at one operation, a check only in the interface, a record fetched by an id the caller should not know, or a list that shows what the detail would refuse each lets data out. Administrators and support need more than everyone else without holding it all the time, and permissions must be taken back when people change jobs or leave."
173
+ "description": "People with different jobs, and other systems, use the same element. Each may see and change only what their role, their relation to the record or the policy allows: a check missing at one operation, a check only in the interface, a record fetched by an id the caller should not know, or a list that shows what the detail would refuse each lets data out. Administrators and support need more than everyone else without holding it all the time, and permissions must be taken back when people change jobs or leave. The snippets assume the application under src/ (src/app exports the router's table, src/authz the permission code) and the tests under tests/ with their fixtures in tests/authz."
162
174
  },
163
175
  {
164
176
  "id": "req-deny",
@@ -404,9 +416,8 @@
404
416
  "label": "Few named administrators",
405
417
  "x": 260,
406
418
  "y": 1690,
407
- "ears_type": "state-driven",
408
- "precondition": "an account holds administrator rights",
409
- "action": "require phishing-resistant MFA for it, keep at most 5 such accounts, each tied to a named person, and confirm the list every 30 days",
419
+ "ears_type": "ubiquitous",
420
+ "action": "keep at most 5 administrator accounts, each tied to a named person and signing in with phishing-resistant MFA, and confirm the list every 30 days",
410
421
  "rationale": "With standing rights the number of holders and the strength of their sign-in are the only controls left (NIST SP 800-63B AAL3, ASVS V4.3.1).",
411
422
  "hubWhen": {
412
423
  "ADMIN": [
@@ -421,7 +432,7 @@
421
432
  "x": 260,
422
433
  "y": 1820,
423
434
  "ears_type": "ubiquitous",
424
- "action": "record every action taken with administrator rights with the person, the time, the target and the ticket or reason, in a log the administrators cannot change, and keep it for at least 12 months",
435
+ "action": "record every action taken with administrator rights with the person, the time, the target and the ticket or reason, in the audit trail, which the administrators cannot change and whose store and retention the Audit trail pack decides",
425
436
  "rationale": "Privileged actions are the ones that most need a trail an administrator cannot edit afterwards (ASVS V7.1, V4.3; NIST SP 800-53 AU-9).",
426
437
  "hubWhen": {
427
438
  "ADMIN": [
@@ -468,7 +479,7 @@
468
479
  "y": 0,
469
480
  "given": "a caller without the permission to delete orders",
470
481
  "when": "it calls the delete operation directly, without the interface",
471
- "then": "the call is refused with 403, the order stays, and the refusal is in the log",
482
+ "then": "the call is refused with 403, the order stays, and the refusal is in the audit trail",
472
483
  "hubWhen": {
473
484
  "MODEL": [
474
485
  "roles",
@@ -708,8 +719,8 @@
708
719
  "x": 520,
709
720
  "y": 1820,
710
721
  "given": "an administrator",
711
- "when": "they change a customer's data and then try to delete the log entry",
712
- "then": "the action is in the log with person, time, target and reason, and the deletion is refused",
722
+ "when": "they change a customer's data and then try to delete its audit record",
723
+ "then": "the action is in the audit trail with person, time, target and reason, and the deletion is refused",
713
724
  "hubWhen": {
714
725
  "ADMIN": [
715
726
  "jit",
@@ -757,9 +768,9 @@
757
768
  "status": "accepted",
758
769
  "date": "",
759
770
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
760
- "decision": "Users get roles and roles get permissions (NIST core RBAC with static separation of duty), kept in one permission matrix: operation × role, versioned with the code. Every operation checks its permission on the server, on the record it touches as well as its type; anything without a rule is refused. Permissions are decided {{ENFORCE}}; they are taken back through {{REVIEW}}. Keep the roles under about 20: when an exception would become a role, it is a sign that relationships or attributes are needed. Use the framework's role mechanism (Spring Security, ASP.NET Core policies, Pundit, CASL) rather than checks of our own.",
771
+ "decision": "Users get roles and roles get permissions (NIST core RBAC with static separation of duty), kept in one permission matrix: operation × role, versioned with the code. Every operation checks its permission on the server, on the record it touches as well as its type; anything without a rule is refused. Permissions are decided {{ENFORCE}}; they are taken back through {{REVIEW}}. Keep the roles under about 20: when an exception would become a role, it is a sign that relationships or attributes are needed. Production access: {{ADMIN}}.",
761
772
  "consequences": "• One matrix to read, review and test: a test can call every operation as every role.\n• Rules that depend on the record (only the owner may edit) do not fit roles and need an explicit check per operation.\n• Role explosion when every exception becomes a role.\n• Separation of duties can be checked when roles are granted.",
762
- "alternatives": "1. Relationships (ReBAC): expresses ownership and sharing, harder to review as a whole.\n2. Attribute policies (ABAC): precise, but the attributes have to be kept fresh.\n3. Everyone may do everything: only right while nothing is meant for some users.",
773
+ "alternatives": "1. Relationships (ReBAC): expresses ownership and sharing, harder to review as a whole.\n2. Attribute policies (ABAC): precise, but the attributes have to be kept fresh.\n3. One level of access for every caller: only right while nothing is meant for some users.",
763
774
  "hubWhen": {
764
775
  "MODEL": [
765
776
  "roles"
@@ -776,7 +787,7 @@
776
787
  "status": "accepted",
777
788
  "date": "",
778
789
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
779
- "decision": "Access follows from relationships between callers and records (owner, editor, viewer, member of the team or parent folder), modelled as a Zanzibar-style authorization model: object types, relations and the rules that derive one relation from another. Permissions are decided {{ENFORCE}}: with a policy engine, OpenFGA (CNCF, simple to run) or SpiceDB (stronger consistency options, Postgres or Spanner backends) holds the relationship tuples, chosen by the consistency and scale needed; in code, a relationship table queried by one authorization module. Every check names the record; lists ask for the records the caller may see (ListObjects or a filtered query). Permissions are taken back through {{REVIEW}}.",
790
+ "decision": "Access follows from relationships between callers and records (owner, editor, viewer, member of the team or parent folder), modelled as a Zanzibar-style authorization model: object types, relations and the rules that derive one relation from another. Permissions are decided {{ENFORCE}}: with a policy engine, OpenFGA (CNCF, simple to run) or SpiceDB (stronger consistency options, Postgres or Spanner backends) holds the relationship tuples, chosen by the consistency and scale needed; in code, a relationship table queried by one authorization module. Every check names the record; lists ask for the records the caller may see (ListObjects or a filtered query). A removed relationship takes effect within 10 seconds, and a caller's own change is never evaluated against an older snapshot (a consistency token from the write is passed to the check). Permissions are taken back through {{REVIEW}}. Production access: {{ADMIN}}.",
780
791
  "consequences": "• Sharing, ownership and nested folders or teams are expressed directly, without a role per case.\n• Relationship tuples are a second source of truth beside the domain data and must be written in the same change as it (outbox or transactional write).\n• Lists of what a caller may see are expensive on large graphs and need their own design.\n• A stale read can grant just-removed access: consistency tokens are needed.",
781
792
  "alternatives": "1. Roles (RBAC): simpler to review, cannot express \"shared with me\".\n2. Attribute policies (ABAC): good for rules over data, awkward for sharing and nesting.\n3. Access control lists per record: simple, but hard to change for a whole team or folder.",
782
793
  "hubWhen": {
@@ -795,9 +806,9 @@
795
806
  "status": "accepted",
796
807
  "date": "",
797
808
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
798
- "decision": "Permissions are policies over attributes of the caller (department, region, clearance), the record (owner, classification, region) and the request (time, network, assurance level), written as policy as code. Permissions are decided {{ENFORCE}}: with a policy engine, Open Policy Agent (Rego, general purpose, sidecar or library) or Cedar with Amazon Verified Permissions (typed, analysable policies, managed on AWS), chosen by the platform and whether policies must be provably analysable; in code, Casbin or CASL. Attributes come from named sources with a freshness limit, and a missing or stale attribute denies. Permissions are taken back through {{REVIEW}}.",
809
+ "decision": "Permissions are policies over attributes of the caller (department, region, clearance), the record (owner, classification, region) and the request (time, network, assurance level), written as policy as code. Permissions are decided {{ENFORCE}}: with a policy engine, Open Policy Agent (Rego, general purpose, sidecar or library) or Cedar with Amazon Verified Permissions (typed, analysable policies, managed on AWS), chosen by the platform and whether policies must be provably analysable; in code, Casbin or CASL. Attributes come from named sources with a freshness limit of 15 minutes, and a missing or stale attribute denies. Permissions are taken back through {{REVIEW}}. Production access: {{ADMIN}}.",
799
810
  "consequences": "• Rules such as \"own region, working hours only\" are written once, not as roles per region.\n• Every attribute is an input to keep correct and fresh: a wrong department is a wrong decision.\n• Policies are code: they need tests and review of their own.\n• Who may see what is harder to answer for an auditor than with a role matrix.",
800
- "alternatives": "1. Roles (RBAC): easy to review, but a role per region or classification explodes.\n2. Relationships (ReBAC): better for sharing, weaker for rules over data.\n3. Everyone may do everything: only right while nothing is meant for some users.",
811
+ "alternatives": "1. Roles (RBAC): easy to review, but a role per region or classification explodes.\n2. Relationships (ReBAC): better for sharing, weaker for rules over data.\n3. One level of access for every caller: only right while nothing is meant for some users.",
801
812
  "hubWhen": {
802
813
  "MODEL": [
803
814
  "attributes"
@@ -814,7 +825,7 @@
814
825
  "status": "accepted",
815
826
  "date": "",
816
827
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had. Here nobody needs more than anyone else: the element offers the same to every signed-in caller.",
817
- "decision": "Every signed-in caller may do everything the element offers; there are no roles or permissions in the application. Anything meant for some callers only stays out of it until this decision is superseded. Production access: {{ADMIN}}.",
828
+ "decision": "Every signed-in caller may do everything the element offers; there are no roles or permissions in the application, so no decision point and no review of grants are needed. Anything meant for some callers only stays out of it until this decision is superseded. Production access: {{ADMIN}}.",
818
829
  "consequences": "• Nothing to manage, test or review in the application.\n• The first feature for some callers only needs this decision superseded first.\n• Who signs in is the only boundary: authentication carries all the weight.",
819
830
  "alternatives": "1. Roles, added when the first restricted feature comes.\n2. Two roles (user, administrator) from the start: little cost now, but an untested boundary until something needs it.",
820
831
  "hubWhen": {
@@ -833,7 +844,7 @@
833
844
  "status": "accepted",
834
845
  "date": "",
835
846
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
836
- "decision": "Each service decides permissions in one authorization module, called from one place in the request pipeline (middleware, filter or policy attribute), never from scattered checks in handlers. Use the framework's mechanism: Spring Security method security, ASP.NET Core authorization policies, Pundit or Action Policy (Rails), CASL or Casbin (Node). A static rule fails the build for any route that does not go through the module.",
847
+ "decision": "Each service decides permissions in one authorization module, called from one place in the request pipeline (middleware, filter or policy attribute), never from scattered checks in handlers. Use the framework's mechanism: Spring Security method security, ASP.NET Core authorization policies, Pundit or Action Policy (Rails), CASL or Casbin (Node). A static rule fails the build for any route that does not go through the module: Semgrep for Express-style routers, ArchUnit for Spring (every request mapping annotated with PreAuthorize), a Roslyn analyzer for ASP.NET Core, a RuboCop cop for Rails.",
837
848
  "consequences": "• No extra service on the request path; decisions take microseconds.\n• Rules change and ship with the code that needs them.\n• Each service has its own module: with more services or languages, the rules drift apart.\n• Security cannot change a rule without a release of the service.",
838
849
  "alternatives": "1. A central policy engine (OPA, Cedar, OpenFGA): one place for every service, but a dependency on every request.\n2. Checks only at the API gateway: coarse, cannot see the record, and every internal call bypasses them.",
839
850
  "hubWhen": {
@@ -857,7 +868,7 @@
857
868
  "status": "accepted",
858
869
  "date": "",
859
870
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
860
- "decision": "A policy decision point outside the service code answers every permission check; services only enforce its answer (PEP/PDP). Choose by the model: Open Policy Agent for roles and attribute rules across many services and languages (sidecar or embedded, Rego); Cedar with Amazon Verified Permissions for typed, analysable policies on AWS; OpenFGA or SpiceDB for relationships. The decision point runs next to the services (sidecar or same host) so a check stays under 10 ms at p99; when it does not answer within 50 ms the request is refused. Policies live in their own repository, are tested in CI and released as versioned bundles; every decision is logged with the policy version.",
871
+ "decision": "A policy decision point outside the service code answers every permission check; services only enforce its answer (PEP/PDP). Choose by the model: Open Policy Agent for roles and attribute rules across many services and languages (sidecar or embedded, Rego); Cedar with Amazon Verified Permissions for typed, analysable policies on AWS; OpenFGA or SpiceDB for relationships. The decision point runs next to the services (sidecar or same host) so a check stays under 10 ms at p99; when it does not answer within 50 ms the request is refused. Policies live in their own repository, are tested in CI and released as versioned bundles that reach every decision point within 5 minutes; every decision is logged with the policy version.",
861
872
  "consequences": "• One place for every service's rules, in one language, reviewable by security.\n• The decision point is on every request path: it needs the same availability as the services, and an outage refuses requests.\n• Policies need data (roles, relationships, attributes) pushed to or fetched by the engine.\n• Decision logs answer \"why was this allowed\" after an incident.",
862
873
  "alternatives": "1. Authorization in the service code: no extra dependency, but rules drift apart across services.\n2. Checks only at the API gateway: coarse, cannot see the record.\n3. A managed authorization service (Auth0 FGA, Permit.io): less to run, more to pay per check and a vendor on the request path.",
863
874
  "hubWhen": {
@@ -871,17 +882,65 @@
871
882
  ]
872
883
  }
873
884
  },
885
+ {
886
+ "id": "adr-review-periodic",
887
+ "type": "adr",
888
+ "label": "Grants taken back by periodic reviews",
889
+ "x": 780,
890
+ "y": 780,
891
+ "concern": "authorization",
892
+ "status": "accepted",
893
+ "date": "",
894
+ "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
895
+ "decision": "Every grant has an owner who confirms it every {{REVIEW_DAYS}} days; a grant not confirmed within 14 days of the review is removed. Leavers reported by HR lose every grant within 24 hours, movers within 5 working days. The grants table keeps the owner and the last review date, and a daily job lists what is overdue and opens a ticket for the owner.",
896
+ "consequences": "• Works with grants given by hand in the application and with any identity provider.\n• Owner time every cycle: the number of grants to confirm grows with the number of users and permissions, so the cadence is a cost.\n• Between reviews a leaver keeps access unless HR reports them: the leaver process is the real control.",
897
+ "alternatives": "1. Directory sync: no reviews to run, but every user must be in a directory that HR keeps right.\n2. No reviews: the cheapest, until the audit asks who may do what and why.",
898
+ "hubWhen": {
899
+ "MODEL": [
900
+ "roles",
901
+ "relations",
902
+ "attributes"
903
+ ],
904
+ "REVIEW": [
905
+ "periodic"
906
+ ]
907
+ }
908
+ },
909
+ {
910
+ "id": "adr-review-directory",
911
+ "type": "adr",
912
+ "label": "Grants follow the directory",
913
+ "x": 780,
914
+ "y": 910,
915
+ "concern": "authorization",
916
+ "status": "accepted",
917
+ "date": "",
918
+ "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
919
+ "decision": "Permissions are derived only from groups in the identity provider, delivered by SCIM provisioning or group claims; nothing is granted by hand in the application. A change in the directory reaches the permissions within 60 minutes, and a disabled account loses every permission in the same time. An hourly job compares the grants with the directory and fails on any grant without a group behind it.",
920
+ "consequences": "• Joiners, movers and leavers follow the HR system without a review cycle.\n• Every user must be in the directory: contractors and partners need an account there too.\n• The group model in the directory becomes the permission model, owned together with IT.",
921
+ "alternatives": "1. Periodic reviews: no directory needed, owner time every cycle.\n2. Both: directory groups for the standard permissions, reviews for the exceptions granted by hand.",
922
+ "hubWhen": {
923
+ "MODEL": [
924
+ "roles",
925
+ "relations",
926
+ "attributes"
927
+ ],
928
+ "REVIEW": [
929
+ "directory"
930
+ ]
931
+ }
932
+ },
874
933
  {
875
934
  "id": "adr-jit",
876
935
  "type": "adr",
877
936
  "label": "Just-in-time privileged access",
878
937
  "x": 780,
879
- "y": 780,
938
+ "y": 1040,
880
939
  "concern": "authorization",
881
940
  "status": "accepted",
882
941
  "date": "",
883
942
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
884
- "decision": "Nobody holds standing administrator rights in production. Operators request elevation with a ticket reference; a second person approves it; it expires after at most {{ELEVATION_HOURS}} hours. Use the platform's mechanism: Microsoft Entra Privileged Identity Management, AWS IAM Identity Center with temporary elevated access, Google Cloud Privileged Access Manager, or Teleport or HashiCorp Boundary for hosts and databases, chosen by where the infrastructure runs. One sealed break-glass account per environment, its credential split or in a safe, alerts on use and is rotated after it.",
943
+ "decision": "Nobody holds standing administrator rights in production. Operators request elevation with a ticket reference; a second person approves it; it expires after at most {{ELEVATION_HOURS}} hours. Use the platform's mechanism: Microsoft Entra Privileged Identity Management, AWS IAM Identity Center with temporary elevated access, Google Cloud Privileged Access Manager, or Teleport or HashiCorp Boundary for hosts and databases, chosen by where the infrastructure runs. One sealed break-glass account per environment, its credential split or in a safe, alerts on use and is rotated after it. Every privileged action is recorded in the audit trail, which the administrators cannot change; its store, tamper evidence and retention are decided in the Audit trail pack. Actions on the cloud's control plane reach it through the provider's own log (a CloudTrail trail with log file validation, or the Azure Activity Log) delivered to storage the administrators cannot change, kept for the audit trail's retention and never under 365 days.",
885
944
  "consequences": "• A phished operator account gives nothing in production by itself.\n• Emergencies need an approver awake, or the break-glass path.\n• Every elevation leaves a record of who, why and for how long.\n• The elevation tool is itself a critical system to protect.",
886
945
  "alternatives": "1. Named standing administrators: simpler, but the rights are there for whoever takes the account.\n2. No direct access at all: the strongest, but every support need must be built into the product first.",
887
946
  "hubWhen": {
@@ -895,12 +954,12 @@
895
954
  "type": "adr",
896
955
  "label": "Named standing administrators",
897
956
  "x": 780,
898
- "y": 910,
957
+ "y": 1170,
899
958
  "concern": "authorization",
900
959
  "status": "accepted",
901
960
  "date": "",
902
961
  "context": "People and other systems use this element with different rights. The forces: most access-control flaws are not broken sign-ins but a check missing at one operation, or a check on the type of record and not on the record itself (OWASP API1:2023, broken object level authorization); anything the interface hides can still be called; checks scattered through the code drift apart, while a central policy adds a dependency on the request path; administrators and support staff need more than everyone else, and standing privileges are what attackers look for; and permissions accumulate as people change jobs and keep what they had.",
903
- "decision": "At most 5 named people hold administrator rights in production all the time; each signs in with phishing-resistant MFA (FIDO2 security key or platform passkey), and the list is confirmed every 30 days. Every privileged action is written to an append-only audit log the administrators cannot change (CloudTrail with S3 Object Lock, Azure Activity Log to an immutable storage account, or the SIEM). Revisit when the team grows past 10 people or the data becomes regulated: just-in-time elevation is then the next step.",
962
+ "decision": "At most 5 named people hold administrator rights in production all the time; each signs in with phishing-resistant MFA (FIDO2 security key or platform passkey), and the list is confirmed every 30 days. Every privileged action is recorded in the audit trail, which the administrators cannot change; its store, tamper evidence and retention are decided in the Audit trail pack. Actions on the cloud's control plane reach it through the provider's own log (a CloudTrail trail with log file validation, or the Azure Activity Log) delivered to storage the administrators cannot change, kept for the audit trail's retention and never under 365 days. Revisit when the team grows past 10 people or the data becomes regulated: just-in-time elevation is then the next step.",
904
963
  "consequences": "• No approval waits: administrators can act at once.\n• A stolen administrator session is a full compromise until it is noticed.\n• The audit log is the main control, so someone has to read it.",
905
964
  "alternatives": "1. Just-in-time elevation with approval: smaller window, needs an approver available.\n2. No direct access: support only through the product.",
906
965
  "hubWhen": {
@@ -914,7 +973,7 @@
914
973
  "type": "adr",
915
974
  "label": "No direct production access",
916
975
  "x": 780,
917
- "y": 1040,
976
+ "y": 1300,
918
977
  "concern": "authorization",
919
978
  "status": "accepted",
920
979
  "date": "",
@@ -934,9 +993,12 @@
934
993
  "label": "Permission matrix enforced",
935
994
  "x": 1040,
936
995
  "y": 0,
937
- "category": "structural",
938
- "threshold": "Every operation called as every role or rule case gives the expected answer, and with another user's record ids returns 403 or 404; 0 mismatches",
939
- "description": "A test lists the operations from the router (not from a list kept by hand), calls each as a caller of every role or rule case, and compares allowed or refused with the expected matrix; it also calls each operation that takes an id with the id of a record of another user. An operation without an entry fails the test.\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app, routes } from '../src/app' // routes: the router's table\nimport { EXPECTED } from './authz/expected' // \"METHOD path\" -> roles allowed\nimport { CASES, tokenFor, otherUsersRecord } from './authz/fixtures'\n\ndescribe.each(routes)('$method $path', (route) => {\n it.each(CASES)('as %s gives the expected answer', async (who) => {\n const res = await request(app)[route.method.toLowerCase()](route.example)\n .set('Authorization', `Bearer ${await tokenFor(who)}`)\n const allowed = EXPECTED[`${route.method} ${route.path}`]?.includes(who) ?? false\n expect([403, 404].includes(res.status)).toBe(!allowed)\n })\n it.runIf(route.path.includes(':id'))('refuses another user\\'s record', async () => {\n const res = await request(app)[route.method.toLowerCase()](route.path.replace(':id', await otherUsersRecord()))\n .set('Authorization', `Bearer ${await tokenFor('owner')}`)\n expect([403, 404]).toContain(res.status)\n })\n})\n```",
996
+ "characteristic": "security",
997
+ "scope": "atomic",
998
+ "cadence": "triggered",
999
+ "trigger": "pull-request",
1000
+ "invocation": "automated",
1001
+ "description": "A test lists the operations from the router (not from a list kept by hand), fails on any operation the expected matrix does not name, calls each as a caller of every role or rule case, and compares allowed or refused with the matrix; it also calls each operation that takes an id with the id of a record of another user, and checks that a refusal left a log entry with caller, operation and record.\n\nThreshold: Every operation called as every role or rule case gives the expected answer, and with another user's record ids returns 403 or 404; 0 mismatches and 0 operations without an entry in the expected matrix\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack: JUnit with MockMvc, xUnit with WebApplicationFactory, RSpec request specs)\n\n```ts\nimport request from 'supertest'\nimport { app, routes } from '../src/app' // routes: the router's table\nimport { EXPECTED } from './authz/expected' // \"METHOD path\" -> roles allowed\nimport { CASES, tokenFor, otherUsersRecord, refusalsLogged } from './authz/fixtures'\n\ndescribe.each(routes)('$method $path', (route) => {\n const key = `${route.method} ${route.path}`\n it('is in the expected matrix', () => {\n expect(EXPECTED).toHaveProperty(key)\n })\n it.each(CASES)('as %s gives the expected answer', async (who) => {\n const res = await request(app)[route.method.toLowerCase()](route.example)\n .set('Authorization', `Bearer ${await tokenFor(who)}`)\n const allowed = EXPECTED[key]?.includes(who) ?? false\n expect([403, 404].includes(res.status)).toBe(!allowed)\n if (!allowed) expect(await refusalsLogged({ caller: who, operation: key })).toBeGreaterThan(0)\n })\n it.runIf(route.path.includes(':id'))('refuses another user\\'s record', async () => {\n const res = await request(app)[route.method.toLowerCase()](route.path.replace(':id', await otherUsersRecord()))\n .set('Authorization', `Bearer ${await tokenFor('owner')}`)\n expect([403, 404]).toContain(res.status)\n })\n})\n```",
940
1002
  "hubWhen": {
941
1003
  "MODEL": [
942
1004
  "roles",
@@ -951,9 +1013,12 @@
951
1013
  "label": "Every route guarded",
952
1014
  "x": 1040,
953
1015
  "y": 130,
954
- "category": "structural",
955
- "threshold": "0 routes registered without the authorize middleware",
956
- "description": "A static rule runs on every pull request and fails on a route registered without going through the authorization module, so a check cannot be forgotten in a handler.\n\nTool: Semgrep\n\n```yaml\nrules:\n - id: route-without-authorize\n languages: [typescript]\n severity: ERROR\n message: Every route goes through authorize(); ADR \"Permissions decided in code\"\n patterns:\n - pattern: $ROUTER.$METHOD($PATH, ...)\n - metavariable-regex:\n metavariable: $METHOD\n regex: ^(get|post|put|patch|delete)$\n - pattern-not: $ROUTER.$METHOD($PATH, ..., authorize(...), ...)\n```",
1016
+ "characteristic": "security",
1017
+ "scope": "atomic",
1018
+ "cadence": "triggered",
1019
+ "trigger": "pull-request",
1020
+ "invocation": "automated",
1021
+ "description": "A static rule runs on every pull request and fails on a route registered without going through the authorization module, so a check cannot be forgotten in a handler. The rule below is the Express-style form ($ROUTER limited to app, router and *Router, so map.get or axios.get do not match); routes mounted with router.use are checked where they are defined.\n\nThreshold: 0 routes registered without the authorize middleware\n\nTool: Semgrep (Express-style routers); for Spring: ArchUnit methods().that().areAnnotatedWith(RequestMapping.class).should().beAnnotatedWith(PreAuthorize.class); for ASP.NET Core: a Roslyn analyzer over [Authorize]; for Rails: a RuboCop cop over verify_authorized\n\n```yaml\nrules:\n - id: route-without-authorize\n languages: [typescript, javascript]\n severity: ERROR\n message: Every route goes through authorize(); ADR \"Permissions decided in code\"\n patterns:\n - pattern-either:\n - pattern: $ROUTER.$METHOD($PATH, ...)\n - pattern: $ROUTER.route($PATH).$METHOD(...)\n - metavariable-regex:\n metavariable: $ROUTER\n regex: ^(app|router|[A-Za-z]+Router)$\n - metavariable-regex:\n metavariable: $METHOD\n regex: ^(get|post|put|patch|delete|all)$\n - pattern-not: $ROUTER.$METHOD($PATH, ..., authorize(...), ...)\n - pattern-not: $ROUTER.route($PATH).$METHOD(..., authorize(...), ...)\n```",
957
1022
  "hubWhen": {
958
1023
  "MODEL": [
959
1024
  "roles",
@@ -971,12 +1036,38 @@
971
1036
  "label": "Policies tested",
972
1037
  "x": 1040,
973
1038
  "y": 260,
974
- "category": "structural",
975
- "threshold": "0 failing policy tests and at least 90% policy coverage before a bundle is released",
976
- "description": "Every policy has unit tests next to it, including the default deny; CI runs them with coverage and refuses to publish the bundle below the threshold.\n\nTool: Open Policy Agent (opa test --coverage --threshold 90)\n\n```rego\npackage authz_test\n\nimport rego.v1\n\nimport data.authz\n\ntest_clerk_cannot_delete_order if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"clerk\"]}, \"action\": \"order:delete\", \"resource\": {\"type\": \"order\", \"region\": \"eu\"}}\n}\n\ntest_other_region_denied if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"manager\"], \"region\": \"eu\"}, \"action\": \"order:read\", \"resource\": {\"type\": \"order\", \"region\": \"us\"}}\n}\n\ntest_unknown_action_denied if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"admin\"]}, \"action\": \"order:unknown\", \"resource\": {\"type\": \"order\"}}\n}\n```",
1039
+ "characteristic": "security",
1040
+ "scope": "atomic",
1041
+ "cadence": "triggered",
1042
+ "trigger": "pull-request",
1043
+ "invocation": "automated",
1044
+ "description": "Every policy has unit tests next to it, including the default deny and a missing attribute; CI runs them with coverage and refuses to publish the bundle below the threshold.\n\nThreshold: 0 failing policy tests and at least 90% policy coverage before a bundle is released\n\nTool: Open Policy Agent (opa test --coverage --threshold 90); with Cedar: cedar validate and the Cedar test suite of Amazon Verified Permissions in CI\n\n```rego\npackage authz_test\n\nimport rego.v1\n\nimport data.authz\n\ntest_clerk_cannot_delete_order if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"clerk\"]}, \"action\": \"order:delete\", \"resource\": {\"type\": \"order\", \"region\": \"eu\"}}\n}\n\ntest_other_region_denied if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"manager\"], \"region\": \"eu\"}, \"action\": \"order:read\", \"resource\": {\"type\": \"order\", \"region\": \"us\"}}\n}\n\ntest_missing_region_denied if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"manager\"]}, \"action\": \"order:read\", \"resource\": {\"type\": \"order\", \"region\": \"eu\"}}\n}\n\ntest_unknown_action_denied if {\n\tnot authz.allow with input as {\"user\": {\"roles\": [\"admin\"]}, \"action\": \"order:unknown\", \"resource\": {\"type\": \"order\"}}\n}\n```",
1045
+ "hubWhen": {
1046
+ "MODEL": [
1047
+ "roles",
1048
+ "attributes"
1049
+ ],
1050
+ "ENFORCE": [
1051
+ "engine"
1052
+ ]
1053
+ }
1054
+ },
1055
+ {
1056
+ "id": "ff-policy-rollout",
1057
+ "type": "fitness-fn",
1058
+ "label": "Policy bundle reaches every decision point",
1059
+ "x": 1040,
1060
+ "y": 390,
1061
+ "characteristic": "security",
1062
+ "scope": "holistic",
1063
+ "cadence": "triggered",
1064
+ "trigger": "release",
1065
+ "invocation": "automated",
1066
+ "description": "After the bundle is published, the release pipeline polls the status API of every decision point until each reports the new revision, failing after 5 minutes, then reads a sample of the decision log and fails on an entry without the bundles.<name>.revision field.\n\nThreshold: Every decision point reports the released bundle revision within 5 minutes of the release; 0 decision log entries without a bundle revision\n\nTool: bash with curl and jq in the release pipeline (OPA status API; for Cedar or OpenFGA, the equivalent version endpoint of the engine)\n\n```bash\n#!/usr/bin/env bash\n# PDPS: the decision points' base URLs; REVISION: the revision just published; BUNDLE: its name\nset -euo pipefail\ndeadline=$(( $(date +%s) + 300 ))\nfor pdp in $PDPS; do\n until [ \"$(curl -sf \"$pdp/v1/status\" | jq -r \".result.bundles[\\\"$BUNDLE\\\"].active_revision\")\" = \"$REVISION\" ]; do\n [ \"$(date +%s)\" -lt \"$deadline\" ] || { echo \"$pdp did not load $REVISION within 5 minutes\"; exit 1; }\n sleep 5\n done\ndone\n# a sample of the decision log, one JSON event per line\nmissing=$(tail -n 100 \"$DECISION_LOG\" | jq -c \"select(.bundles[\\\"$BUNDLE\\\"].revision == null)\" | wc -l)\n[ \"$missing\" -eq 0 ] || { echo \"$missing decision log entries carry no policy version\"; exit 1; }\n```",
977
1067
  "hubWhen": {
978
1068
  "MODEL": [
979
1069
  "roles",
1070
+ "relations",
980
1071
  "attributes"
981
1072
  ],
982
1073
  "ENFORCE": [
@@ -989,10 +1080,13 @@
989
1080
  "type": "fitness-fn",
990
1081
  "label": "Relationship model tested",
991
1082
  "x": 1040,
992
- "y": 390,
993
- "category": "structural",
994
- "threshold": "0 failing assertions over the authorization model, run on every change of the model",
995
- "description": "The authorization model has a test file with tuples and expected checks, owners, team members and strangers included; CI runs it on every change to the model.\n\nTool: OpenFGA CLI (fga model test)\n\n```yaml\nname: Order sharing\nmodel_file: ./model.fga\ntuples:\n - user: user:anne\n relation: owner\n object: order:1\n - user: team:sales#member\n relation: viewer\n object: order:1\n - user: user:bob\n relation: member\n object: team:sales\ntests:\n - name: owner edits, team views, strangers see nothing\n check:\n - user: user:anne\n object: order:1\n assertions: { can_edit: true }\n - user: user:bob\n object: order:1\n assertions: { can_view: true, can_edit: false }\n - user: user:eve\n object: order:1\n assertions: { can_view: false }\n```",
1083
+ "y": 520,
1084
+ "characteristic": "security",
1085
+ "scope": "atomic",
1086
+ "cadence": "triggered",
1087
+ "trigger": "pull-request",
1088
+ "invocation": "automated",
1089
+ "description": "The authorization model has a test file with tuples and expected checks, owners, team members and strangers included; CI runs it on every change to the model.\n\nThreshold: 0 failing assertions over the authorization model, run on every change of the model\n\nTool: OpenFGA CLI (fga model test); with SpiceDB: zed validate over a validation file\n\n```yaml\nname: Order sharing\nmodel_file: ./model.fga\ntuples:\n - user: user:anne\n relation: owner\n object: order:1\n - user: team:sales#member\n relation: viewer\n object: order:1\n - user: user:bob\n relation: member\n object: team:sales\ntests:\n - name: owner edits, team views, strangers see nothing\n check:\n - user: user:anne\n object: order:1\n assertions: { can_edit: true }\n - user: user:bob\n object: order:1\n assertions: { can_view: true, can_edit: false }\n - user: user:eve\n object: order:1\n assertions: { can_view: false }\n```",
996
1090
  "hubWhen": {
997
1091
  "MODEL": [
998
1092
  "relations"
@@ -1002,15 +1096,72 @@
1002
1096
  ]
1003
1097
  }
1004
1098
  },
1099
+ {
1100
+ "id": "ff-sod",
1101
+ "type": "fitness-fn",
1102
+ "label": "Conflicting roles refused",
1103
+ "x": 1040,
1104
+ "y": 650,
1105
+ "characteristic": "security",
1106
+ "scope": "atomic",
1107
+ "cadence": "triggered",
1108
+ "trigger": "pull-request",
1109
+ "invocation": "automated",
1110
+ "description": "A test reads the separation-of-duties pairs from the code, grants the first role of each pair to a fresh account, tries to grant the second, and expects a refusal and a recorded attempt.\n\nThreshold: Every pair on the separation-of-duties list is refused when granted to one account, and the attempt is recorded; 0 pairs granted\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { SEPARATION_OF_DUTIES } from '../src/authz/roles' // [['payee-creator', 'payment-approver'], ...]\nimport { tokenFor, createAccount, grantAttempts } from './authz/fixtures'\n\ndescribe.each(SEPARATION_OF_DUTIES)('%s and %s', (first, second) => {\n it('cannot both be held by one account', async () => {\n const account = await createAccount({ roles: [first] })\n const res = await request(app).post(`/accounts/${account.id}/roles`).send({ role: second })\n .set('Authorization', `Bearer ${await tokenFor('administrator')}`)\n expect(res.status).toBe(409)\n expect(await grantAttempts({ account: account.id, role: second, refused: true })).toHaveLength(1)\n })\n})\n```",
1111
+ "hubWhen": {
1112
+ "MODEL": [
1113
+ "roles"
1114
+ ]
1115
+ }
1116
+ },
1117
+ {
1118
+ "id": "ff-unshare",
1119
+ "type": "fitness-fn",
1120
+ "label": "Unsharing takes effect in time",
1121
+ "x": 1040,
1122
+ "y": 780,
1123
+ "characteristic": "security",
1124
+ "scope": "atomic",
1125
+ "cadence": "triggered",
1126
+ "trigger": "pull-request",
1127
+ "invocation": "automated",
1128
+ "description": "An integration test shares a document with a user through a team, removes the user from the team, polls the document until it is refused (failing past 10 seconds), and checks that a request carrying the consistency token of the removal is refused on the first try.\n\nThreshold: A record is refused within 10 seconds of the relationship that granted it being removed; a check made with the write's consistency token is refused at once\n\nTool: Vitest with supertest against the service and its relationship store (OpenFGA, SpiceDB or the relationship table)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { seedTeamShare, tokenFor, sleep } from './authz/fixtures'\n\nit('closes a document within 10 seconds of the member being removed', async () => {\n const { doc, member, team, admin } = await seedTeamShare()\n const removal = await request(app).delete(`/teams/${team.id}/members/${member.id}`).set('Authorization', `Bearer ${await tokenFor(admin)}`)\n expect(removal.status).toBe(204)\n const token = removal.headers['x-consistency-token'] // the write's token, from the relationship store\n const atOnce = await request(app).get(`/documents/${doc.id}`).set('Authorization', `Bearer ${await tokenFor(member)}`).set('X-Consistency-Token', token)\n expect([403, 404]).toContain(atOnce.status)\n const started = Date.now()\n while ((await request(app).get(`/documents/${doc.id}`).set('Authorization', `Bearer ${await tokenFor(member)}`)).status === 200) {\n expect(Date.now() - started).toBeLessThan(10_000)\n await sleep(500)\n }\n})\n```",
1129
+ "hubWhen": {
1130
+ "MODEL": [
1131
+ "relations"
1132
+ ]
1133
+ }
1134
+ },
1135
+ {
1136
+ "id": "ff-missing-attribute",
1137
+ "type": "fitness-fn",
1138
+ "label": "Missing attributes deny",
1139
+ "x": 1040,
1140
+ "y": 910,
1141
+ "characteristic": "security",
1142
+ "scope": "atomic",
1143
+ "cadence": "triggered",
1144
+ "trigger": "pull-request",
1145
+ "invocation": "automated",
1146
+ "description": "An integration test creates a user without a region, and one whose region was last refreshed 16 minutes ago, asks for a record each and expects 403 with a log entry naming the attribute.\n\nThreshold: A request from a user without an attribute the policy reads, or with one refreshed more than 15 minutes ago, is refused and the log names the attribute; 0 such requests allowed\n\nTool: Vitest with supertest, the attribute source seeded by the test (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { userWithAttributes, tokenFor, decisionLog } from './authz/fixtures'\n\nit.each([\n ['no region', {}],\n ['a stale region', { region: 'eu', refreshedAt: new Date(Date.now() - 16 * 60_000) }],\n])('refuses a user with %s and names the attribute', async (_, attributes) => {\n const user = await userWithAttributes(attributes)\n const res = await request(app).get('/orders/1').set('Authorization', `Bearer ${await tokenFor(user)}`)\n expect(res.status).toBe(403)\n expect(await decisionLog.last({ user: user.id })).toMatchObject({ decision: 'deny', attribute: 'region' })\n})\n```",
1147
+ "hubWhen": {
1148
+ "MODEL": [
1149
+ "attributes"
1150
+ ]
1151
+ }
1152
+ },
1005
1153
  {
1006
1154
  "id": "ff-fail-closed",
1007
1155
  "type": "fitness-fn",
1008
1156
  "label": "Engine outage refuses",
1009
1157
  "x": 1040,
1010
- "y": 520,
1011
- "category": "operational",
1012
- "threshold": "100% of protected calls refused while the decision point is down; p99 decision time under 10 ms while it is up",
1013
- "description": "An integration test starts the service with its decision point, measures decision latency, then stops the decision point and calls protected operations as a caller with every permission, expecting each to be refused.\n\nTool: Testcontainers with Vitest\n\n```ts\nit('refuses every call while the policy engine is down', async () => {\n const pdp = await new GenericContainer('openpolicyagent/opa:latest').withCommand(['run', '--server']).start()\n const app = await startService({ pdpUrl: `http://${pdp.getHost()}:${pdp.getMappedPort(8181)}` })\n await pdp.stop()\n for (const route of protectedRoutes) {\n const res = await app.call(route, { as: 'superuser' })\n expect([403, 503]).toContain(res.status)\n }\n})\n```",
1158
+ "y": 1040,
1159
+ "characteristic": "security",
1160
+ "scope": "atomic",
1161
+ "cadence": "triggered",
1162
+ "trigger": "pull-request",
1163
+ "invocation": "automated",
1164
+ "description": "An integration test starts the service with its decision point, times 200 allowed calls and checks the p99, then stops the decision point and calls protected operations as a caller with every permission, expecting each to be refused.\n\nThreshold: 100% of protected calls refused while the decision point is down; p99 decision time under 10 ms over 200 calls while it is up\n\nTool: Testcontainers with Vitest\n\n```ts\nimport { GenericContainer } from 'testcontainers'\nimport { startService, protectedRoutes } from './authz/service'\n\nit('answers fast while the engine is up and refuses everything while it is down', async () => {\n const pdp = await new GenericContainer('openpolicyagent/opa:latest') // pin a version in your repository\n .withExposedPorts(8181).withCommand(['run', '--server', '--addr', ':8181']).start()\n const app = await startService({ pdpUrl: `http://${pdp.getHost()}:${pdp.getMappedPort(8181)}` })\n const times: number[] = []\n for (let i = 0; i < 200; i++) {\n const started = performance.now()\n expect((await app.call(protectedRoutes[0], { as: 'superuser' })).status).toBe(200)\n times.push(performance.now() - started)\n }\n times.sort((a, b) => a - b)\n expect(times[Math.floor(times.length * 0.99)]).toBeLessThan(10)\n await pdp.stop()\n for (const route of protectedRoutes) {\n const res = await app.call(route, { as: 'superuser' })\n expect([403, 503]).toContain(res.status)\n }\n})\n```",
1014
1165
  "hubWhen": {
1015
1166
  "MODEL": [
1016
1167
  "roles",
@@ -1027,10 +1178,13 @@
1027
1178
  "type": "fitness-fn",
1028
1179
  "label": "No overdue grants",
1029
1180
  "x": 1040,
1030
- "y": 650,
1031
- "category": "process",
1032
- "threshold": "0 grants unreviewed for more than {{REVIEW_DAYS}} + 14 days; 0 grants of leavers older than 24 hours",
1033
- "description": "A scheduled CI job runs a query over the grants every day and fails, opening a ticket for the owner, when a grant is overdue for review or belongs to a person who has left.\n\nTool: psql in a scheduled CI job\n\n```sql\n-- fails the job when it returns a row\nselect g.account_id, g.permission, g.last_reviewed_at, p.left_at\nfrom grants g\njoin people p on p.account_id = g.account_id\nwhere g.last_reviewed_at < now() - interval '{{REVIEW_DAYS}} days' - interval '14 days'\n or (p.left_at is not null and p.left_at < now() - interval '24 hours');\n```",
1181
+ "y": 1170,
1182
+ "characteristic": "security",
1183
+ "scope": "atomic",
1184
+ "cadence": "triggered",
1185
+ "trigger": "nightly",
1186
+ "invocation": "automated",
1187
+ "description": "A scheduled CI job runs a query over the grants every day and fails, printing the rows and opening a ticket for the owner, when a grant is overdue for review or belongs to a person who has left.\n\nThreshold: 0 grants unreviewed for more than {{REVIEW_DAYS}} + 14 days; 0 grants of leavers older than 24 hours\n\nTool: psql in a scheduled CI job (bash)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\noverdue=$(psql \"$DATABASE_URL\" -Atc \"\n select g.account_id || ' ' || g.permission || ' reviewed ' || coalesce(g.last_reviewed_at::text, 'never') || ' left ' || coalesce(p.left_at::text, '-')\n from grants g\n join people p on p.account_id = g.account_id\n where g.last_reviewed_at < now() - interval '{{REVIEW_DAYS}} days' - interval '14 days'\n or (p.left_at is not null and p.left_at < now() - interval '24 hours')\")\n[ -z \"$overdue\" ] || { echo \"$overdue\"; exit 1; }\n```",
1034
1188
  "hubWhen": {
1035
1189
  "MODEL": [
1036
1190
  "roles",
@@ -1047,10 +1201,12 @@
1047
1201
  "type": "fitness-fn",
1048
1202
  "label": "Grants match the directory",
1049
1203
  "x": 1040,
1050
- "y": 780,
1051
- "category": "process",
1052
- "threshold": "0 grants without a directory group behind them; 0 grants of disabled accounts older than 60 minutes",
1053
- "description": "A scheduled job compares the grants with the directory's groups every hour and fails on any grant that no group explains, or that belongs to an account the directory has disabled.\n\nTool: psql in a scheduled CI job\n\n```sql\n-- directory_* tables are filled by the SCIM endpoint; fails when it returns a row\nselect g.account_id, g.permission\nfrom grants g\nleft join directory_group_members m on m.account_id = g.account_id and m.group_name = g.source_group\nleft join directory_accounts a on a.account_id = g.account_id\nwhere m.account_id is null\n or (a.disabled_at is not null and a.disabled_at < now() - interval '60 minutes');\n```",
1204
+ "y": 1300,
1205
+ "characteristic": "security",
1206
+ "scope": "atomic",
1207
+ "cadence": "continual",
1208
+ "invocation": "automated",
1209
+ "description": "A scheduled job compares the grants with the directory's groups every hour and fails, printing the rows, on any grant that no group explains, or that belongs to an account the directory has disabled.\n\nThreshold: 0 grants without a directory group behind them; 0 grants of disabled accounts older than 60 minutes\n\nTool: psql in a scheduled CI job (bash); the directory_* tables are filled by the SCIM endpoint\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nstray=$(psql \"$DATABASE_URL\" -Atc \"\n select g.account_id || ' ' || g.permission\n from grants g\n left join directory_group_members m on m.account_id = g.account_id and m.group_name = g.source_group\n left join directory_accounts a on a.account_id = g.account_id\n where m.account_id is null\n or (a.disabled_at is not null and a.disabled_at < now() - interval '60 minutes')\")\n[ -z \"$stray\" ] || { echo \"$stray\"; exit 1; }\n```",
1054
1210
  "hubWhen": {
1055
1211
  "MODEL": [
1056
1212
  "roles",
@@ -1067,10 +1223,30 @@
1067
1223
  "type": "fitness-fn",
1068
1224
  "label": "No standing admins",
1069
1225
  "x": 1040,
1070
- "y": 910,
1071
- "category": "operational",
1072
- "threshold": "0 people holding administrator rights outside an active, approved elevation",
1073
- "description": "A scheduled query over the cloud account lists the people with administrator policies attached directly; anything returned is a standing right that bypasses elevation. Use the equivalent tables for Azure or Google Cloud.\n\nTool: Steampipe (AWS plugin)\n\n```sql\n-- fails the job when it returns a row\nselect u.name, u.arn\nfrom aws_iam_user u\nwhere u.attached_policy_arns ? 'arn:aws:iam::aws:policy/AdministratorAccess'\n or u.attached_policy_arns ? 'arn:aws:iam::aws:policy/PowerUserAccess';\n```",
1226
+ "y": 1430,
1227
+ "characteristic": "security",
1228
+ "scope": "atomic",
1229
+ "cadence": "triggered",
1230
+ "trigger": "nightly",
1231
+ "invocation": "automated",
1232
+ "description": "A scheduled query over the cloud account lists IAM users with an administrator policy attached directly, through a group or inline, and IAM Identity Center assignments of administrator permission sets to a person or group; every row is compared with the elevation tool's active requests, and any without one is a standing right that bypasses elevation. Use the equivalent tables for Azure (azuread_user, azure_role_assignment) or Google Cloud (gcp_iam_policy).\n\nThreshold: 0 people holding administrator rights outside an active, approved elevation\n\nTool: Steampipe (AWS plugin), in a scheduled CI job that fails when the query returns a row not matched by an active elevation\n\n```sql\n-- every row is a standing administrator right unless the elevation tool lists it as active\nwith admin_policies as (\n select unnest(array['arn:aws:iam::aws:policy/AdministratorAccess', 'arn:aws:iam::aws:policy/PowerUserAccess']) as arn\n),\nadmin_sets as (\n select mpa.permission_set_arn\n from aws_ssoadmin_managed_policy_attachment mpa\n join aws_ssoadmin_permission_set ps on ps.arn = mpa.permission_set_arn\n where mpa.managed_policy_arn in (select arn from admin_policies)\n)\nselect 'iam user ' || u.name as holder\nfrom aws_iam_user u\nwhere exists (select 1 from admin_policies p where u.attached_policy_arns ? p.arn)\n or exists (select 1 from jsonb_array_elements(u.inline_policies) ip\n where ip -> 'PolicyDocument' -> 'Statement' @> '[{\"Effect\": \"Allow\", \"Action\": \"*\"}]')\nunion all\nselect 'iam group ' || g.name || ' member ' || (m ->> 'UserName')\nfrom aws_iam_group g, jsonb_array_elements(g.users) m\nwhere exists (select 1 from admin_policies p where g.attached_policy_arns ? p.arn)\nunion all\nselect 'identity center ' || a.principal_type || ' ' || a.principal_id || ' in account ' || a.target_account_id\nfrom aws_ssoadmin_account_assignment a\nwhere a.permission_set_arn in (select permission_set_arn from admin_sets)\n and a.target_account_id = '123456789012'; -- the production account\n```",
1233
+ "hubWhen": {
1234
+ "ADMIN": [
1235
+ "jit"
1236
+ ]
1237
+ }
1238
+ },
1239
+ {
1240
+ "id": "ff-break-glass",
1241
+ "type": "fitness-fn",
1242
+ "label": "Break-glass use alerts",
1243
+ "x": 1040,
1244
+ "y": 1560,
1245
+ "characteristic": "security",
1246
+ "scope": "atomic",
1247
+ "cadence": "continual",
1248
+ "invocation": "automated",
1249
+ "description": "An EventBridge rule matches console sign-ins by the break-glass user from CloudTrail and sends them to the paging topic; a quarterly drill signs in with the account in a non-production environment and times the page. The same scheduled job that counts administrators compares the account's password_last_used with its password last changed date.\n\nThreshold: A sign-in with the break-glass account raises a page to the security owner within 5 minutes; the credential's last rotation is at most 24 hours after its last use\n\nTool: Terraform (aws_cloudwatch_event_rule on CloudTrail sign-in events, SNS to the pager); on Azure: an Entra ID sign-in log alert rule for the account; on Google Cloud: a log-based alert on the service account\n\n```hcl\nresource \"aws_cloudwatch_event_rule\" \"break_glass_used\" {\n name = \"break-glass-used\"\n description = \"ADR Just-in-time privileged access: page on any use of the sealed account\"\n event_pattern = jsonencode({\n source = [\"aws.signin\"]\n \"detail-type\" = [\"AWS Console Sign In via CloudTrail\"]\n detail = {\n eventName = [\"ConsoleLogin\"]\n userIdentity = { userName = [var.break_glass_user_name] }\n }\n })\n}\n\nresource \"aws_cloudwatch_event_target\" \"break_glass_page\" {\n rule = aws_cloudwatch_event_rule.break_glass_used.name\n arn = var.security_pager_topic_arn # SNS topic wired to the on-call tool\n}\n```",
1074
1250
  "hubWhen": {
1075
1251
  "ADMIN": [
1076
1252
  "jit"
@@ -1082,12 +1258,34 @@
1082
1258
  "type": "fitness-fn",
1083
1259
  "label": "Admins few and strong",
1084
1260
  "x": 1040,
1085
- "y": 1040,
1086
- "category": "operational",
1087
- "threshold": "At most 5 administrator accounts, 0 of them without MFA",
1088
- "description": "A scheduled query counts the people with administrator rights and lists those without MFA; the job fails above 5 accounts or on any without MFA.\n\nTool: Steampipe (AWS plugin)\n\n```sql\nselect\n count(*) as admins,\n count(*) filter (where not mfa_enabled) as without_mfa\nfrom aws_iam_user\nwhere attached_policy_arns ? 'arn:aws:iam::aws:policy/AdministratorAccess';\n-- the job fails when admins > 5 or without_mfa > 0\n```",
1261
+ "y": 1690,
1262
+ "characteristic": "security",
1263
+ "scope": "atomic",
1264
+ "cadence": "triggered",
1265
+ "trigger": "nightly",
1266
+ "invocation": "automated",
1267
+ "description": "A scheduled query counts the people with administrator rights and lists those without a FIDO security key among their MFA devices (serial numbers of security keys are :u2f/ ARNs); the job fails above 5 accounts or on any without one. A passkey registered as a FIDO key appears the same way; a virtual MFA device does not count.\n\nThreshold: At most 5 administrator accounts, 0 of them without a FIDO security key registered\n\nTool: Steampipe (AWS plugin), in a scheduled CI job; for Azure: azuread_user with authentication methods, for Google Workspace: the users report with isEnforcedIn2Sv and security keys\n\n```sql\nselect\n count(*) as admins,\n count(*) filter (where not exists (\n select 1 from jsonb_array_elements(coalesce(mfa_devices, '[]'::jsonb)) d\n where d ->> 'SerialNumber' like '%:u2f/%'\n )) as without_security_key\nfrom aws_iam_user\nwhere attached_policy_arns ? 'arn:aws:iam::aws:policy/AdministratorAccess';\n-- the job fails when admins > 5 or without_security_key > 0\n```",
1268
+ "hubWhen": {
1269
+ "ADMIN": [
1270
+ "standing"
1271
+ ]
1272
+ }
1273
+ },
1274
+ {
1275
+ "id": "ff-audit-immutable",
1276
+ "type": "fitness-fn",
1277
+ "label": "Audit log cannot be changed",
1278
+ "x": 1040,
1279
+ "y": 1820,
1280
+ "characteristic": "security",
1281
+ "scope": "atomic",
1282
+ "cadence": "triggered",
1283
+ "trigger": "pull-request",
1284
+ "invocation": "automated",
1285
+ "description": "A policy over the Terraform plan in CI fails when the CloudTrail trail has no log file validation, or its bucket has no Object Lock configuration in compliance mode with a default retention (in days or years) of at least 365 days, so that no administrator can delete or edit an entry within the retention. 365 days is only a floor: the retention itself is the one the Audit trail pack decides, and the bucket is set to it.\n\nThreshold: The CloudTrail trail has log file validation on and writes to a bucket with Object Lock in compliance mode for at least 365 days, a floor below the audit trail's retention; 0 trails without both\n\nTool: Conftest on the Terraform plan (AWS form; on Azure check the storage account's immutability policy, on Google Cloud the bucket's retention policy with locked = true)\n\n```rego\npackage main\n\nimport rego.v1\n\ntrails := [r | some r in input.resource_changes; r.type == \"aws_cloudtrail\"]\nlocks := [r | some r in input.resource_changes; r.type == \"aws_s3_bucket_object_lock_configuration\"]\n\ndeny contains \"no CloudTrail trail in the plan\" if count(trails) == 0\n\ndeny contains msg if {\n\tsome t in trails\n\tnot t.change.after.enable_log_file_validation\n\tmsg := sprintf(\"%s has no log file validation\", [t.address])\n}\n\ndeny contains \"no Object Lock configuration on the audit bucket\" if count(locks) == 0\n\ndeny contains msg if {\n\tsome l in locks\n\tsome rule in l.change.after.rule\n\tsome retention in rule.default_retention\n\tnot retention.mode == \"COMPLIANCE\"\n\tmsg := sprintf(\"%s is not in compliance mode\", [l.address])\n}\n\ndeny contains msg if {\n\tsome l in locks\n\tsome rule in l.change.after.rule\n\tsome retention in rule.default_retention\n\tnumber_or_zero(retention.years) * 365 + number_or_zero(retention.days) < 365\n\tmsg := sprintf(\"%s keeps the audit log for fewer than 365 days, the floor below the audit trail's retention\", [l.address])\n}\n\nnumber_or_zero(x) := x if is_number(x)\n\nnumber_or_zero(x) := 0 if not is_number(x)\n```",
1089
1286
  "hubWhen": {
1090
1287
  "ADMIN": [
1288
+ "jit",
1091
1289
  "standing"
1092
1290
  ]
1093
1291
  }
@@ -1097,10 +1295,13 @@
1097
1295
  "type": "fitness-fn",
1098
1296
  "label": "No person reaches data",
1099
1297
  "x": 1040,
1100
- "y": 1170,
1101
- "category": "structural",
1102
- "threshold": "0 infrastructure changes that give a person access to a production data store",
1103
- "description": "A policy runs over every Terraform plan in CI and refuses a change that attaches data-store actions to a user or group rather than a service role.\n\nTool: Conftest\n\n```rego\npackage main\n\nimport rego.v1\n\nhuman_policy := {\"aws_iam_user_policy\", \"aws_iam_group_policy\"}\n\ndeny contains msg if {\n\tsome r in input.resource_changes\n\thuman_policy[r.type]\n\tsome s in json.unmarshal(r.change.after.policy).Statement\n\tsome a in actions(s)\n\tregex.match(\"^(rds-db|dynamodb|s3|secretsmanager):\", a)\n\tmsg := sprintf(\"%s gives a person direct access to production data (%s)\", [r.address, a])\n}\n\nactions(s) := s.Action if is_array(s.Action)\n\nactions(s) := [s.Action] if is_string(s.Action)\n```",
1298
+ "y": 1950,
1299
+ "characteristic": "security",
1300
+ "scope": "atomic",
1301
+ "cadence": "triggered",
1302
+ "trigger": "pull-request",
1303
+ "invocation": "automated",
1304
+ "description": "A policy runs over every Terraform plan in CI and refuses a change that gives a user or group data-store actions or a wildcard inline, or attaches an administrator or data-store managed policy to a user or group; service roles are not touched.\n\nThreshold: 0 infrastructure changes that give a person access to a production data store\n\nTool: Conftest on the Terraform plan (AWS form; for Azure check azurerm_role_assignment with a user principal, for Google Cloud google_project_iam_member with user: or group: members)\n\n```rego\npackage main\n\nimport rego.v1\n\nhuman_inline := {\"aws_iam_user_policy\", \"aws_iam_group_policy\"}\nhuman_attachment := {\"aws_iam_user_policy_attachment\", \"aws_iam_group_policy_attachment\"}\ndata_policies := {\n\t\"arn:aws:iam::aws:policy/AdministratorAccess\", \"arn:aws:iam::aws:policy/PowerUserAccess\",\n\t\"arn:aws:iam::aws:policy/AmazonRDSFullAccess\", \"arn:aws:iam::aws:policy/AmazonS3FullAccess\",\n\t\"arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess\", \"arn:aws:iam::aws:policy/SecretsManagerReadWrite\",\n}\n\ndeny contains msg if {\n\tsome r in input.resource_changes\n\thuman_inline[r.type]\n\tsome s in json.unmarshal(r.change.after.policy).Statement\n\tsome a in actions(s)\n\tregex.match(\"^(\\\\*|rds[a-z-]*:|dynamodb:|s3:|secretsmanager:)\", a)\n\tmsg := sprintf(\"%s gives a person direct access to production data (%s)\", [r.address, a])\n}\n\ndeny contains msg if {\n\tsome r in input.resource_changes\n\thuman_attachment[r.type]\n\tdata_policies[r.change.after.policy_arn]\n\tmsg := sprintf(\"%s attaches %s to a person or group\", [r.address, r.change.after.policy_arn])\n}\n\ndeny contains msg if {\n\tsome r in input.resource_changes\n\tr.type == \"aws_iam_policy_attachment\"\n\tcount(array.concat(object.get(r.change.after, \"users\", []), object.get(r.change.after, \"groups\", []))) > 0\n\tmsg := sprintf(\"%s attaches a policy to users or groups\", [r.address])\n}\n\nactions(s) := s.Action if is_array(s.Action)\n\nactions(s) := [s.Action] if is_string(s.Action)\n```",
1104
1305
  "hubWhen": {
1105
1306
  "ADMIN": [
1106
1307
  "none"
@@ -1112,10 +1313,13 @@
1112
1313
  "type": "fitness-fn",
1113
1314
  "label": "No permission checks creep in",
1114
1315
  "x": 1040,
1115
- "y": 1300,
1116
- "category": "structural",
1117
- "threshold": "0 imports of an authorization library or role check in the application code",
1118
- "description": "A dependency rule fails the build when the code imports an authorization library, which would mean a restricted feature arrived without its decision.\n\nTool: dependency-cruiser\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n forbidden: [{\n name: 'no-authorization',\n comment: 'ADR One level of access: supersede it before adding permissions',\n severity: 'error',\n from: {},\n to: { path: 'node_modules/(@casl/|casbin|accesscontrol|@openfga/|@permitio/|@cerbos/)' },\n }],\n}\n```",
1316
+ "y": 2080,
1317
+ "characteristic": "security",
1318
+ "scope": "atomic",
1319
+ "cadence": "triggered",
1320
+ "trigger": "pull-request",
1321
+ "invocation": "automated",
1322
+ "description": "A dependency rule fails the build when the code imports an authorization library, which would mean a restricted feature arrived without its decision.\n\nThreshold: 0 imports of an authorization library or role check in the application code\n\nTool: dependency-cruiser (or the equivalent for your stack: ArchUnit, NetArchTest, a RuboCop custom cop)\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n forbidden: [{\n name: 'no-authorization',\n comment: 'ADR One level of access: supersede it before adding permissions',\n severity: 'error',\n from: {},\n to: { path: 'node_modules/(@casl/|casbin|accesscontrol|@openfga/|@permitio/|@cerbos/)' },\n }],\n}\n```",
1119
1323
  "hubWhen": {
1120
1324
  "MODEL": [
1121
1325
  "flat"
@@ -1382,6 +1586,12 @@
1382
1586
  "targetId": "adr-attributes",
1383
1587
  "relationType": "implements"
1384
1588
  },
1589
+ {
1590
+ "id": "ff-policy-rollout--implements--adr-engine",
1591
+ "sourceId": "ff-policy-rollout",
1592
+ "targetId": "adr-engine",
1593
+ "relationType": "implements"
1594
+ },
1385
1595
  {
1386
1596
  "id": "ff-relation-tests--implements--adr-engine",
1387
1597
  "sourceId": "ff-relation-tests",
@@ -1395,45 +1605,39 @@
1395
1605
  "relationType": "implements"
1396
1606
  },
1397
1607
  {
1398
- "id": "ff-fail-closed--implements--adr-engine",
1399
- "sourceId": "ff-fail-closed",
1400
- "targetId": "adr-engine",
1401
- "relationType": "implements"
1402
- },
1403
- {
1404
- "id": "ff-stale-grants--implements--adr-roles",
1405
- "sourceId": "ff-stale-grants",
1608
+ "id": "ff-sod--implements--adr-roles",
1609
+ "sourceId": "ff-sod",
1406
1610
  "targetId": "adr-roles",
1407
1611
  "relationType": "implements"
1408
1612
  },
1409
1613
  {
1410
- "id": "ff-stale-grants--implements--adr-relations",
1411
- "sourceId": "ff-stale-grants",
1614
+ "id": "ff-unshare--implements--adr-relations",
1615
+ "sourceId": "ff-unshare",
1412
1616
  "targetId": "adr-relations",
1413
1617
  "relationType": "implements"
1414
1618
  },
1415
1619
  {
1416
- "id": "ff-stale-grants--implements--adr-attributes",
1417
- "sourceId": "ff-stale-grants",
1620
+ "id": "ff-missing-attribute--implements--adr-attributes",
1621
+ "sourceId": "ff-missing-attribute",
1418
1622
  "targetId": "adr-attributes",
1419
1623
  "relationType": "implements"
1420
1624
  },
1421
1625
  {
1422
- "id": "ff-directory-sync--implements--adr-roles",
1423
- "sourceId": "ff-directory-sync",
1424
- "targetId": "adr-roles",
1626
+ "id": "ff-fail-closed--implements--adr-engine",
1627
+ "sourceId": "ff-fail-closed",
1628
+ "targetId": "adr-engine",
1425
1629
  "relationType": "implements"
1426
1630
  },
1427
1631
  {
1428
- "id": "ff-directory-sync--implements--adr-relations",
1429
- "sourceId": "ff-directory-sync",
1430
- "targetId": "adr-relations",
1632
+ "id": "ff-stale-grants--implements--adr-review-periodic",
1633
+ "sourceId": "ff-stale-grants",
1634
+ "targetId": "adr-review-periodic",
1431
1635
  "relationType": "implements"
1432
1636
  },
1433
1637
  {
1434
- "id": "ff-directory-sync--implements--adr-attributes",
1638
+ "id": "ff-directory-sync--implements--adr-review-directory",
1435
1639
  "sourceId": "ff-directory-sync",
1436
- "targetId": "adr-attributes",
1640
+ "targetId": "adr-review-directory",
1437
1641
  "relationType": "implements"
1438
1642
  },
1439
1643
  {
@@ -1442,12 +1646,30 @@
1442
1646
  "targetId": "adr-jit",
1443
1647
  "relationType": "implements"
1444
1648
  },
1649
+ {
1650
+ "id": "ff-break-glass--implements--adr-jit",
1651
+ "sourceId": "ff-break-glass",
1652
+ "targetId": "adr-jit",
1653
+ "relationType": "implements"
1654
+ },
1445
1655
  {
1446
1656
  "id": "ff-admin-list--implements--adr-standing",
1447
1657
  "sourceId": "ff-admin-list",
1448
1658
  "targetId": "adr-standing",
1449
1659
  "relationType": "implements"
1450
1660
  },
1661
+ {
1662
+ "id": "ff-audit-immutable--implements--adr-jit",
1663
+ "sourceId": "ff-audit-immutable",
1664
+ "targetId": "adr-jit",
1665
+ "relationType": "implements"
1666
+ },
1667
+ {
1668
+ "id": "ff-audit-immutable--implements--adr-standing",
1669
+ "sourceId": "ff-audit-immutable",
1670
+ "targetId": "adr-standing",
1671
+ "relationType": "implements"
1672
+ },
1451
1673
  {
1452
1674
  "id": "ff-no-data-access--implements--adr-no-direct",
1453
1675
  "sourceId": "ff-no-data-access",