archsutra-ai 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -6
- package/README.md +84 -12
- package/dist/audit.js +125 -44
- package/dist/cli.js +184 -96
- package/dist/drift.js +29 -15
- package/dist/fsutil.js +117 -20
- package/dist/history.js +40 -0
- package/dist/html.js +10 -8
- package/dist/map.js +26 -5
- package/dist/mcp.js +70 -55
- package/dist/redact.js +24 -11
- package/dist/report.js +69 -19
- package/dist/rules-extra.js +59 -0
- package/dist/secret-patterns.js +69 -0
- package/dist/suppress.js +31 -19
- package/dist/verify.js +2 -2
- package/dist/write.js +71 -0
- package/docs/architecture/overview.html +29 -12
- package/docs/architecture/overview.md +2 -2
- package/docs/architecture/threat-model.html +28 -11
- package/docs/assets/charts/coverage-dark.svg +11 -0
- package/docs/assets/charts/coverage.svg +11 -0
- package/docs/assets/charts/finding-anatomy-dark.svg +20 -0
- package/docs/assets/charts/finding-anatomy.svg +20 -0
- package/docs/assets/charts/pipeline-dark.svg +13 -0
- package/docs/assets/charts/pipeline.svg +13 -0
- package/docs/assets/charts/precision-by-batch-dark.svg +12 -0
- package/docs/assets/charts/precision-by-batch.svg +12 -0
- package/docs/assets/charts/precision-by-rule-dark.svg +12 -0
- package/docs/assets/charts/precision-by-rule.svg +12 -0
- package/docs/assets/charts/sample-findings-by-severity-dark.svg +11 -0
- package/docs/assets/charts/sample-findings-by-severity.svg +11 -0
- package/docs/assets/charts/scan-time-dark.svg +11 -0
- package/docs/assets/charts/scan-time.svg +11 -0
- package/docs/assets/site.css +259 -138
- package/docs/assets/site.js +92 -6
- package/docs/community/good-first-issues.html +28 -11
- package/docs/compatibility/matrix.html +28 -11
- package/docs/compatibility/smoke-tests/index.html +28 -11
- package/docs/decisions/ADR-0001-deterministic-cli-plus-ide-skills.html +28 -11
- package/docs/guides/cheat-sheet.html +100 -0
- package/docs/guides/cheat-sheet.md +146 -0
- package/docs/guides/ci-recipes.html +170 -0
- package/docs/guides/ci-recipes.md +176 -0
- package/docs/guides/evidence-at-a-glance.html +93 -0
- package/docs/guides/evidence-at-a-glance.md +65 -0
- package/docs/guides/getting-started.html +151 -0
- package/docs/guides/getting-started.md +160 -0
- package/docs/guides/how-it-works.html +161 -0
- package/docs/guides/how-it-works.md +148 -0
- package/docs/guides/mcp-server.html +99 -0
- package/docs/guides/mcp-server.md +81 -0
- package/docs/guides/reading-a-report.html +119 -0
- package/docs/guides/reading-a-report.md +111 -0
- package/docs/guides/real-world-scenarios.html +287 -0
- package/docs/guides/real-world-scenarios.md +377 -0
- package/docs/handbook/01-executive-summary.html +30 -13
- package/docs/handbook/01-executive-summary.md +2 -2
- package/docs/handbook/02-functional-specification.html +30 -13
- package/docs/handbook/02-functional-specification.md +3 -3
- package/docs/handbook/03-technical-specification.html +31 -14
- package/docs/handbook/03-technical-specification.md +3 -3
- package/docs/handbook/04-architecture.html +29 -12
- package/docs/handbook/04-architecture.md +1 -1
- package/docs/handbook/05-user-guide.html +33 -15
- package/docs/handbook/05-user-guide.md +5 -4
- package/docs/handbook/06-cli-reference.html +52 -16
- package/docs/handbook/06-cli-reference.md +47 -4
- package/docs/handbook/07-security-privacy-legal.html +31 -12
- package/docs/handbook/07-security-privacy-legal.md +4 -0
- package/docs/handbook/08-testing-and-proof.html +32 -15
- package/docs/handbook/08-testing-and-proof.md +4 -4
- package/docs/handbook/09-compatibility-and-roadmap.html +29 -12
- package/docs/handbook/09-compatibility-and-roadmap.md +3 -2
- package/docs/handbook/10-contributor-guide.html +29 -12
- package/docs/handbook/10-contributor-guide.md +1 -1
- package/docs/handbook/11-glossary-and-faq.html +34 -13
- package/docs/handbook/11-glossary-and-faq.md +7 -1
- package/docs/handbook/12-rule-catalog.html +59 -19
- package/docs/handbook/12-rule-catalog.md +62 -5
- package/docs/handbook/13-trust-and-assurance.html +29 -12
- package/docs/handbook/13-trust-and-assurance.md +1 -1
- package/docs/handbook/14-real-world-evaluation.html +28 -11
- package/docs/handbook/15-supply-chain-and-release.html +28 -11
- package/docs/handbook/16-performance-and-quality-metrics.html +28 -11
- package/docs/handbook/16-performance-and-quality-metrics.md +1 -1
- package/docs/handbook/README.md +4 -2
- package/docs/handbook/index.html +31 -13
- package/docs/index.html +101 -51
- package/docs/legal/legal-review-brief.html +28 -11
- package/docs/legal/trademark-and-name-clearance.html +28 -11
- package/docs/proof/accessibility.html +28 -11
- package/docs/proof/benchmarks.json +9 -9
- package/docs/proof/benchmarks.md +4 -4
- package/docs/proof/test-results.txt +56 -40
- package/docs/rfc/0001-archsutra-v0.1.html +28 -11
- package/docs/sample-report/architecture-register.json +46 -0
- package/docs/sample-report/audit-report.html +123 -0
- package/docs/sample-report/audit-report.md +314 -0
- package/docs/sample-report/current-state.html +77 -0
- package/docs/sample-report/current-state.md +51 -0
- package/docs/sample-report/findings.json +478 -0
- package/docs/sample-report/findings.sarif +754 -0
- package/docs/sample-report/index.html +57 -0
- package/docs/sample-report/overview.md +11 -0
- package/docs/search-index.json +1 -0
- package/docs/sitemap.xml +39 -28
- package/llms.txt +11 -2
- package/package.json +3 -2
- package/schemas/findings.schema.json +4 -3
- package/skills/architecture-audit/SKILL.md +2 -2
- package/skills/architecture-audit/references/report-template.md +1 -1
- package/skills/architecture-verification/references/fitness-functions.md +1 -1
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
<!-- archsutra:generated -->
|
|
2
|
+
# Architecture Audit Report
|
|
3
|
+
|
|
4
|
+
> Generated by ArchSutra AI (deterministic static scan). Read-only. This is a review aid, not a certification or compliance statement. Findings marked `inferred` or `unknown` are hypotheses.
|
|
5
|
+
|
|
6
|
+
## Summary
|
|
7
|
+
|
|
8
|
+
- Files scanned: 7
|
|
9
|
+
- Stack observed: TypeScript, Node.js
|
|
10
|
+
- Findings: 12 (critical 0, high 3, medium 7, low 2, info 0)
|
|
11
|
+
|
|
12
|
+
## Scorecard
|
|
13
|
+
|
|
14
|
+
| Category | Rating | Confidence | Basis |
|
|
15
|
+
|---|---|---|---|
|
|
16
|
+
| Security | weak | low | 4 finding(s): 0 critical, 3 high, 1 medium, 0 low. 19 rule(s), 100% of listed files scanned. Absence of findings is not proof of quality. |
|
|
17
|
+
| Maintainability | adequate | low | 3 finding(s): 0 critical, 0 high, 3 medium, 0 low. 5 rule(s), 100% of listed files scanned. Absence of findings is not proof of quality. |
|
|
18
|
+
| Operability | adequate | low | 1 finding(s): 0 critical, 0 high, 1 medium, 0 low. 2 rule(s), 100% of listed files scanned. Absence of findings is not proof of quality. |
|
|
19
|
+
| Supply chain | adequate | low | 3 finding(s): 0 critical, 0 high, 2 medium, 1 low. 3 rule(s), 100% of listed files scanned. Absence of findings is not proof of quality. |
|
|
20
|
+
| Developer experience | no findings | low | 1 finding(s): 0 critical, 0 high, 0 medium, 1 low. 2 rule(s), 100% of listed files scanned. Absence of findings is not proof of quality. |
|
|
21
|
+
| Reliability | not assessed | none | Needs runtime, load, data or billing evidence the static scan cannot observe. Use the architecture-audit skill; see the roadmap in docs/handbook/09-compatibility-and-roadmap.md. |
|
|
22
|
+
| Performance | not assessed | none | Needs runtime, load, data or billing evidence the static scan cannot observe. Use the architecture-audit skill; see the roadmap in docs/handbook/09-compatibility-and-roadmap.md. |
|
|
23
|
+
| Scalability | not assessed | none | Needs runtime, load, data or billing evidence the static scan cannot observe. Use the architecture-audit skill; see the roadmap in docs/handbook/09-compatibility-and-roadmap.md. |
|
|
24
|
+
| Data integrity | not assessed | none | Needs runtime, load, data or billing evidence the static scan cannot observe. Use the architecture-audit skill; see the roadmap in docs/handbook/09-compatibility-and-roadmap.md. |
|
|
25
|
+
| Cost | not assessed | none | Needs runtime, load, data or billing evidence the static scan cannot observe. Use the architecture-audit skill; see the roadmap in docs/handbook/09-compatibility-and-roadmap.md. |
|
|
26
|
+
|
|
27
|
+
## Findings
|
|
28
|
+
|
|
29
|
+
### AS-SEC-004#001 - Dynamic code or shell execution
|
|
30
|
+
|
|
31
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
32
|
+
|---|---|---|---|---|
|
|
33
|
+
| high | medium | security | M | application developer |
|
|
34
|
+
|
|
35
|
+
**Classification:** CWE-95, OWASP A03:2021
|
|
36
|
+
|
|
37
|
+
**Evidence**
|
|
38
|
+
- [observed] `src/services/user.ts:3` - `const score = eval(expr);`
|
|
39
|
+
|
|
40
|
+
**Impact:** If any input reaches these calls, an attacker can execute arbitrary code or commands.
|
|
41
|
+
|
|
42
|
+
**Why it matters:** Injection (OWASP A03) frequently starts at eval/exec style sinks.
|
|
43
|
+
|
|
44
|
+
**Fix:** Replace with a safe API (argument arrays, parsers, allowlists). Never build commands or code from strings that include external input.
|
|
45
|
+
|
|
46
|
+
**Verify:** Trace data flow into each call; add a unit test with hostile input.
|
|
47
|
+
|
|
48
|
+
**Acceptance:** No eval/Function/shell-string execution remains, or each remaining use is documented with a proven constant input.
|
|
49
|
+
|
|
50
|
+
**Caveats / false-positive notes:** Pattern match only. The call may only receive constants; confirm by data-flow review.
|
|
51
|
+
|
|
52
|
+
**References:** https://owasp.org/Top10/
|
|
53
|
+
|
|
54
|
+
### AS-SEC-005#001 - SQL built by string concatenation or interpolation
|
|
55
|
+
|
|
56
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
57
|
+
|---|---|---|---|---|
|
|
58
|
+
| high | medium | security | M | application developer |
|
|
59
|
+
|
|
60
|
+
**Classification:** CWE-89, OWASP A03:2021
|
|
61
|
+
|
|
62
|
+
**Evidence**
|
|
63
|
+
- [observed] `src/services/user.ts:2` - `const rows = await db.query('SELECT * FROM users WHERE id = ${id}');`
|
|
64
|
+
|
|
65
|
+
**Impact:** Possible SQL injection and unpredictable query plans.
|
|
66
|
+
|
|
67
|
+
**Why it matters:** Parameterized queries are the primary defence against injection (OWASP A03).
|
|
68
|
+
|
|
69
|
+
**Fix:** Use parameterized queries or the ORM query builder. Allowlist any dynamic identifiers.
|
|
70
|
+
|
|
71
|
+
**Verify:** Search for the pattern again; add an injection test (e.g. a quote character in input).
|
|
72
|
+
|
|
73
|
+
**Acceptance:** All queries with external input use bind parameters.
|
|
74
|
+
|
|
75
|
+
**Caveats / false-positive notes:** Heuristic. Interpolated values may be constants or already validated.
|
|
76
|
+
|
|
77
|
+
**References:** https://owasp.org/Top10/, https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html
|
|
78
|
+
|
|
79
|
+
### AS-SEC-006#001 - TLS certificate verification disabled
|
|
80
|
+
|
|
81
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
82
|
+
|---|---|---|---|---|
|
|
83
|
+
| high | high | security | S | application developer |
|
|
84
|
+
|
|
85
|
+
**Classification:** CWE-295, OWASP A02:2021
|
|
86
|
+
|
|
87
|
+
**Evidence**
|
|
88
|
+
- [observed] `src/services/http.ts:2` - `export const agent = new https.Agent({ rejectUnauthorized: false });`
|
|
89
|
+
|
|
90
|
+
**Impact:** Connections can be intercepted by a man-in-the-middle.
|
|
91
|
+
|
|
92
|
+
**Why it matters:** Disabled verification removes the authenticity guarantee of TLS.
|
|
93
|
+
|
|
94
|
+
**Fix:** Enable verification. For private CAs, trust the CA bundle explicitly instead of disabling checks.
|
|
95
|
+
|
|
96
|
+
**Verify:** Connect to a host with an invalid cert and confirm the call fails.
|
|
97
|
+
|
|
98
|
+
**Acceptance:** No production code path disables certificate verification.
|
|
99
|
+
|
|
100
|
+
**Caveats / false-positive notes:** May be limited to a local dev profile; confirm it cannot reach production.
|
|
101
|
+
|
|
102
|
+
**References:** https://owasp.org/Top10/A02_2021-Cryptographic_Failures/
|
|
103
|
+
|
|
104
|
+
### AS-ARC-001#001 - Circular dependency between modules (src/api <-> src/db)
|
|
105
|
+
|
|
106
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
107
|
+
|---|---|---|---|---|
|
|
108
|
+
| medium | high | architecture | M | tech lead |
|
|
109
|
+
|
|
110
|
+
**Evidence**
|
|
111
|
+
- [observed] `src/api/routes.ts:1` - `import { findUser } from '../db/repo.js';`
|
|
112
|
+
- [observed] `src/db/repo.ts:1` - `import { getUser } from '../api/routes.js';`
|
|
113
|
+
|
|
114
|
+
**Impact:** Cyclic modules cannot be understood, tested, versioned or deployed independently.
|
|
115
|
+
|
|
116
|
+
**Why it matters:** Acyclic dependencies keep change local and make extraction (e.g. to a service) feasible.
|
|
117
|
+
|
|
118
|
+
**Fix:** Extract the shared concept into a lower-level module or invert one dependency behind an interface.
|
|
119
|
+
|
|
120
|
+
**Verify:** Re-run `archsutra map`; cycles list must be empty. Add the check to CI.
|
|
121
|
+
|
|
122
|
+
**Acceptance:** archsutra map reports zero module cycles.
|
|
123
|
+
|
|
124
|
+
**Caveats / false-positive notes:** Module = top-level directory heuristic; a cycle between sub-folders of one deliberate unit may be acceptable.
|
|
125
|
+
|
|
126
|
+
**References:** https://en.wikipedia.org/wiki/Acyclic_dependencies_principle
|
|
127
|
+
|
|
128
|
+
### AS-ARC-002#001 - Lower layer depends on a higher layer
|
|
129
|
+
|
|
130
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
131
|
+
|---|---|---|---|---|
|
|
132
|
+
| medium | medium | architecture | M | tech lead |
|
|
133
|
+
|
|
134
|
+
**Evidence**
|
|
135
|
+
- [observed] `src/db/repo.ts:1` - `import { getUser } from '../api/routes.js';`
|
|
136
|
+
|
|
137
|
+
**Impact:** Data or service code that imports presentation code inverts the intended dependency direction and blocks reuse.
|
|
138
|
+
|
|
139
|
+
**Why it matters:** Layer direction is what keeps business and data logic independent of delivery mechanisms.
|
|
140
|
+
|
|
141
|
+
**Fix:** Move shared types down, or introduce an interface owned by the lower layer and implemented above.
|
|
142
|
+
|
|
143
|
+
**Verify:** Add a dependency-direction fitness test (e.g. dependency-cruiser, ArchUnit) and run it in CI.
|
|
144
|
+
|
|
145
|
+
**Acceptance:** No import from data/service layers into presentation layers.
|
|
146
|
+
|
|
147
|
+
**Caveats / false-positive notes:** Layers are inferred from folder names (controllers, services, repositories...). Verify your real layering.
|
|
148
|
+
|
|
149
|
+
**References:** https://c4model.com/
|
|
150
|
+
|
|
151
|
+
### AS-OPS-001#001 - No CI pipeline configuration found
|
|
152
|
+
|
|
153
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
154
|
+
|---|---|---|---|---|
|
|
155
|
+
| medium | medium | operability | S | DevOps |
|
|
156
|
+
|
|
157
|
+
**Evidence**
|
|
158
|
+
- [unknown] `.` - `No GitHub Actions, GitLab CI, Azure Pipelines, Jenkins or CircleCI files found`
|
|
159
|
+
|
|
160
|
+
**Impact:** Regressions and architecture drift are not caught automatically.
|
|
161
|
+
|
|
162
|
+
**Why it matters:** Automated gates are the cheapest enforcement of architectural rules.
|
|
163
|
+
|
|
164
|
+
**Fix:** Add CI that builds, tests, lints and runs dependency/secret scans on every pull request.
|
|
165
|
+
|
|
166
|
+
**Verify:** Open a PR and confirm the pipeline runs.
|
|
167
|
+
|
|
168
|
+
**Acceptance:** A required status check runs build + tests on every PR.
|
|
169
|
+
|
|
170
|
+
**Caveats / false-positive notes:** CI may live outside this repository.
|
|
171
|
+
|
|
172
|
+
### AS-OPS-002#001 - No test files found
|
|
173
|
+
|
|
174
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
175
|
+
|---|---|---|---|---|
|
|
176
|
+
| medium | medium | maintainability | L | application developer |
|
|
177
|
+
|
|
178
|
+
**Evidence**
|
|
179
|
+
- [unknown] `.` - `No test/, tests/, __tests__, *.test.*, *.spec.* or *_test.* files found`
|
|
180
|
+
|
|
181
|
+
**Impact:** Refactoring and modernization are high-risk without a safety net.
|
|
182
|
+
|
|
183
|
+
**Why it matters:** Tests are the precondition for safe evolution.
|
|
184
|
+
|
|
185
|
+
**Fix:** Add characterization tests around critical paths before changing them.
|
|
186
|
+
|
|
187
|
+
**Verify:** Run the suite in CI and track coverage trend.
|
|
188
|
+
|
|
189
|
+
**Acceptance:** Critical user journeys have automated tests that run in CI.
|
|
190
|
+
|
|
191
|
+
**Caveats / false-positive notes:** Tests may live in another repository.
|
|
192
|
+
|
|
193
|
+
### AS-OPS-003#001 - Container runs as root
|
|
194
|
+
|
|
195
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
196
|
+
|---|---|---|---|---|
|
|
197
|
+
| medium | high | security | S | DevOps |
|
|
198
|
+
|
|
199
|
+
**Classification:** CWE-250, OWASP A05:2021
|
|
200
|
+
|
|
201
|
+
**Evidence**
|
|
202
|
+
- [observed] `Dockerfile:1-4` - `no USER instruction`
|
|
203
|
+
|
|
204
|
+
**Impact:** A compromised process has root inside the container, easing escape and file tampering.
|
|
205
|
+
|
|
206
|
+
**Why it matters:** Non-root containers are baseline hardening.
|
|
207
|
+
|
|
208
|
+
**Fix:** Create an unprivileged user and add `USER <name>` before the entrypoint.
|
|
209
|
+
|
|
210
|
+
**Verify:** `docker run --rm image id` shows a non-zero uid.
|
|
211
|
+
|
|
212
|
+
**Acceptance:** Final image stage runs as a non-root user.
|
|
213
|
+
|
|
214
|
+
**Caveats / false-positive notes:** Some build-only stages legitimately use root; only the final stage matters.
|
|
215
|
+
|
|
216
|
+
**References:** https://docs.docker.com/build/building/best-practices/#user
|
|
217
|
+
|
|
218
|
+
### AS-SUP-001#001 - Dependency manifest without lockfile
|
|
219
|
+
|
|
220
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
221
|
+
|---|---|---|---|---|
|
|
222
|
+
| medium | high | supply-chain | S | application developer |
|
|
223
|
+
|
|
224
|
+
**Classification:** CWE-1357, OWASP A06:2021
|
|
225
|
+
|
|
226
|
+
**Evidence**
|
|
227
|
+
- [observed] `package.json` - `no lockfile next to or above this package.json`
|
|
228
|
+
|
|
229
|
+
**Impact:** Installs are not reproducible; a compromised new release can enter automatically.
|
|
230
|
+
|
|
231
|
+
**Why it matters:** Lockfiles pin the exact dependency tree that was tested.
|
|
232
|
+
|
|
233
|
+
**Fix:** Commit the lockfile and install with `npm ci` (or equivalent) in CI.
|
|
234
|
+
|
|
235
|
+
**Verify:** CI uses a frozen/locked install.
|
|
236
|
+
|
|
237
|
+
**Acceptance:** Every manifest has a committed lockfile.
|
|
238
|
+
|
|
239
|
+
**Caveats / false-positive notes:** Workspaces may keep a single lockfile at the repo root (checked).
|
|
240
|
+
|
|
241
|
+
### AS-SUP-002#001 - Unpinned dependency ranges ("latest" or "*")
|
|
242
|
+
|
|
243
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
244
|
+
|---|---|---|---|---|
|
|
245
|
+
| medium | high | supply-chain | S | application developer |
|
|
246
|
+
|
|
247
|
+
**Classification:** CWE-1357, OWASP A06:2021
|
|
248
|
+
|
|
249
|
+
**Evidence**
|
|
250
|
+
- [observed] `package.json` - `express: latest`
|
|
251
|
+
|
|
252
|
+
**Impact:** Any future release, including a malicious one, is accepted.
|
|
253
|
+
|
|
254
|
+
**Why it matters:** Unbounded ranges defeat review and reproducibility.
|
|
255
|
+
|
|
256
|
+
**Fix:** Use a bounded semver range and rely on the lockfile plus automated update PRs.
|
|
257
|
+
|
|
258
|
+
**Verify:** Manifest scan shows no "latest" or "*".
|
|
259
|
+
|
|
260
|
+
**Acceptance:** No dependency uses latest or *.
|
|
261
|
+
|
|
262
|
+
**Caveats / false-positive notes:** None known.
|
|
263
|
+
|
|
264
|
+
### AS-DOC-001#001 - No README at repository root
|
|
265
|
+
|
|
266
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
267
|
+
|---|---|---|---|---|
|
|
268
|
+
| low | high | developer-experience | S | tech lead |
|
|
269
|
+
|
|
270
|
+
**Evidence**
|
|
271
|
+
- [observed] `.` - `README* not found`
|
|
272
|
+
|
|
273
|
+
**Impact:** New contributors cannot find purpose, setup, or architecture overview.
|
|
274
|
+
|
|
275
|
+
**Why it matters:** Docs drift starts when the entry point is missing.
|
|
276
|
+
|
|
277
|
+
**Fix:** Add a README with purpose, setup, run, test, and an architecture section.
|
|
278
|
+
|
|
279
|
+
**Verify:** A new developer runs the project from the README alone.
|
|
280
|
+
|
|
281
|
+
**Acceptance:** README exists and setup steps were validated on a clean machine.
|
|
282
|
+
|
|
283
|
+
**Caveats / false-positive notes:** None known.
|
|
284
|
+
|
|
285
|
+
### AS-SUP-003#001 - Container base image not pinned
|
|
286
|
+
|
|
287
|
+
| Severity | Confidence | Category | Effort | Owner |
|
|
288
|
+
|---|---|---|---|---|
|
|
289
|
+
| low | medium | supply-chain | S | DevOps |
|
|
290
|
+
|
|
291
|
+
**Classification:** CWE-1357, OWASP A06:2021
|
|
292
|
+
|
|
293
|
+
**Evidence**
|
|
294
|
+
- [observed] `Dockerfile` - `base image not pinned to a version or digest`
|
|
295
|
+
|
|
296
|
+
**Impact:** Builds are not reproducible and can silently pick up a compromised or breaking image.
|
|
297
|
+
|
|
298
|
+
**Why it matters:** Pinning is a core supply-chain control.
|
|
299
|
+
|
|
300
|
+
**Fix:** Pin to a specific version tag, ideally with a digest, and update via automated PRs.
|
|
301
|
+
|
|
302
|
+
**Verify:** Rebuild twice and compare image digests.
|
|
303
|
+
|
|
304
|
+
**Acceptance:** All FROM lines specify an explicit version or digest.
|
|
305
|
+
|
|
306
|
+
**Caveats / false-positive notes:** Multi-stage references to earlier stages are not images.
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
## Scope and blind spots
|
|
310
|
+
|
|
311
|
+
- Runtime behaviour, deployed topology, and data volumes are not observable from source alone.
|
|
312
|
+
- Dependency edges are module-level. JS/TS uses relative imports. Python uses the top package name. Go, Java, Kotlin, C#, and Rust match an import suffix to a module path. Dynamic imports, path aliases, and DI wiring may be missed. PHP, Ruby, Swift, and Dart are detected and not graphed.
|
|
313
|
+
|
|
314
|
+
Skipped: {"ignoredDirs":0,"tooLarge":0,"binary":0,"symlinks":0,"overBudget":0,"excluded":0}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline' https://cdn.jsdelivr.net; connect-src https://cdn.jsdelivr.net; img-src data:; base-uri 'none'; form-action 'none'">
|
|
7
|
+
<meta name="color-scheme" content="light dark">
|
|
8
|
+
<script>try{if(localStorage.getItem("as-theme")==="dark")document.documentElement.dataset.theme="dark"}catch(e){}</script>
|
|
9
|
+
<meta name="generator" content="ArchSutra AI">
|
|
10
|
+
<title>Current State (observed)</title>
|
|
11
|
+
<style>
|
|
12
|
+
:root{--bg:#fbfbfd;--card:#fff;--soft:#f2f3f8;--text:#15181e;--muted:#565e6e;--line:#e1e4ec;--accent:#4338ca;--crit:#b42318;--high:#c2410c;--med:#8a5a00;--low:#1d4ed8;--info:#565e6e;--ok:#17794a;color-scheme:light}
|
|
13
|
+
html[data-theme=dark]{--bg:#0c0f14;--card:#131820;--soft:#1a202a;--text:#e8ebf2;--muted:#a2abbb;--line:#262e3b;--accent:#a5a8ff;--crit:#ff8a80;--high:#ffab70;--med:#f0c36a;--low:#8fb4ff;--info:#a2abbb;--ok:#5fd39a;color-scheme:dark}
|
|
14
|
+
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.6 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
|
|
15
|
+
a{color:var(--accent)}code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}
|
|
16
|
+
:not(pre)>code{background:var(--soft);border:1px solid var(--line);padding:.1em .35em;border-radius:6px;overflow-wrap:anywhere}
|
|
17
|
+
.wrap{max-width:1000px;margin:0 auto;padding:24px 20px 56px}
|
|
18
|
+
header.top{border-bottom:1px solid var(--line);background:var(--card)}header.top .wrap{padding-block:18px}
|
|
19
|
+
h1{font-size:clamp(1.6rem,3vw,2.2rem);letter-spacing:-.02em;margin:.1em 0}h2{font-size:1.35rem;margin:2em 0 .6em;padding-top:1em;border-top:1px solid var(--line)}h3{margin:0;font-size:1.02rem}
|
|
20
|
+
.muted{color:var(--muted)}.nav a{margin-right:14px}.lede{color:var(--muted);margin:.2em 0 0}
|
|
21
|
+
.notice{margin:16px 0;padding:12px 16px;border:1px solid var(--line);background:var(--soft);border-radius:10px}
|
|
22
|
+
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin:16px 0}
|
|
23
|
+
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 16px}.card b{display:block;font-size:1.8rem;line-height:1.1}.card span{color:var(--muted);font-size:.85rem}
|
|
24
|
+
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--card);margin:12px 0}table{border-collapse:collapse;width:100%;font-size:.93rem}
|
|
25
|
+
th,td{text-align:left;vertical-align:top;padding:9px 13px;border-bottom:1px solid var(--line)}th{background:var(--soft)}tr:last-child td{border-bottom:0}
|
|
26
|
+
.badge{display:inline-block;padding:1px 9px;border-radius:999px;border:1px solid currentColor;font-size:.78rem;font-weight:650;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}
|
|
27
|
+
.sev-critical{color:var(--crit)}.sev-high{color:var(--high)}.sev-medium{color:var(--med)}.sev-low{color:var(--low)}.sev-info{color:var(--info)}
|
|
28
|
+
.r-strong{color:var(--ok)}.r-adequate{color:var(--med)}.r-weak{color:var(--high)}.r-critical{color:var(--crit)}.r-no,.r-not{color:var(--muted)}
|
|
29
|
+
.filters{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.filters button{font:inherit;font-size:.88rem;padding:5px 12px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--text);cursor:pointer}
|
|
30
|
+
.filters button[aria-pressed=true]{background:var(--accent);color:var(--bg);border-color:var(--accent)}
|
|
31
|
+
details.finding{background:var(--card);border:1px solid var(--line);border-radius:12px;margin:10px 0;padding:4px 16px}
|
|
32
|
+
details.finding summary{cursor:pointer;padding:10px 0;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.fid{font-family:ui-monospace,monospace;font-size:.82rem;color:var(--muted)}
|
|
33
|
+
.fbody{padding:4px 0 14px}.fbody dt{font-weight:650;margin-top:.8em}.fbody dd{margin:.15em 0 0}.ev{list-style:none;padding:0;margin:.2em 0}.ev li{margin:.2em 0}
|
|
34
|
+
pre{background:var(--soft);border:1px solid var(--line);border-radius:10px;padding:12px 14px;overflow:auto}
|
|
35
|
+
figure.diagram{margin:12px 0;padding:14px;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow-x:auto}pre.mermaid{background:transparent;border:0;padding:0;text-align:center}
|
|
36
|
+
footer{margin-top:40px;padding-top:16px;border-top:1px solid var(--line);color:var(--muted);font-size:.85rem}
|
|
37
|
+
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:4px}
|
|
38
|
+
.tt{float:right;font:inherit;font-size:.85rem;padding:4px 12px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--text);cursor:pointer}
|
|
39
|
+
@media print{.tt{display:none}.filters,.nav{display:none}details.finding{break-inside:avoid}details.finding:not([open])>*{display:block}}
|
|
40
|
+
</style>
|
|
41
|
+
</head>
|
|
42
|
+
<body>
|
|
43
|
+
<header class="top"><div class="wrap"><button class="tt" type="button" aria-label="Toggle light and dark theme" onclick="var d=document.documentElement,n=d.dataset.theme==='dark'?'light':'dark';if(n==='dark')d.dataset.theme='dark';else delete d.dataset.theme;try{localStorage.setItem('as-theme',n)}catch(e){}if(document.querySelector('pre.mermaid'))location.reload()">Theme</button><nav class="nav" aria-label="Report pages"><a href="index.html">Overview</a><a href="audit-report.html">Audit report</a><a href="current-state.html">Current state</a></nav><h1>Current State (observed)</h1><p class="lede">Generated by ArchSutra AI. Deterministic static scan, read-only.</p></div></header>
|
|
44
|
+
<main class="wrap">
|
|
45
|
+
|
|
46
|
+
<h2 style="border-top:0;margin-top:0">Stack</h2>
|
|
47
|
+
<div class="table-wrap"><table><tbody><tr><th scope="row">Ecosystems</th><td>TypeScript, Node.js</td></tr><tr><th scope="row">Frameworks (from manifests)</th><td>Express</td></tr><tr><th scope="row">Datastores / messaging (from manifests)</th><td>PostgreSQL</td></tr><tr><th scope="row">Infrastructure files</th><td>Docker</td></tr><tr><th scope="row">Entry points</th><td>none detected</td></tr></tbody></table></div>
|
|
48
|
+
<h2>System context (C4 level 1, inferred from manifests)</h2>
|
|
49
|
+
<figure class="diagram"><pre class="mermaid">flowchart TB
|
|
50
|
+
user(["Users / Clients"])
|
|
51
|
+
system["System under review<br/>TypeScript, Node.js"]
|
|
52
|
+
user --> system
|
|
53
|
+
ds0[("PostgreSQL")]
|
|
54
|
+
system --> ds0
|
|
55
|
+
inf0{{"Docker"}}
|
|
56
|
+
inf0 -.-> system</pre><figcaption class="muted">Diagram source is shown if it cannot be rendered offline.</figcaption></figure>
|
|
57
|
+
<h2>Modules and dependencies (observed imports)</h2>
|
|
58
|
+
<figure class="diagram"><pre class="mermaid">flowchart LR
|
|
59
|
+
src_services["src/services<br/>2 files, 9 lines"]
|
|
60
|
+
src_api["src/api<br/>1 files, 3 lines"]
|
|
61
|
+
src_db["src/db<br/>1 files, 3 lines"]
|
|
62
|
+
src_api -->|1| src_db
|
|
63
|
+
src_db -->|1| src_api</pre><figcaption class="muted">Numbers on arrows are import counts.</figcaption></figure>
|
|
64
|
+
<div class="table-wrap"><table><thead><tr><th scope="col">Module</th><th scope="col">Files</th><th scope="col">Lines</th><th scope="col">Languages</th></tr></thead><tbody><tr><td><code>src/services</code></td><td>2</td><td>9</td><td>TypeScript</td></tr><tr><td><code>src/api</code></td><td>1</td><td>3</td><td>TypeScript</td></tr><tr><td><code>src/db</code></td><td>1</td><td>3</td><td>TypeScript</td></tr></tbody></table></div>
|
|
65
|
+
<h2>Dependency cycles</h2>
|
|
66
|
+
<ul><li><code>src/api <-> src/db</code></li></ul>
|
|
67
|
+
<h2>Blind spots</h2>
|
|
68
|
+
<ul><li>Runtime behaviour, deployed topology, and data volumes are not observable from source alone.</li><li>Dependency edges are module-level. JS/TS uses relative imports. Python uses the top package name. Go, Java, Kotlin, C#, and Rust match an import suffix to a module path. Dynamic imports, path aliases, and DI wiring may be missed. PHP, Ruby, Swift, and Dart are detected and not graphed.</li></ul>
|
|
69
|
+
<footer>Review aid only. Not a certification, compliance attestation, security guarantee or legal advice. Findings marked <code>inferred</code> or <code>unknown</code> are hypotheses; absence of findings does not prove absence of problems. Secrets are redacted.</footer>
|
|
70
|
+
</main>
|
|
71
|
+
<script type="module">
|
|
72
|
+
const dark=document.documentElement.dataset.theme==='dark';
|
|
73
|
+
try{const m=(await import('https://cdn.jsdelivr.net/npm/mermaid@12.3.0/dist/mermaid.esm.min.mjs')).default;
|
|
74
|
+
m.initialize({startOnLoad:false,securityLevel:'strict',theme:'base',themeVariables:dark?{primaryColor:'#1f2340',primaryTextColor:'#e8ebf2',primaryBorderColor:'#a5a8ff',lineColor:'#a2abbb',edgeLabelBackground:'#131820',textColor:'#e8ebf2'}:{primaryColor:'#eceafd',primaryTextColor:'#15181e',primaryBorderColor:'#4338ca',lineColor:'#565e6e',edgeLabelBackground:'#ffffff',textColor:'#15181e'}});
|
|
75
|
+
await m.run({nodes:document.querySelectorAll('pre.mermaid')});}catch(e){/* offline: diagram source stays visible */}</script>
|
|
76
|
+
</body>
|
|
77
|
+
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!-- archsutra:generated -->
|
|
2
|
+
# Current State (observed)
|
|
3
|
+
|
|
4
|
+
Generated by: archsutra map (deterministic, no AI inference)
|
|
5
|
+
|
|
6
|
+
## Stack
|
|
7
|
+
|
|
8
|
+
- Ecosystems: TypeScript, Node.js
|
|
9
|
+
- Frameworks (from manifests): Express
|
|
10
|
+
- Datastores / messaging (from manifests): PostgreSQL
|
|
11
|
+
- Infrastructure files: Docker
|
|
12
|
+
- Entry points: none detected
|
|
13
|
+
|
|
14
|
+
## System context (C4 L1, inferred from manifests)
|
|
15
|
+
|
|
16
|
+
```mermaid
|
|
17
|
+
flowchart TB
|
|
18
|
+
user(["Users / Clients"])
|
|
19
|
+
system["System under review<br/>TypeScript, Node.js"]
|
|
20
|
+
user --> system
|
|
21
|
+
ds0[("PostgreSQL")]
|
|
22
|
+
system --> ds0
|
|
23
|
+
inf0{{"Docker"}}
|
|
24
|
+
inf0 -.-> system
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Modules and dependencies (C4 L2-style, observed imports)
|
|
28
|
+
|
|
29
|
+
```mermaid
|
|
30
|
+
flowchart LR
|
|
31
|
+
src_services["src/services<br/>2 files, 9 lines"]
|
|
32
|
+
src_api["src/api<br/>1 files, 3 lines"]
|
|
33
|
+
src_db["src/db<br/>1 files, 3 lines"]
|
|
34
|
+
src_api -->|1| src_db
|
|
35
|
+
src_db -->|1| src_api
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
| Module | Files | Lines | Languages |
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| `src/services` | 2 | 9 | TypeScript |
|
|
41
|
+
| `src/api` | 1 | 3 | TypeScript |
|
|
42
|
+
| `src/db` | 1 | 3 | TypeScript |
|
|
43
|
+
|
|
44
|
+
## Dependency cycles
|
|
45
|
+
|
|
46
|
+
- src/api <-> src/db
|
|
47
|
+
|
|
48
|
+
## Blind spots
|
|
49
|
+
|
|
50
|
+
- Runtime behaviour, deployed topology, and data volumes are not observable from source alone.
|
|
51
|
+
- Dependency edges are module-level. JS/TS uses relative imports. Python uses the top package name. Go, Java, Kotlin, C#, and Rust match an import suffix to a module path. Dynamic imports, path aliases, and DI wiring may be missed. PHP, Ruby, Swift, and Dart are detected and not graphed.
|