Repository navigation
feat(compliance): keep every compliance check as evidence - #560
Merged
Merged
Conversation
A compliance check answered its report and kept nothing, so the history of a cluster's checks lived only in pipeline logs. An auditor asking what was checked, when and by whom had nothing to be shown. This is the first piece of the evidence pack (plans/enterprise.md, Phase 3a). - V27 compliance_checks: the report as JSON, when it ran, the reference name and the SHA-256 of the body sent, the cluster id, the verdict, and the actor. Nothing deletes these rows. - POST /api/conformity/check stores each report and names it in Location. A refused reference stores nothing. If the store fails, the caller still gets its verdict without a Location, and the error is logged. The call is now @Audited (RUN, compliance), its target the check's id. - GET /api/conformity/checks lists them newest first, bounded by since and until (ISO-8601; anything else is a 400), paged as /api/audit is. - GET /api/conformity/checks/{id} answers one, with its full report. - API reference and the compliance chapter no longer say a check stores nothing. Verified locally: mvnw test (1773, 0 failures), spotless:check, TestMCPCaveatRefAnchors, check-book-style.sh. V27 has run only on H2; CI's ITs are its first Postgres run.
ComplianceChecksIT runs V27 as Flyway applies it and the period queries with either bound or none, which ComplianceResourceTest only runs on H2. A microsecond checkedAt reads back unchanged.
This was referenced Oct 30, 2026
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A compliance check answered its report and kept nothing, so a cluster's check history lived only in pipeline logs. An auditor asking what was checked, when and by whom had nothing to be shown. EU banks must show their resilience testing under DORA; this is the first piece of an evidence pack for them (Phase 3a of the enterprise plan: store compliance results, then a tamper-evident audit log, then a signed export).
What
compliance_checks: the report as JSON,checked_at, the reference name and the SHA-256 of the body sent, the cluster id, the verdict, and the actor and principal type. Nothing deletes these rows.POST /api/conformity/checkstores each report and names it inLocation: /api/conformity/checks/{id}. The response body is unchanged.Location, and the error is logged.@Audited(RUN, typecompliance), its audit row's target the check's id.GET /api/conformity/checkslists them newest first.since(inclusive) anduntil(exclusive) are ISO-8601 instants; anything else is a 400.page/sizeas on/api/audit.GET /api/conformity/checks/{id}answers one: the list's fields,referenceSha256, and the fullreport. 404 for an unknown id.Deliberately not done
kates compliance checkmakes from the YAML file, not of the YAML file itself. An auditor can't hash the YAML file and get a match.kates evidence exportcomes with the export PR.Tests
Locally:
./mvnw test -Dquarkus.grpc.codegen.skip=true -Dquarkus.http.test-port=0: 1773 tests, 0 failures, 3 skipped. 5 new tests inComplianceResourceTest: stored with actor, SHA-256 and full report, plus the audit row; list by period, newest first, paged; badsinceis a 400; unknown id is a 404; a refused reference stores nothing.spotless:checkgo test ./cmd -run TestMCPCaveatscripts/check-book-style.shOn real PostgreSQL (Testcontainers):
ComplianceChecksIT(b2970af) runs V27 through Flyway and the period queries with either bound or none; a microsecondcheckedAtreads back unchanged. With #561's branch, which carries this one,./mvnw verifyran 1783 unit tests and all 98 ITs, 0 failures.Not run locally: a book render, so the new
#get-apiconformitycheckslink is unchecked; it follows the pattern of the book's other API links.