Skip to content

Commit d09a9b9

Browse files
Ibraheem OlasupoIbraheem Olasupo
authored andcommitted
Implement milestone 13 Repository 5 integration contract
1 parent df654e3 commit d09a9b9

106 files changed

Lines changed: 11404 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: integration-contract
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: integration-contract-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
integration-contract:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip==25.1.1
31+
python -m pip install -e ".[dev]"
32+
33+
- name: Verify source evidence
34+
run: |
35+
make verify-findings-evidence
36+
make verify-release-evidence
37+
make verify-lifecycle-evidence
38+
make verify-consolidated-evidence
39+
make verify-champions-evidence
40+
41+
- name: Validate integration contract
42+
run: |
43+
make integration-policy-validate
44+
make integration-export
45+
make integration-validate
46+
make verify-integration-evidence
47+
48+
- name: Run integration tests
49+
run: |
50+
PYTHONPATH=src pytest tests/security/test_integration_contract.py -q
51+
52+
- name: Sample consumer validation
53+
run: |
54+
python examples/integration-consumer/validate_bundle.py outputs/security/integration
55+
56+
- name: Generate reports
57+
run: make integration-report
58+
59+
- name: Upload export bundle
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: product-security-export-bundle
63+
path: outputs/security/integration/
64+
retention-days: 14

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
This portfolio repository is a local demonstration of a secure product foundation. Contributions should preserve the delivered milestone boundaries and avoid adding cloud deployment, production vulnerability-management operations beyond the local evidence model, or Repository 5 integration before their roadmap milestone.
3+
This portfolio repository is a local demonstration of a secure product foundation. Contributions should preserve the delivered milestone boundaries and avoid adding cloud deployment, production vulnerability-management operations beyond the local evidence model, or live Repository 5 ingestion.
44

55
## Local Checks
66

@@ -16,6 +16,7 @@ make lifecycle-full
1616
make evidence-full
1717
make developer-enablement-full
1818
make champions-full
19+
make integration-full
1920
```
2021

2122
Use deterministic synthetic data only. Do not add real patient, NHS, genomic, credential, or cloud account data.
@@ -38,6 +39,7 @@ Use deterministic synthetic data only. Do not add real patient, NHS, genomic, cr
3839
- Run `make security-doctor` when Docker, Terraform, Gitleaks, Trivy, ZAP or local dynamic checks fail locally.
3940
- Keep scanner suppressions narrow, owned and expiring. Use formal lifecycle exceptions only for time-bound accepted risk or deferral with rationale and approval.
4041
- Regenerate findings, release, lifecycle, consolidated evidence and developer enablement evidence when the corresponding source material changes.
41-
- Commits should preserve milestone boundaries. Do not add deployment, AWS execution, dashboards, external ticketing or Repository 5 integration before their roadmap milestone.
42+
- Regenerate integration evidence with `make integration-full` when finding, release, lifecycle, consolidated evidence or integration mapping config changes.
43+
- Commits should preserve milestone boundaries. Do not add deployment, AWS execution, dashboards, external ticketing or live Repository 5 ingestion.
4244

4345
Run `make champions-full` when changing the Security Champions programme, roster, metrics, maturity model, escalation policy, workshops, exercises or reports. Champion records must remain synthetic and role-based.

Makefile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: setup install format format-check lint type-check test test-coverage auth-test api-security-test terraform-fmt terraform-fmt-check terraform-init terraform-validate terraform-test infrastructure-test infrastructure-evidence verify-infrastructure-evidence infrastructure-report security-tools secrets-scan sast sast-semgrep sast-bandit semgrep-test sca dependency-audit sbom verify-sbom iac-scan checkov-scan container-build-security container-scan appsec-fast appsec-full appsec-evidence verify-appsec-evidence appsec-report dynamic-tools dynamic-server-start dynamic-server-wait dynamic-server-stop schemathesis-test api-schema-security-test zap-baseline zap-api-scan auth-boundary-test authorisation-boundary-test object-access-test input-mutation-test security-header-test cors-test resource-consumption-test audit-dynamic-test dast dynamic-evidence verify-dynamic-evidence dynamic-report dynamic-fast dynamic-full findings-normalise findings-deduplicate findings-enrich findings-validate findings-evidence verify-findings-evidence findings-report findings-full release-policy-validate release-gate-evaluate release-gate-enforce release-evidence verify-release-evidence release-report release-full lifecycle-policy-validate lifecycle-initialise lifecycle-validate lifecycle-expiry lifecycle-evidence verify-lifecycle-evidence lifecycle-report lifecycle-full evidence-source-validate evidence-aggregate evidence-generate verify-consolidated-evidence evidence-report evidence-full security-assurance-full security-doctor developer-docs-validate developer-enablement-evidence verify-developer-enablement-evidence developer-enablement-report developer-enablement-full champions-policy-validate champions-metrics champions-evidence verify-champions-evidence champions-report champions-full pre-commit-install pre-commit-run quality run docker-build docker-run threat-model-validate threat-model-evidence verify-threat-model-evidence threat-model-report api-security-evidence verify-api-security-evidence api-security-report dev-token-researcher dev-token-approver dev-token-auditor clean
1+
.PHONY: setup install format format-check lint type-check test test-coverage auth-test api-security-test terraform-fmt terraform-fmt-check terraform-init terraform-validate terraform-test infrastructure-test infrastructure-evidence verify-infrastructure-evidence infrastructure-report security-tools secrets-scan sast sast-semgrep sast-bandit semgrep-test sca dependency-audit sbom verify-sbom iac-scan checkov-scan container-build-security container-scan appsec-fast appsec-full appsec-evidence verify-appsec-evidence appsec-report dynamic-tools dynamic-server-start dynamic-server-wait dynamic-server-stop schemathesis-test api-schema-security-test zap-baseline zap-api-scan auth-boundary-test authorisation-boundary-test object-access-test input-mutation-test security-header-test cors-test resource-consumption-test audit-dynamic-test dast dynamic-evidence verify-dynamic-evidence dynamic-report dynamic-fast dynamic-full findings-normalise findings-deduplicate findings-enrich findings-validate findings-evidence verify-findings-evidence findings-report findings-full release-policy-validate release-gate-evaluate release-gate-enforce release-evidence verify-release-evidence release-report release-full lifecycle-policy-validate lifecycle-initialise lifecycle-validate lifecycle-expiry lifecycle-evidence verify-lifecycle-evidence lifecycle-report lifecycle-full evidence-source-validate evidence-aggregate evidence-generate verify-consolidated-evidence evidence-report evidence-full integration-policy-validate integration-export integration-validate verify-integration-evidence integration-report integration-full security-assurance-full security-doctor developer-docs-validate developer-enablement-evidence verify-developer-enablement-evidence developer-enablement-report developer-enablement-full champions-policy-validate champions-metrics champions-evidence verify-champions-evidence champions-report champions-full pre-commit-install pre-commit-run quality run docker-build docker-run threat-model-validate threat-model-evidence verify-threat-model-evidence threat-model-report api-security-evidence verify-api-security-evidence api-security-report dev-token-researcher dev-token-approver dev-token-auditor clean
22

33
PYTHON ?= python3
44
VENV ?= .venv
@@ -268,7 +268,24 @@ evidence-report:
268268

269269
evidence-full: verify-threat-model-evidence verify-api-security-evidence verify-infrastructure-evidence verify-appsec-evidence verify-dynamic-evidence verify-findings-evidence verify-release-evidence verify-lifecycle-evidence evidence-source-validate evidence-generate verify-consolidated-evidence evidence-report
270270

271-
security-assurance-full: quality verify-threat-model-evidence verify-api-security-evidence verify-infrastructure-evidence verify-appsec-evidence verify-dynamic-evidence findings-full release-full lifecycle-full developer-enablement-full champions-full evidence-full
271+
integration-policy-validate:
272+
PYTHONPATH=src $(PYTHON) -m genomic_research_access_api.security.integration validate-policy
273+
274+
integration-export:
275+
PYTHONPATH=src $(PYTHON) -m genomic_research_access_api.security.integration export --timestamp 2026-01-01T00:00:00Z --as-of-date 2026-01-01
276+
277+
integration-validate:
278+
PYTHONPATH=src $(PYTHON) -m genomic_research_access_api.security.integration validate-export
279+
280+
verify-integration-evidence:
281+
PYTHONPATH=src $(PYTHON) -m genomic_research_access_api.security.integration verify
282+
283+
integration-report:
284+
PYTHONPATH=src $(PYTHON) -m genomic_research_access_api.security.integration report
285+
286+
integration-full: verify-findings-evidence verify-release-evidence verify-lifecycle-evidence verify-consolidated-evidence integration-policy-validate integration-export integration-validate verify-integration-evidence integration-report
287+
288+
security-assurance-full: quality verify-threat-model-evidence verify-api-security-evidence verify-infrastructure-evidence verify-appsec-evidence verify-dynamic-evidence findings-full release-full lifecycle-full developer-enablement-full champions-full evidence-full integration-full
272289

273290
security-doctor:
274291
PYTHONPATH=src $(PYTHON) -m genomic_research_access_api.security.enablement doctor

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Milestone 11 adds developer security enablement: repository-specific secure deve
4040

4141
Milestone 12 adds a local Security Champions programme: charter, role definition, onboarding, 90-day plan, monthly learning cadence, workshops, exercises, checklists, escalation model, metrics, maturity model, evidence and reports. It uses synthetic role-based records only and does not implement Repository 5 integration, dashboards, ticketing, messaging, deployment or AWS resource creation.
4242

43+
Milestone 13 adds a versioned Repository 5 integration contract. It exports local product-security findings, lifecycle evidence, release-assurance evidence, lineage, ownership and metrics under `outputs/security/integration/` using contract `product-security-control-plane-export` version `1.0`. A consumer control plane can validate the bundle with `examples/integration-consumer/validate_bundle.py`. This milestone does not modify Repository 5, perform live ingestion, deploy, create AWS resources, upload externally, or start Milestone 14.
44+
4345
## Milestone 1 Scope
4446

4547
Implemented:
@@ -449,14 +451,14 @@ Milestone 3 also implements local signed JWT authentication, RBAC, object-level
449451

450452
Milestone 4 adds secure AWS Terraform configuration for private ECS, least-privilege role separation, encrypted DynamoDB/Secrets/CloudTrail storage, CloudWatch/CloudTrail observability and secure remote-state design. These controls are configured and locally validated, not deployed.
451453

452-
Planned future controls include external IdP integration, production rate limiting, Repository 5 integration and enterprise reporting.
454+
Planned future controls include external IdP integration, production rate limiting and later enterprise workflows beyond the local Milestone 13 export contract.
453455

454-
This repository does not claim production-grade identity, monitoring, cloud deployment, vulnerability-management workflow or release-gate coverage.
456+
This repository does not claim production-grade identity, monitoring, cloud deployment, external Repository 5 ingestion, vulnerability-management workflow or release-gate coverage.
455457

456458
## Limitations
457459

458-
State is in memory and resets when the app restarts. JWT keys under `tests/fixtures/keys/` are synthetic local development material only. Audit retrieval is a local demonstration endpoint restricted by role. Terraform is a non-deployed reference architecture; no AWS resource is created by the repository state. Threat-model risk ratings are qualitative portfolio artefacts, not production risk acceptances.
460+
State is in memory and resets when the app restarts. JWT keys under `tests/fixtures/keys/` are synthetic local development material only. Audit retrieval is a local demonstration endpoint restricted by role. Terraform is a non-deployed reference architecture; no AWS resource is created by the repository state. Threat-model risk ratings are qualitative portfolio artefacts, not production risk acceptances. The Repository 5 integration contract is a deterministic local export bundle only; no external transfer or consumer ingestion is performed.
459461

460462
## Future Milestones
461463

462-
Later milestones may add external identity-provider integration, Repository 5 integration and enterprise reporting.
464+
Later milestones may add external identity-provider integration and enterprise reporting beyond the local export contract.

SECURITY.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If you identify a vulnerability or unsafe pattern in this demonstration code, op
66

77
Do not submit real patient data, NHS data, genomic data, credentials, cloud account identifiers, or sensitive operational details in reports.
88

9-
Current implemented security controls include local JWT authentication, role-based and object-level authorisation, threat-model validation, non-deployed Terraform reference controls, a Milestone 5 AppSec pipeline, Milestone 6 local dynamic API security validation, Milestone 7 canonical findings normalisation, Milestone 8 local release-assurance gates, Milestone 9 vulnerability lifecycle and exception governance, and Milestone 10 consolidated security evidence reporting.
9+
Current implemented security controls include local JWT authentication, role-based and object-level authorisation, threat-model validation, non-deployed Terraform reference controls, a Milestone 5 AppSec pipeline, Milestone 6 local dynamic API security validation, Milestone 7 canonical findings normalisation, Milestone 8 local release-assurance gates, Milestone 9 vulnerability lifecycle and exception governance, Milestone 10 consolidated security evidence reporting, Milestone 11 developer enablement, Milestone 12 Security Champions evidence, and Milestone 13 local Repository 5 integration-contract export evidence.
1010

1111
Run local security checks with:
1212

@@ -20,10 +20,11 @@ make lifecycle-full
2020
make evidence-full
2121
make developer-enablement-full
2222
make champions-full
23+
make integration-full
2324
```
2425

2526
Docker-backed Gitleaks, Trivy, Schemathesis and ZAP scans require a running Docker daemon when native binaries or scanner containers are used. Dynamic scan targets must remain local-only. Do not treat local scanner, findings, release, lifecycle, consolidated or Security Champions evidence as a production vulnerability-management programme, penetration test, deployment approval system, regulatory certification or external training system.
2627

27-
Developer guidance is under `docs/developer-security/`. It explains safe reproduction, local-only DAST boundaries, scanner suppressions, formal security exceptions, release gates and evidence expectations. Do not submit real secrets, raw JWTs, private keys, exploit payloads, cloud identifiers or personal contact details in issues, pull requests or evidence.
28+
Developer guidance is under `docs/developer-security/`. It explains safe reproduction, local-only DAST boundaries, scanner suppressions, formal security exceptions, release gates and evidence expectations. Integration guidance is under `docs/integration/` and covers the local export contract only. Do not submit real secrets, raw JWTs, private keys, exploit payloads, cloud identifiers or personal contact details in issues, pull requests or evidence.
2829

2930
Security Champions guidance is under `security-champions/`. It is a synthetic role-based operating model for facilitation, learning, triage support and escalation. Champions do not replace Product Security accountability or Risk Owner acceptance.

config/evidence/control-mapping.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"developer_enablement": ["developer_enablement"],
1010
"findings": ["governance", "supply_chain"],
1111
"infrastructure": ["infrastructure_security", "iam", "data_protection", "audit_logging"],
12+
"integration": ["integration_contract"],
1213
"lifecycle": ["vulnerability_management", "governance", "audit"],
1314
"release_assurance": ["release_assurance"],
1415
"threat_model": ["secure_design"]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compatibility_statuses": [
3+
"compatible",
4+
"compatible_with_warnings",
5+
"incompatible"
6+
],
7+
"minimum_consumer_version": "1.0",
8+
"required_manifest_fields": [
9+
"contract_name",
10+
"contract_version",
11+
"producer",
12+
"producer_repository",
13+
"record_count",
14+
"lineage_edge_count",
15+
"output_checksums",
16+
"compatibility_status",
17+
"validation_status"
18+
],
19+
"supported_contract_versions": [
20+
"1.0"
21+
]
22+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"control_domains": {
3+
"integration_contract": [
4+
"SR-INTEGRATION-001",
5+
"SR-INTEGRATION-002",
6+
"SR-INTEGRATION-003",
7+
"SR-INTEGRATION-004"
8+
]
9+
},
10+
"mapping_version": "1.0"
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"mapping_version": "1.0",
3+
"mappings": {
4+
"asset_id": "asset_id",
5+
"asset_type": "asset_type",
6+
"control_ids": "control_ids",
7+
"due_date": "due_date",
8+
"exception_id": "exception_id",
9+
"export_record_id": "derived from contract version, finding_id and producer repository",
10+
"finding_id": "canonical finding_id",
11+
"lifecycle_status": "lifecycle vulnerability status",
12+
"normalised_severity": "normalised_severity",
13+
"producer_status": "local lifecycle or finding status",
14+
"consumer_status": "neutral status mapping",
15+
"release_impact": "release finding decision contribution",
16+
"source_finding_ids": "finding-source-map source_finding_ids",
17+
"source_record_hash": "canonical source_record_hash"
18+
}
19+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"as_of_date_default": "2026-01-01",
3+
"consumer": "enterprise-data-saas-security-control-plane",
4+
"contract_name": "product-security-control-plane-export",
5+
"contract_version": "1.0",
6+
"deployment_status": "not_deployed",
7+
"limitations": [
8+
"Local export bundle only; no Repository 5 modification or live ingestion occurs.",
9+
"No APIs, message queues, cloud resources, dashboards or external transfer are implemented.",
10+
"Consumer-side identifiers are not fabricated."
11+
],
12+
"minimum_consumer_version": "1.0",
13+
"producer": "devsecops-application-security-pipeline",
14+
"producer_repository": "devsecops-application-security-pipeline",
15+
"producer_schema_version": "1.0",
16+
"timestamp_default": "2026-01-01T00:00:00Z"
17+
}

0 commit comments

Comments
 (0)