# krishwtb/sunset-security-design architecture

> Architecture diagram of the GitHub repository krishwtb/sunset-security-design, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krishwtb/sunset-security-design
- Repository: https://github.com/krishwtb/sunset-security-design

## Overview

Sunset is a security and privacy design for governing biometric data collected during emergency aid—not a published application implementation. Its central workflow defines a purpose and expiry for each record, makes upcoming expiry visible, and removes identifying information when expiry is reached or a response closes while retaining aggregate statistics. Other specified controls address extensions, auditability, partner eligibility checks, consent, and access. The repository contains the design overview and two supporting documents; the application code is explicitly unpublished, so the graph represents documented design relationships, not verified runtime calls.

Main entry points: [`README.md`](https://github.com/krishwtb/sunset-security-design/blob/main/README.md) (Purpose and expiry), [`Threat-Model.md`](https://github.com/krishwtb/sunset-security-design/blob/main/Threat-Model.md) (Threat model), [`PRIVACY-APP-MAPPING.md`](https://github.com/krishwtb/sunset-security-design/blob/main/PRIVACY-APP-MAPPING.md) (Privacy mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Data lifecycle"]
  node_record_lifecycle["Purpose and expiry<br/>[README.md]"]
  node_expiry_dashboard["Expiry countdowns<br/>[README.md]"]
  node_extension_approval["Extension approval<br/>[README.md]"]
  node_close_response["Close response<br/>[README.md]"]
  node_identifying_data[("Identifying data<br/>[README.md]")]
  node_aggregate_stats[("Aggregate statistics<br/>[README.md]")]
end

subgraph group_safeguards["Privacy safeguards"]
  node_audit_log["Tamper-evident audit<br/>[README.md]"]
  node_partner_query["Eligibility query<br/>[README.md]"]
  node_consent_receipt["Consent receipts<br/>[README.md]"]
  node_role_access["Role-based access<br/>[README.md]"]
end

subgraph group_documents["Design documents"]
  node_threat_model["Threat model<br/>[Threat-Model.md]"]
  node_privacy_mapping["Privacy mapping"]
end

node_aid_staff(("Aid staff"))
node_partner_agency(("Partner agency"))

node_aid_staff -->|"records purpose"| node_record_lifecycle
node_record_lifecycle -->|"sets expiry"| node_identifying_data
node_aid_staff -->|"views countdowns"| node_expiry_dashboard
node_aid_staff -->|"requests extension"| node_extension_approval
node_extension_approval -->|"extends retention"| node_record_lifecycle
node_aid_staff -->|"closes response"| node_close_response
node_close_response -->|"removes identifiers"| node_identifying_data
node_close_response -->|"retains statistics"| node_aggregate_stats
node_partner_agency -->|"checks eligibility"| node_partner_query
node_partner_query -->|"returns yes/no"| node_partner_agency
node_record_lifecycle -.->|"records changes"| node_audit_log
node_aid_staff -->|"receives receipt"| node_consent_receipt
node_aid_staff -->|"accesses records"| node_role_access
node_threat_model -.->|"documents controls"| node_privacy_mapping

click node_record_lifecycle "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_expiry_dashboard "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_extension_approval "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_close_response "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_identifying_data "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_aggregate_stats "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_audit_log "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_partner_query "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_consent_receipt "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_role_access "https://github.com/krishwtb/sunset-security-design/blob/main/README.md"
click node_threat_model "https://github.com/krishwtb/sunset-security-design/blob/main/Threat-Model.md"
click node_privacy_mapping "https://github.com/krishwtb/sunset-security-design/blob/main/PRIVACY-APP-MAPPING.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_record_lifecycle,node_expiry_dashboard,node_extension_approval,node_close_response,node_identifying_data,node_aggregate_stats toneBlue
class node_audit_log,node_partner_query,node_consent_receipt,node_role_access toneAmber
class node_threat_model,node_privacy_mapping toneMint
class node_aid_staff,node_partner_agency toneIndigo
```

## Components

### Data lifecycle

- [Purpose and expiry](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Expiry countdowns](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Extension approval](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Close response](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Identifying data](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Aggregate statistics](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`

### Privacy safeguards

- [Tamper-evident audit](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Eligibility query](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Consent receipts](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`
- [Role-based access](https://github.com/krishwtb/sunset-security-design/blob/main/README.md): `README.md`

### Design documents

- [Threat model](https://github.com/krishwtb/sunset-security-design/blob/main/Threat-Model.md): `Threat-Model.md`
- [Privacy mapping](https://github.com/krishwtb/sunset-security-design/blob/main/PRIVACY-APP-MAPPING.md): `PRIVACY-APP-MAPPING.md`

### Other components

- **Aid staff**
- **Partner agency**

## Connections

- Aid staff → Purpose and expiry: records purpose (evidence: `README.md`)
- Purpose and expiry → Identifying data: sets expiry (evidence: `README.md`)
- Aid staff → Expiry countdowns: views countdowns (evidence: `README.md`)
- Aid staff → Extension approval: requests extension (evidence: `README.md`)
- Extension approval → Purpose and expiry: extends retention (evidence: `README.md`)
- Aid staff → Close response: closes response (evidence: `README.md`)
- Close response → Identifying data: removes identifiers (evidence: `README.md`)
- Close response → Aggregate statistics: retains statistics (evidence: `README.md`)
- Partner agency → Eligibility query: checks eligibility (evidence: `README.md`)
- Eligibility query → Partner agency: returns yes/no (evidence: `README.md`)
- Purpose and expiry → Tamper-evident audit: records changes
- Aid staff → Consent receipts: receives receipt (evidence: `README.md`)
- Aid staff → Role-based access: accesses records (evidence: `README.md`)
- Threat model → Privacy mapping: documents controls
