Skip to content

Commit 1ee2c85

Browse files
authored
Merge pull request #7 from Coding-Autopilot-System/hardening/enterprise-audit-20260611
feat: complete enterprise security model audit hardening
2 parents 562484d + da4148d commit 1ee2c85

30 files changed

Lines changed: 849 additions & 151 deletions

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto
2+
*.sh text eol=lf
3+
*.ps1 text eol=lf
4+
*.bicep text eol=lf
5+
*.json text eol=lf
6+
*.md text eol=lf
7+
*.yml text eol=lf
8+
*.yaml text eol=lf

.github/workflows/ci.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,47 @@ name: CI
33
on:
44
pull_request:
55
push:
6-
branches: [ main ]
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ci-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
714

815
jobs:
916
lint:
1017
runs-on: ubuntu-latest
18+
timeout-minutes: 10
1119
steps:
12-
- uses: actions/checkout@v4
20+
- name: Checkout
21+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
22+
with:
23+
persist-credentials: false
1324

1425
- name: Markdown lint
15-
uses: avto-dev/markdown-lint@v1
26+
uses: avto-dev/markdown-lint@04687db2e9b72c18a4dfce687923a8daa3e4b543 # v1
1627
with:
1728
args: 'docs/**/*.md README.md CONTRIBUTING.md SECURITY.md'
1829

1930
- name: Link check
20-
uses: lycheeverse/lychee-action@v1
31+
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1
2132
with:
2233
args: '--verbose --no-progress docs/**/*.md README.md'
2334
env:
2435
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2536

2637
- name: Verify Mermaid blocks
27-
run: |
28-
grep -rl '```mermaid' docs README.md
38+
run: grep -rl '```mermaid' docs README.md
2939

3040
- name: Validate JSON formatting
3141
run: |
32-
find impl -name '*.json' 2>/dev/null | while read f; do
33-
jq empty "$f"
34-
done
42+
find impl -name '*.json' -print0 |
43+
xargs -0 -n1 jq empty
44+
45+
- name: Install Bicep CLI
46+
run: az bicep install
47+
48+
- name: Validate repository contracts
49+
run: bash scripts/validate-repository.sh

.github/workflows/static.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
1-
# Simple workflow for deploying static content to GitHub Pages
1+
# Deploy the public documentation surface only.
22
name: Deploy static content to Pages
33

44
on:
5-
# Runs on pushes targeting the default branch
65
push:
7-
branches: ["main"]
8-
9-
# Allows you to run this workflow manually from the Actions tab
6+
branches: [main]
107
workflow_dispatch:
118

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
139
permissions:
1410
contents: read
1511
pages: write
1612
id-token: write
1713

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2014
concurrency:
21-
group: "pages"
15+
group: pages
2216
cancel-in-progress: false
2317

2418
jobs:
25-
# Single deploy job since we're just deploying
2619
deploy:
2720
environment:
2821
name: github-pages
2922
url: ${{ steps.deployment.outputs.page_url }}
3023
runs-on: ubuntu-latest
24+
timeout-minutes: 10
3125
steps:
3226
- name: Checkout
33-
uses: actions/checkout@v4
27+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
28+
with:
29+
persist-credentials: false
3430
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
31+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
32+
- name: Upload documentation artifact
33+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
3834
with:
39-
# Upload entire repository
40-
path: '.'
35+
path: docs
4136
- name: Deploy to GitHub Pages
4237
id: deployment
43-
uses: actions/deploy-pages@v4
38+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Enterprise Audit-Fix Continuation
2+
3+
**Date:** 2026-06-11
4+
**Source:** `gsd-debug` followed by `gsd-audit-fix --severity all`
5+
**Branch:** `hardening/enterprise-audit-20260611`
6+
7+
## Outcome
8+
9+
The interrupted audit was resumed after scientifically reproducing and resolving the Azure Arc Bash CRLF failure.
10+
All remaining defensible auto-fixable findings were processed sequentially and committed atomically. No validation
11+
failure occurred, so the pipeline completed F-02 through F-08.
12+
13+
## Atomic Results
14+
15+
| ID | Finding | Commit |
16+
| --- | --- | --- |
17+
| F-02 | Enforce repository contracts and resolve Arc Bash CRLF failure | `062dfff` |
18+
| F-03 | Replace Bicep stubs with a secure compilable reference baseline | `4c583c6` |
19+
| F-04 | Replace fictional policy references and define safe rollout defaults | `8ef9375` |
20+
| F-05 | Define fail-closed Azure Arc dry-run onboarding contracts | `64a4f1a` |
21+
| F-06 | Connect assets, trust boundaries, threats, controls, and residual risk | `073fa1d` |
22+
| F-07 | Define evidence ownership, integrity, collection, and failure handling | `03e79e2` |
23+
| F-08 | Add bounded Sentinel KQL references and tuning metadata | `76076e6` |
24+
25+
## Remaining Manual Work
26+
27+
- Select and approve production identity, tenant hierarchy, and deployment identities.
28+
- Validate controls against a representative live Azure and Azure Local estate.
29+
- Obtain independent compliance and legal review before assurance claims.
30+
- Choose the production SIEM automation approval model and incident containment authority.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
status: resolved
3+
trigger: arc-onboard.sh CRLF/bash syntax failure
4+
created: 2026-06-11
5+
updated: 2026-06-11
6+
---
7+
8+
# Symptoms
9+
10+
- Expected: `bash -n impl/hybrid/azure-arc/onboarding/arc-onboard.sh` exits successfully.
11+
- Actual: Bash reports a syntax error at the closing brace on line 20.
12+
- Reproduction: Run the command from the repository root on Windows or Linux Bash.
13+
14+
# Current Focus
15+
16+
- hypothesis: CRLF line endings leave a carriage return attached to the closing brace.
17+
- test: Add a repository validator that rejects CRLF in shell files and runs `bash -n`.
18+
- expecting: The validator fails before normalization and passes after LF normalization.
19+
- next_action: Complete repository-wide validation and commit the fix.
20+
21+
# Evidence
22+
23+
- timestamp: 2026-06-11
24+
observation: Format-Hex shows `0D 0A` line endings throughout arc-onboard.sh.
25+
- timestamp: 2026-06-11
26+
observation: Bash reports `syntax error near unexpected token '}'` and displays a carriage return after the tee command.
27+
28+
# Eliminated
29+
30+
- hypothesis: The brace-and-pipe Bash syntax is invalid.
31+
reason: The syntax is valid when line endings are LF.
32+
33+
# Resolution
34+
35+
- root_cause: CRLF line endings attached a carriage return to the Bash closing brace.
36+
- fix: Enforced LF through .gitattributes and normalized arc-onboard.sh.
37+
- verification: Repository validator rejects CRLF and bash -n now passes.
38+
- files_changed: .gitattributes, scripts/validate-repository.sh, arc-onboard.sh
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Enterprise Security Model Audit
2+
3+
**Date:** 2026-06-11
4+
**Source:** `gsd-audit-fix --severity all --max 8`
5+
**Scope:** Threat model, controls, Azure and hybrid design, Bicep, CI, evidence, and documentation
6+
7+
## Classification
8+
9+
| ID | Severity | Finding | Classification | Reason |
10+
| --- | --- | --- | --- | --- |
11+
| F-01 | High | CI uses mutable action tags and lacks explicit least-privilege defaults, timeouts, and concurrency controls. | Auto-fixable | Specific workflow files and objectively testable controls. |
12+
| F-02 | High | CI validates formatting only; Bicep, onboarding scripts, Mermaid files, security examples, and repository contracts are not enforced. | Auto-fixable | A repository validator and CI invocation provide a bounded fix. |
13+
| F-03 | High | Landing-zone Bicep modules return strings but deploy no resources or secure defaults. | Auto-fixable | Existing module boundaries support a compilable reference implementation. |
14+
| F-04 | High | Policy-as-code examples reference fictional policy IDs and do not define rollout safety metadata. | Auto-fixable | Existing JSON examples can use documented built-in policy IDs and safe enforcement defaults. |
15+
| F-05 | Medium | Azure Arc onboarding examples accept unvalidated input, write ambiguous logs, and lack an explicit dry-run contract. | Auto-fixable | Two bounded scripts have clear safety behavior and syntax validation. |
16+
| F-06 | High | The service model has no formal threat model connecting assets, trust boundaries, threats, controls, and residual risk. | Auto-fixable | A public-safe architecture threat model can be added and cross-linked. |
17+
| F-07 | High | Audit evidence guidance does not define ownership, integrity, access, collection automation, or evidence failure handling. | Auto-fixable | The evidence contract can be made explicit in the existing audit document. |
18+
| F-08 | Medium | Sentinel analytic examples contain TODO queries, so detection claims are not testable or operationally credible. | Auto-fixable | Existing examples can contain safe, bounded KQL and tuning metadata. |
19+
20+
## Manual-only Findings
21+
22+
| ID | Severity | Finding | Reason |
23+
| --- | --- | --- | --- |
24+
| M-01 | High | Select the production identity, tenant hierarchy, and least-privilege deployment identities. | Requires organization-specific identity and management-group decisions. |
25+
| M-02 | High | Validate controls against a live Azure and Azure Local estate. | Requires tenant access, representative workloads, and approved test windows. |
26+
| M-03 | High | Obtain independent compliance and legal review before claiming certification or regulatory sufficiency. | Requires qualified external assurance and organization-specific obligations. |
27+
| M-04 | Medium | Choose the production SIEM automation approval model and incident containment authority. | Requires risk appetite and operating-model decisions. |
28+
29+
## Stop Conditions
30+
31+
- Stop after the first failed validation and record unattempted findings.
32+
- Do not deploy resources or mutate a live Azure tenant.
33+
- Do not claim certification, compliance, or production readiness from reference artifacts alone.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Enterprise Audit Verification
2+
3+
**Date:** 2026-06-11
4+
**Branch:** `hardening/enterprise-audit-20260611`
5+
**Pipeline status:** Complete for all auto-fixable findings
6+
7+
## Result
8+
9+
| ID | Finding | Status | Commit |
10+
| --- | --- | --- | --- |
11+
| F-01 | Harden workflow trust boundaries | Fixed and validated | `40c053a` |
12+
| F-02 | Enforce repository contracts in CI | Fixed and validated | `062dfff` |
13+
| F-03 | Deployable secure Bicep reference | Fixed and validated | `4c583c6` |
14+
| F-04 | Credible policy-as-code examples | Fixed and validated | `8ef9375` |
15+
| F-05 | Safe Azure Arc onboarding contract | Fixed and validated | `64a4f1a` |
16+
| F-06 | Formal threat model | Fixed and validated | `073fa1d` |
17+
| F-07 | Evidence integrity contract | Fixed and validated | `03e79e2` |
18+
| F-08 | Testable Sentinel detections | Fixed and validated | `76076e6` |
19+
20+
## CRLF Debug Resolution
21+
22+
`bash -n impl/hybrid/azure-arc/onboarding/arc-onboard.sh` failed because the committed CRLF line endings attached a
23+
carriage return to the closing brace. The repository now enforces LF for shell files, validates line endings and Bash
24+
syntax, and records the resolved GSD debug session in `.planning/debug/arc-onboard-crlf-bash-syntax.md`.
25+
26+
## Validation
27+
28+
- Repository contract validator passed.
29+
- Bash syntax and Azure Arc dry-run behavior passed.
30+
- PowerShell onboarding script parsed successfully.
31+
- Landing-zone Bicep compiled successfully.
32+
- JSON policy and Sentinel examples parsed successfully.
33+
- Workflow YAML parsed successfully.
34+
- Markdown documentation checks passed.
35+
- Third-party actions are pinned to immutable SHAs.
36+
- `git diff --check` passed.
37+
38+
## Manual-only Findings
39+
40+
- Select production identity, tenant hierarchy, and deployment identities.
41+
- Validate controls against a representative live Azure and Azure Local estate.
42+
- Obtain independent compliance and legal review before making assurance claims.
43+
- Choose production SIEM automation approval and containment authority.
44+
45+
## Assurance Boundary
46+
47+
No resources were deployed and no live Azure tenant was mutated. Reference artifacts require tenant-specific design,
48+
approvals, testing, and independent assurance before production use.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ pretending to be those services.
8080
- Runbooks: [`docs/20-runbooks/README.md`](docs/20-runbooks/README.md)
8181
- Templates: [`docs/21-templates/README.md`](docs/21-templates/README.md)
8282
- Diagrams: [`docs/22-diagrams/README.md`](docs/22-diagrams/README.md)
83+
- Threat model: [`docs/23-threat-model.md`](docs/23-threat-model.md)
8384
- Static site: [`docs/index.html`](docs/index.html)
8485
- [Wiki](https://github.com/Coding-Autopilot-System/cloud-security-service-model/wiki) - overview, service definition, architecture, metrics & compliance
8586

docs/04-reference-architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ Shared responsibility overview: [`22-diagrams/shared-responsibility.mmd`](22-dia
3535
## Related docs
3636
- Architecture principles: [`03-architecture-principles.md`](03-architecture-principles.md)
3737
- Hybrid/Azure Local: [`18-hybrid-azure-local.md`](18-hybrid-azure-local.md)
38+
- Threat model: [`23-threat-model.md`](23-threat-model.md)

docs/09-risk-management.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525
## Related docs
2626
- Audit readiness: [`10-audit-readiness.md`](10-audit-readiness.md)
2727
- Exception handling: [`13-exception-handling.md`](13-exception-handling.md)
28+
- Threat model: [`23-threat-model.md`](23-threat-model.md)

0 commit comments

Comments
 (0)