@metasession.co/devaudit-cli 0.1.29 → 0.1.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metasession.co/devaudit-cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "DevAudit CLI — installs, syncs, and operates the Metasession SDLC across consumer projects.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.8.2",
36
- "@metasession.co/devaudit-plugin-sdk": "^0.1.29",
36
+ "@metasession.co/devaudit-plugin-sdk": "^0.1.31",
37
37
  "commander": "^12.1.0",
38
38
  "consola": "^3.2.3",
39
39
  "env-paths": "^3.0.0",
@@ -0,0 +1,91 @@
1
+ ---
2
+ title: "AI Use Disclosure (deployer-facing)"
3
+ provider: "REPLACE — legal name of the AI system provider"
4
+ intended_purpose: "REPLACE — one-line description of intended use"
5
+ last_reviewed_at: "REPLACE — YYYY-MM-DD"
6
+ review_cadence_days: 180
7
+ risk_class: "REPLACE — minimal | limited | high | unacceptable"
8
+ ---
9
+
10
+ > ⚠️ **STARTER TEMPLATE — REPLACE BEFORE GOING TO PRODUCTION.**
11
+ > This file was auto-installed by `devaudit install` as a starting point.
12
+ > It does **not** describe your project's actual AI use. Edit and commit.
13
+ > Auditors will reject unedited stubs. See `docs/governance-templates.md` for guidance.
14
+
15
+ # AI Use Disclosure — Provision of information to deployers
16
+
17
+ **Framework coverage:** `EUAIA.Art-13` (Transparency and provision of information to deployers)
18
+
19
+ **Evidence type:** `ai_disclosure` · **Cadence:** refresh every 180 days, or whenever an AI tool / model / prompt-class is added or substantively changed.
20
+
21
+ > The EU AI Act requires providers to give deployers (the people who put the AI system into use in their professional activity) **clear, comprehensive, accurate and unambiguous** information about the system's capabilities, limitations, and intended use. This file is that disclosure for our project — both for AI we develop and for third-party AI we incorporate.
22
+
23
+ ## 1. Intended purpose
24
+
25
+ - **What the AI system does:** REPLACE
26
+ - **Intended use cases:** REPLACE
27
+ - **Foreseeable misuse / out-of-scope use cases:** REPLACE
28
+
29
+ ## 2. Risk classification
30
+
31
+ - **Annex III high-risk category match:** REPLACE — none / list applicable categories
32
+ - **Final risk class (per Title III):** REPLACE — minimal / limited / high / unacceptable
33
+ - **Reasoning:** REPLACE
34
+
35
+ ## 3. AI tools and models in use
36
+
37
+ Add one row per AI tool / model / API. Delete this template row before your first audit.
38
+
39
+ | Tool / model | Vendor | Use case | Inputs (data classes) | Outputs | Risk class | Provider docs |
40
+ |---|---|---|---|---|---|---|
41
+ | REPLACE — e.g. GPT-4o | OpenAI | Code suggestion in IDE | Source code, no PII | Code suggestions | Limited | https://… |
42
+ | REPLACE | | | | | | |
43
+
44
+ ## 4. Human oversight (Art. 14)
45
+
46
+ - **Where humans intervene in the AI loop:** REPLACE — e.g. "Every AI-suggested change goes through a four-eyes code review before merge"
47
+ - **Authority of the human reviewer:** REPLACE — can they reject / override / stop the system? Document the path
48
+ - **Cross-reference to four-eyes release approval:** all releases require an approved-by audit event in the portal (closes `EUAIA.Art-14`)
49
+
50
+ ## 5. Capabilities and limitations
51
+
52
+ - **Known limitations:** REPLACE — failure modes, training data cut-off, hallucination risk
53
+ - **Accuracy / robustness metrics:** REPLACE — link to test reports / benchmark results
54
+ - **Conditions under which performance degrades:** REPLACE
55
+
56
+ ## 6. Data, training, validation
57
+
58
+ - **Training data provenance (if we train):** REPLACE — sources, licensing, consent
59
+ - **Fine-tuning, RAG, prompt engineering used:** REPLACE
60
+ - **Data flowing to third-party AI providers:** REPLACE — list each provider + what's sent + DPA / SCC reference (cross-link to ROPA)
61
+
62
+ ## 7. Logging and traceability (Art. 12)
63
+
64
+ - **What we log:** REPLACE — prompts, completions, user/agent identity, timestamp
65
+ - **Where logs live:** REPLACE — link to portal `audit_log` evidence pipeline
66
+ - **Retention:** REPLACE
67
+ - **Closes `EUAIA.Art-12` via the `audit_log` snapshot uploaded each release.**
68
+
69
+ ## 8. Deployer obligations
70
+
71
+ - **What deployers must do to use the system safely:** REPLACE — link to operator runbook
72
+ - **Notification of substantial modifications:** REPLACE — process
73
+
74
+ ## 9. Sign-off
75
+
76
+ | Role | Name | Date |
77
+ |---|---|---|
78
+ | Provider responsible | REPLACE | REPLACE |
79
+ | AI compliance reviewer | REPLACE | REPLACE |
80
+
81
+ ## Sources
82
+
83
+ - [EU AI Act (Regulation 2024/1689)](https://eur-lex.europa.eu/eli/reg/2024/1689/oj) — especially Art. 9–15 (high-risk requirements) and Title IV (transparency)
84
+ - [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework)
85
+ - [Anthropic Responsible Scaling Policy](https://www.anthropic.com/news/anthropics-responsible-scaling-policy) (example provider disclosure)
86
+
87
+ ## Review log
88
+
89
+ | Date | Reviewer | Changes |
90
+ |---|---|---|
91
+ | REPLACE — YYYY-MM-DD | REPLACE | Initial AI disclosure authored from starter template |
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: "Data Protection Impact Assessment (DPIA)"
3
+ processing_activity: "REPLACE — short name of the activity assessed"
4
+ controller: "REPLACE — legal name of the controller"
5
+ last_reviewed_at: "REPLACE — YYYY-MM-DD"
6
+ review_cadence_days: 365
7
+ risk_level: "REPLACE — low | medium | high"
8
+ ---
9
+
10
+ > ⚠️ **STARTER TEMPLATE — REPLACE BEFORE GOING TO PRODUCTION.**
11
+ > This file was auto-installed by `devaudit install` as a starting point.
12
+ > It does **not** describe your project's actual data protection risks. Edit and commit.
13
+ > Auditors will reject unedited stubs. See `docs/governance-templates.md` for guidance.
14
+
15
+ # Data Protection Impact Assessment
16
+
17
+ **Framework coverage:** `GDPR.Art-35` (Data protection impact assessment)
18
+
19
+ **Evidence type:** `dpia` · **Cadence:** refresh every 365 days, or whenever the processing materially changes.
20
+
21
+ > A DPIA is **mandatory** for processing likely to result in high risk to data subjects: large-scale special-category data, systematic monitoring, automated decision-making with legal effect, etc. See Art. 35(3) and your supervisory authority's "blacklist" guidance.
22
+
23
+ ## 1. Description of the processing
24
+
25
+ - **Activity name:** REPLACE
26
+ - **Nature, scope, context, purposes:** REPLACE — what data is processed, how, why, for whom, at what scale
27
+ - **Data flow diagram or reference:** REPLACE — link to architecture doc / threat model
28
+ - **Cross-reference to ROPA:** `compliance/governance/ropa.md` activity REPLACE
29
+
30
+ ## 2. Necessity and proportionality
31
+
32
+ - **Lawful basis (Art. 6):** REPLACE
33
+ - **Special-category basis (Art. 9), if applicable:** REPLACE
34
+ - **Less-intrusive alternatives considered:** REPLACE
35
+ - **Data minimisation:** REPLACE — what's not collected and why
36
+ - **Retention justification:** REPLACE
37
+ - **Data subject rights — how exercised:** REPLACE — link to SAR procedure, rectification, erasure, portability
38
+
39
+ ## 3. Risks to rights and freedoms
40
+
41
+ For each risk, populate one row. Add or remove rows to fit your assessment.
42
+
43
+ | # | Risk | Likelihood (1–3) | Severity (1–3) | Inherent risk | Existing controls | Residual risk | Acceptable? |
44
+ |---|---|---|---|---|---|---|---|
45
+ | 1 | REPLACE — e.g. unauthorised access to user accounts | REPLACE | REPLACE | REPLACE | REPLACE — MFA, RBAC, encryption-at-rest | REPLACE | REPLACE Y/N |
46
+ | 2 | REPLACE | | | | | | |
47
+
48
+ ## 4. Measures to address the risks
49
+
50
+ - **Technical measures:** REPLACE — encryption, pseudonymisation, access controls, logging
51
+ - **Organisational measures:** REPLACE — training, policies, contractual safeguards
52
+ - **Residual high risk?** REPLACE — if YES, you must consult the supervisory authority (Art. 36) **before** processing begins. Document the consultation outcome.
53
+
54
+ ## 5. Consultation
55
+
56
+ - **DPO opinion:** REPLACE — name, date, conclusion
57
+ - **Data subjects / representatives consulted:** REPLACE — describe or document why not
58
+ - **Supervisory authority prior consultation:** REPLACE — required only when residual high risk remains
59
+
60
+ ## 6. Sign-off
61
+
62
+ | Role | Name | Date | Decision |
63
+ |---|---|---|---|
64
+ | Controller | REPLACE | REPLACE | REPLACE — approved / rejected / conditional |
65
+ | DPO | REPLACE | REPLACE | REPLACE |
66
+ | Technical lead | REPLACE | REPLACE | REPLACE |
67
+
68
+ ## Sources
69
+
70
+ - [EDPB DPIA guidelines (WP248 rev.01)](https://edpb.europa.eu/our-work-tools/our-documents/guidelines/)
71
+ - [ICO DPIA template](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/accountability-and-governance/data-protection-impact-assessments-dpias/)
72
+ - [CNIL PIA software](https://www.cnil.fr/en/open-source-pia-software-helps-carry-out-data-protection-impact-assessment)
73
+
74
+ ## Review log
75
+
76
+ | Date | Reviewer | Changes |
77
+ |---|---|---|
78
+ | REPLACE — YYYY-MM-DD | REPLACE | Initial DPIA authored from starter template |
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: "Incident Report"
3
+ incident_id: "REPLACE — e.g. INC-2026-001"
4
+ severity: "REPLACE — low | medium | high | critical"
5
+ detected_at: "REPLACE — ISO-8601 with timezone"
6
+ resolved_at: "REPLACE — ISO-8601 or 'ongoing'"
7
+ involves_personal_data: "REPLACE — true | false"
8
+ reported_to_supervisory_authority: "REPLACE — true | false | n/a"
9
+ notification_window_72h: "REPLACE — within | outside | n/a"
10
+ last_reviewed_at: "REPLACE — YYYY-MM-DD"
11
+ ---
12
+
13
+ > ⚠️ **STARTER TEMPLATE — REPLACE BEFORE GOING TO PRODUCTION.**
14
+ > This file was auto-installed by `devaudit install` as a starting point.
15
+ > If you reach for this file it's because something **happened** — replace this banner
16
+ > with the actual incident details. One incident per file (rename to
17
+ > `incident-report-<id>.md` if you keep multiple). Auditors will reject unedited stubs.
18
+
19
+ # Incident Report
20
+
21
+ **Framework coverage:**
22
+
23
+ - `ISO29119.3.5.4` (Test incident report)
24
+ - `SOC2.CC7.2` (System monitoring and incident response)
25
+ - `GDPR.Art-33` (Notification of a personal data breach to the supervisory authority — 72h)
26
+ - `GDPR.Art-34` (Communication of a personal data breach to the data subject)
27
+
28
+ **Evidence type:** `incident_report` · One artefact can satisfy multiple clauses depending on its scope (test defect, ops incident, personal-data breach).
29
+
30
+ ## 1. Summary
31
+
32
+ - **Incident ID:** REPLACE
33
+ - **Severity:** REPLACE — low / medium / high / critical
34
+ - **One-line description:** REPLACE
35
+ - **Detected at:** REPLACE — when was it first noticed
36
+ - **Resolved at:** REPLACE — or "ongoing"
37
+ - **Duration:** REPLACE
38
+
39
+ ## 2. Personal data scope (GDPR triage)
40
+
41
+ | Question | Answer |
42
+ |---|---|
43
+ | Did the incident involve personal data? | REPLACE — Y / N |
44
+ | If Y: estimated number of data subjects affected | REPLACE |
45
+ | If Y: categories of personal data involved | REPLACE |
46
+ | If Y: likely consequences for data subjects | REPLACE |
47
+ | **Notify supervisory authority (Art. 33)?** | REPLACE — required if Y and risk to rights/freedoms |
48
+ | **Notify data subjects (Art. 34)?** | REPLACE — required if high risk to rights/freedoms |
49
+ | 72-hour notification window: | REPLACE — within / outside / n/a; if outside, explain delay |
50
+
51
+ ## 3. Timeline
52
+
53
+ | Time (UTC) | Event |
54
+ |---|---|
55
+ | REPLACE — ISO-8601 | REPLACE — first signal observed |
56
+ | REPLACE | REPLACE — detection escalated to on-call |
57
+ | REPLACE | REPLACE — incident channel opened, IC assigned |
58
+ | REPLACE | REPLACE — mitigation deployed |
59
+ | REPLACE | REPLACE — incident declared resolved |
60
+ | REPLACE | REPLACE — supervisory authority notified (if applicable) |
61
+ | REPLACE | REPLACE — data subjects notified (if applicable) |
62
+
63
+ ## 4. Root cause
64
+
65
+ - **What happened:** REPLACE — technical narrative
66
+ - **Why it happened:** REPLACE — 5-whys or equivalent
67
+ - **Why it wasn't caught earlier:** REPLACE — gap in monitoring / testing / review
68
+
69
+ ## 5. Impact
70
+
71
+ - **Users affected:** REPLACE — count + segment
72
+ - **Data confidentiality / integrity / availability impact:** REPLACE
73
+ - **Financial / reputational:** REPLACE
74
+ - **Regulatory:** REPLACE
75
+
76
+ ## 6. Containment, mitigation, and recovery
77
+
78
+ - **Containment actions:** REPLACE
79
+ - **Mitigation deployed (link PRs):** REPLACE
80
+ - **Recovery actions:** REPLACE
81
+ - **Verification that the incident is resolved:** REPLACE
82
+
83
+ ## 7. Communications
84
+
85
+ - **Internal:** REPLACE — who was notified, when
86
+ - **Customer / data subjects:** REPLACE — channel, content (attach), timing
87
+ - **Supervisory authority:** REPLACE — body, reference number, content (attach)
88
+ - **Public statement:** REPLACE — link if any
89
+
90
+ ## 8. Lessons learned and follow-ups
91
+
92
+ - **What worked well:** REPLACE
93
+ - **What didn't:** REPLACE
94
+ - **Follow-up actions (issue links, owners, due dates):** REPLACE — file GitHub issues; one row per action
95
+ - [ ] REPLACE — owner @REPLACE — due REPLACE
96
+ - [ ] REPLACE — owner @REPLACE — due REPLACE
97
+
98
+ ## 9. Sign-off
99
+
100
+ | Role | Name | Date |
101
+ |---|---|---|
102
+ | Incident Commander | REPLACE | REPLACE |
103
+ | Engineering lead | REPLACE | REPLACE |
104
+ | DPO (if personal data involved) | REPLACE | REPLACE |
105
+ | Security lead | REPLACE | REPLACE |
106
+
107
+ ## Sources
108
+
109
+ - [ICO breach reporting guidance](https://ico.org.uk/for-organisations/report-a-breach/personal-data-breach/) (UK)
110
+ - [EDPB Guidelines 9/2022 on personal data breach notification](https://edpb.europa.eu/our-work-tools/our-documents/guidelines/)
111
+ - [SOC 2 Trust Services Criteria — CC7 (System Operations)](https://www.aicpa-cima.com/topic/audit-assurance/trust-services-criteria)
@@ -0,0 +1,109 @@
1
+ ---
2
+ title: "Periodic Review of Internal Controls"
3
+ period_start: "REPLACE — YYYY-MM-DD"
4
+ period_end: "REPLACE — YYYY-MM-DD"
5
+ reviewer: "REPLACE — name + role"
6
+ last_reviewed_at: "REPLACE — YYYY-MM-DD"
7
+ review_cadence_days: 90
8
+ ---
9
+
10
+ > ⚠️ **STARTER TEMPLATE — REPLACE BEFORE GOING TO PRODUCTION.**
11
+ > This file was auto-installed by `devaudit install` as a starting point.
12
+ > The Periodic Review workflow (`.github/workflows/periodic-review.yml`, shipped in
13
+ > v0.1.31) auto-regenerates this file quarterly with locally-derived metrics and
14
+ > opens a PR. The human attestation sections (Review notes, control-effectiveness
15
+ > judgement, dual-actor sign-off) still need to be filled in before each PR can
16
+ > merge — the auto-generator can't produce defensible attestation on its own.
17
+ > Auditors will reject unedited stubs. See `docs/governance-templates.md` for guidance.
18
+
19
+ # Periodic Review of Internal Controls
20
+
21
+ **Framework coverage:**
22
+
23
+ - `SOC2.CC4.1` (Monitoring of internal controls)
24
+ - `ISO27001.A.12.1` (Operational procedures and responsibilities)
25
+
26
+ **Evidence type:** `periodic_review` · **Cadence:** every 90 days (quarterly). The portal flags this evidence as `expired` after 365 days — but a 90-day cadence is the practical minimum.
27
+
28
+ ## 1. Review period
29
+
30
+ - **From:** REPLACE — YYYY-MM-DD
31
+ - **To:** REPLACE — YYYY-MM-DD
32
+ - **Reviewer:** REPLACE — name + role
33
+ - **Approver (different person, if dual-actor required):** REPLACE
34
+
35
+ ## 2. Activity summary (CI-derived, auto-fill when WS3 lands)
36
+
37
+ | Metric | Value | Notes |
38
+ |---|---|---|
39
+ | Releases shipped this period | REPLACE | Tracked + housekeeping combined |
40
+ | Tracked releases (REQ-XXX) | REPLACE | |
41
+ | Quality-gate pass rate | REPLACE — % | % of CI runs where every gate passed |
42
+ | SAST findings net change | REPLACE | +/- vs. previous period |
43
+ | Dependency-audit unaccepted high/critical | REPLACE | Current count |
44
+ | Audit-log entries | REPLACE | Total in period |
45
+ | Open SDLC issues at period end | REPLACE | From `gh issue list --label requirement --state open` |
46
+
47
+ ## 3. Control-effectiveness review
48
+
49
+ For each control area, document evidence + reviewer judgement.
50
+
51
+ ### 3a. Access control (ISO 27001 A.5.15)
52
+
53
+ - **Active access grants reviewed:** REPLACE — list or attach export
54
+ - **Grants revoked this period:** REPLACE — count + reason
55
+ - **Anomalies:** REPLACE — or "none"
56
+ - **Effective?** REPLACE — Y / N (if N, follow-up action below)
57
+
58
+ ### 3b. Change management (ISO 27001 A.8.32 / SOC 2 CC8.1)
59
+
60
+ - **Releases approved via four-eyes flow:** REPLACE — N of M
61
+ - **Self-approval blocked on MEDIUM/HIGH risk?** REPLACE — confirm enforcement
62
+ - **Effective?** REPLACE
63
+
64
+ ### 3c. Security testing (ISO 27001 A.8.29)
65
+
66
+ - **SAST gate pass rate:** REPLACE
67
+ - **Dependency-audit gate pass rate:** REPLACE
68
+ - **E2E gate pass rate:** REPLACE
69
+ - **Effective?** REPLACE
70
+
71
+ ### 3d. Logging and monitoring (ISO 27001 A.8.16 / EUAIA Art. 12)
72
+
73
+ - **Audit-log entries reviewed:** REPLACE — sample size + method
74
+ - **Anomalies escalated:** REPLACE — count
75
+ - **Effective?** REPLACE
76
+
77
+ ### 3e. Operational procedures (ISO 27001 A.12.1)
78
+
79
+ - **Procedures reviewed this period:** REPLACE — list (link `Periodic_Security_Review_Schedule.md` items completed)
80
+ - **Stale / out-of-date docs:** REPLACE
81
+ - **Effective?** REPLACE
82
+
83
+ ## 4. Incidents this period
84
+
85
+ - **Total incidents:** REPLACE — link each `compliance/governance/incident-report-*.md`
86
+ - **Personal-data breaches:** REPLACE — count
87
+ - **Mean time to detection (MTTD):** REPLACE
88
+ - **Mean time to resolution (MTTR):** REPLACE
89
+
90
+ ## 5. Findings and follow-up actions
91
+
92
+ | # | Finding | Severity | Owner | Due | Issue link |
93
+ |---|---|---|---|---|---|
94
+ | 1 | REPLACE | REPLACE | REPLACE | REPLACE | REPLACE |
95
+ | 2 | REPLACE | | | | |
96
+
97
+ ## 6. Sign-off
98
+
99
+ | Role | Name | Date |
100
+ |---|---|---|
101
+ | Reviewer | REPLACE | REPLACE |
102
+ | Approver (dual-actor) | REPLACE | REPLACE |
103
+ | Decision | REPLACE — controls effective / partially effective / not effective |
104
+
105
+ ## Sources
106
+
107
+ - [SOC 2 Trust Services Criteria — CC4 (Monitoring)](https://www.aicpa-cima.com/topic/audit-assurance/trust-services-criteria)
108
+ - [ISO/IEC 27001:2022 Annex A.12 — Operational security](https://www.iso.org/standard/82875.html)
109
+ - Your project's `Periodic_Security_Review_Schedule.md`
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: "Records of Processing Activities (ROPA)"
3
+ controller: "REPLACE — legal name of the controller"
4
+ controller_contact: "REPLACE — DPO email or controller contact"
5
+ last_reviewed_at: "REPLACE — YYYY-MM-DD"
6
+ review_cadence_days: 365
7
+ processing_activities: []
8
+ ---
9
+
10
+ > ⚠️ **STARTER TEMPLATE — REPLACE BEFORE GOING TO PRODUCTION.**
11
+ > This file was auto-installed by `devaudit install` as a starting point.
12
+ > It does **not** describe your project's actual processing activities. Edit and commit.
13
+ > Auditors will reject unedited stubs. See `docs/governance-templates.md` for guidance.
14
+
15
+ # Records of Processing Activities
16
+
17
+ **Framework coverage:** `GDPR.Art-30` (Records of processing activities)
18
+
19
+ **Evidence type:** `ropa` · **Cadence:** refresh every 365 days (portal flags as `expired` after)
20
+
21
+ ## Controller
22
+
23
+ - **Legal name:** REPLACE
24
+ - **Address:** REPLACE
25
+ - **Contact / DPO:** REPLACE
26
+ - **Joint controllers / representatives:** REPLACE (or "none")
27
+
28
+ ## Processing activities
29
+
30
+ For each distinct processing activity your project performs, add one section below. Delete this template row before your first audit.
31
+
32
+ ### Activity 1 — REPLACE (e.g. "User authentication and session management")
33
+
34
+ | Field | Value |
35
+ |---|---|
36
+ | **Purpose(s) of processing** | REPLACE — why you process this data; lawful basis (Art. 6) |
37
+ | **Categories of data subjects** | REPLACE — e.g. customers, employees, prospects |
38
+ | **Categories of personal data** | REPLACE — e.g. name, email, IP address, hashed password |
39
+ | **Special categories (Art. 9)** | REPLACE — none / specify (health, biometric, etc.) |
40
+ | **Recipients / categories of recipients** | REPLACE — internal teams + named processors |
41
+ | **Third-country transfers** | REPLACE — none / list countries + safeguard (SCCs, adequacy) |
42
+ | **Retention period** | REPLACE — e.g. "duration of customer relationship + 7 years" |
43
+ | **Technical and organisational security measures** | REPLACE — link to ISO 27001 controls / Test_Policy.md / encryption details |
44
+
45
+ ### Activity 2 — REPLACE
46
+
47
+ (repeat the table above)
48
+
49
+ ## Sources
50
+
51
+ - [ICO ROPA template (UK)](https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/accountability-and-governance/documentation/records-of-processing/)
52
+ - [EDPB Guidelines on Article 30](https://edpb.europa.eu/our-work-tools/our-documents/guidelines/)
53
+ - Your privacy policy + DPIA (`compliance/governance/dpia.md`) should describe the same activities.
54
+
55
+ ## Review log
56
+
57
+ | Date | Reviewer | Changes |
58
+ |---|---|---|
59
+ | REPLACE — YYYY-MM-DD | REPLACE | Initial ROPA authored from starter template |
@@ -0,0 +1,173 @@
1
+ # Incident Export — auto-export a closed `label:incident` issue to compliance/governance/incident-report-<n>.md
2
+ #
3
+ # Generated by `devaudit install` / `devaudit update` from sdlc-config.json.
4
+ # Do not edit manually — re-run the CLI (`devaudit update`) to regenerate.
5
+ #
6
+ # Why this exists:
7
+ # - ISO 29119 3.5.4 (Test incident report), SOC 2 CC7.2 (System monitoring
8
+ # and incident response), and GDPR Art. 33 + 34 (breach notification)
9
+ # all want incident records as portal-resident evidence — not lost in
10
+ # GitHub issue threads.
11
+ # - When an issue labelled `incident` is closed, this workflow exports its
12
+ # title + body + comments + timeline into a structured markdown report,
13
+ # opens a PR adding it to compliance/governance/, and lets the next
14
+ # push to develop pick it up via compliance-evidence.yml's
15
+ # upload_governance helper (uploads as `incident_report`).
16
+ #
17
+ # Operator setup (one-time):
18
+ # gh label create incident --color 'B60205' --description 'Operational or test incident; close to auto-archive as portal evidence'
19
+ #
20
+ # DevAudit-Installer#98 WS4.
21
+
22
+ name: Incident Export
23
+
24
+ on:
25
+ issues:
26
+ types: [closed]
27
+
28
+ permissions:
29
+ contents: write
30
+ issues: read
31
+ pull-requests: write
32
+
33
+ jobs:
34
+ export:
35
+ name: Export closed incident issue to compliance/governance/
36
+ runs-on: ubuntu-latest
37
+ # Only fire when the issue carries the `incident` label. Cheap predicate;
38
+ # skips this job entirely on unlabelled issue closes.
39
+ if: contains(github.event.issue.labels.*.name, 'incident')
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ with:
43
+ fetch-depth: 0
44
+ token: ${{ secrets.DEVAUDIT_USER_TOKEN || github.token }}
45
+
46
+ - name: Compute paths
47
+ id: paths
48
+ env:
49
+ ISSUE_NUMBER: ${{ github.event.issue.number }}
50
+ run: |
51
+ OUT="compliance/governance/incident-report-${ISSUE_NUMBER}.md"
52
+ BRANCH="chore/incident-export-${ISSUE_NUMBER}"
53
+ echo "out=${OUT}" >> "$GITHUB_OUTPUT"
54
+ echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
55
+
56
+ - name: Export issue to markdown
57
+ env:
58
+ GH_TOKEN: ${{ github.token }}
59
+ ISSUE_NUMBER: ${{ github.event.issue.number }}
60
+ OUT: ${{ steps.paths.outputs.out }}
61
+ run: |
62
+ mkdir -p compliance/governance
63
+ ISSUE_JSON=$(gh issue view "$ISSUE_NUMBER" \
64
+ --json title,body,labels,author,createdAt,closedAt,comments,url,assignees,number,state)
65
+ {
66
+ echo "$ISSUE_JSON" | jq -r '
67
+ "---",
68
+ ("title: " + (.title | @json)),
69
+ ("incident_id: \"INC-" + (.createdAt[:10] | gsub("-";"")) + "-" + (.number|tostring) + "\""),
70
+ ("severity: \"REPLACE — low | medium | high | critical\""),
71
+ ("detected_at: " + (.createdAt | @json)),
72
+ ("resolved_at: " + (.closedAt | @json)),
73
+ ("involves_personal_data: \"REPLACE — true | false\""),
74
+ ("reported_to_supervisory_authority: \"REPLACE — true | false | n/a\""),
75
+ ("notification_window_72h: \"REPLACE — within | outside | n/a\""),
76
+ ("last_reviewed_at: " + (.closedAt[:10] | @json)),
77
+ ("source_issue: " + (.url | @json)),
78
+ ("source_issue_number: " + (.number|tostring)),
79
+ "---",
80
+ "",
81
+ "> ℹ️ Auto-exported by Incident Export workflow on issue close.",
82
+ "> The narrative below is the original issue body + comments.",
83
+ "> **Operator must replace the REPLACE markers in the frontmatter and",
84
+ "> in the GDPR triage / sign-off sections before this PR merges** —",
85
+ "> a personal-data triage decision is load-bearing; an auto-generated",
86
+ "> answer is not defensible. Auditors will reject auto-generated",
87
+ "> stubs without human attestation.",
88
+ "",
89
+ "# Incident Report — " + .title,
90
+ "",
91
+ "**Framework coverage:**",
92
+ "",
93
+ "- `ISO29119.3.5.4` (Test incident report)",
94
+ "- `SOC2.CC7.2` (System monitoring and incident response)",
95
+ "- `GDPR.Art-33` (Notification of a personal data breach to the supervisory authority — 72h)",
96
+ "- `GDPR.Art-34` (Communication of a personal data breach to the data subject)",
97
+ "",
98
+ "**Source:** [#" + (.number|tostring) + "](" + .url + ") ",
99
+ "**Detected:** " + .createdAt + " ",
100
+ "**Closed:** " + .closedAt + " ",
101
+ "**Reporter:** @" + .author.login + " ",
102
+ "**Assignees:** " + (if .assignees == [] then "_unassigned_" else (.assignees | map("@" + .login) | join(", ")) end) + " ",
103
+ "**Labels:** " + (.labels | map("`" + .name + "`") | join(", ")),
104
+ "",
105
+ "## 1. Personal data scope (GDPR triage) — REPLACE",
106
+ "",
107
+ "| Question | Answer |",
108
+ "| --- | --- |",
109
+ "| Did the incident involve personal data? | REPLACE — Y / N |",
110
+ "| If Y: estimated number of data subjects affected | REPLACE |",
111
+ "| If Y: categories of personal data involved | REPLACE |",
112
+ "| If Y: likely consequences for data subjects | REPLACE |",
113
+ "| Notify supervisory authority (Art. 33)? | REPLACE — required if Y and risk to rights/freedoms |",
114
+ "| Notify data subjects (Art. 34)? | REPLACE — required if high risk to rights/freedoms |",
115
+ "| 72-hour notification window | REPLACE — within / outside / n/a |",
116
+ "",
117
+ "## 2. Narrative (from the GitHub issue)",
118
+ "",
119
+ .body,
120
+ "",
121
+ "## 3. Timeline (from issue comments)"
122
+ '
123
+ echo ""
124
+ # Comments — one section each, ordered by createdAt.
125
+ echo "$ISSUE_JSON" | jq -r '
126
+ .comments | sort_by(.createdAt) | .[] |
127
+ "### " + .createdAt + " — @" + .author.login + "\n\n" + .body + "\n"
128
+ '
129
+ cat <<'TAIL'
130
+
131
+ ## 4. Sign-off — REPLACE
132
+
133
+ | Role | Name | Date |
134
+ | ----------------------------------- | ------- | ------- |
135
+ | Incident Commander | REPLACE | REPLACE |
136
+ | Engineering lead | REPLACE | REPLACE |
137
+ | DPO (if personal data involved) | REPLACE | REPLACE |
138
+ | Security lead | REPLACE | REPLACE |
139
+
140
+ ---
141
+
142
+ _Source: auto-exported by `.github/workflows/incident-export.yml` when the originating issue was closed._
143
+ TAIL
144
+ } > "$OUT"
145
+ echo "Wrote $OUT"
146
+
147
+ - name: Open export PR
148
+ env:
149
+ GH_TOKEN: ${{ secrets.DEVAUDIT_USER_TOKEN || github.token }}
150
+ BRANCH: ${{ steps.paths.outputs.branch }}
151
+ OUT: ${{ steps.paths.outputs.out }}
152
+ ISSUE_NUMBER: ${{ github.event.issue.number }}
153
+ ISSUE_URL: ${{ github.event.issue.html_url }}
154
+ run: |
155
+ git config user.name 'devaudit-bot'
156
+ git config user.email 'devaudit-bot@users.noreply.github.com'
157
+ git fetch origin develop
158
+ git checkout -B "${BRANCH}" origin/develop
159
+ git add "$OUT"
160
+ if git diff --cached --quiet; then
161
+ echo "No change — already exported."
162
+ exit 0
163
+ fi
164
+ git commit -m "chore(compliance): export incident #${ISSUE_NUMBER}" -m "Auto-exported by Incident Export workflow." -m "" -m "Source: ${ISSUE_URL}" -m "" -m "REPLACE markers in the GDPR triage + Sign-off sections require human attestation before this PR can merge."
165
+ git push --force-with-lease origin "${BRANCH}"
166
+ EXISTING=$(gh pr list --head "${BRANCH}" --json number --jq '.[0].number' || true)
167
+ if [ -z "$EXISTING" ]; then
168
+ gh pr create --base develop --head "${BRANCH}" \
169
+ --title "chore(compliance): export incident #${ISSUE_NUMBER}" \
170
+ --body "Auto-exported by the \`Incident Export\` workflow when issue [#${ISSUE_NUMBER}](${ISSUE_URL}) was closed with label \`incident\`.\n\n**Required before merge:**\n- [ ] Replace \`REPLACE — …\` markers in the **GDPR triage** section (personal-data Y/N decision is load-bearing)\n- [ ] Fill in **severity** in the frontmatter\n- [ ] Add reviewer sign-off (IC, Eng lead, DPO if PII, Security lead)\n- [ ] If 72h window applies and we're outside it, document the delay explicitly\n\nSee [\`compliance/governance/incident-report.md\`](compliance/governance/incident-report.md) (the v0.1.30 starter) and [\`DevAudit-Installer/docs/governance-templates.md\`](https://github.com/metasession-dev/DevAudit-Installer/blob/main/docs/governance-templates.md#gdpr--eu-general-data-protection-regulation-2016679) for guidance.\n\nCloses (for this incident) \`ISO29119.3.5.4\` + \`SOC2.CC7.2\`; \`GDPR.Art-33\` + \`Art-34\` close once the triage section is filled in."
171
+ else
172
+ echo "PR #${EXISTING} already open for this incident — branch updated in place."
173
+ fi