Skip to content

Implementation plan / Session plan / Handover RC-1-S14

Handover RC-1-S14 Build: Platform: secrets and keys

Card: RC-1-S14. Issue: cema-care/his#28. Branch: session/RC-1-S14. Slice: RC-1. Decision record: ADR-HIS-064.

What was built and where

Everything is in platform/secrets-keys/, except the decision record, its row in the decision record index, and this handover. The unit's README, platform/secrets-keys/README.md, gives the layout, how the parts work, the settings and the checks.

Scope as read. The card covers MOD-ISE-006 for FR-ISE-KEY-001 (controlled storage and rotation) and FR-ISE-KEY-002 (encryption in transit and at rest). It also carries the contract point that RC-1-S02 left for it in contracts/ise/README.md: - serve secrets.v1 from OpenBao, with no value crossing it; - refuse an interval over CFG-ISE-014; - publish CertificateExpiring at the CFG-ISE-013 windows, and CredentialRotatedOrRevoked; - record every access and denial in the item history.

FR-ISE-KEY-003 (node authentication) is not in this card.

What was built:

  • The store's configuration, openbao/server.hcl: Raft storage, a TLS-only listener on the approved configurations of D02-ISE 9.7, and two declarative audit devices: a file to standard output, and a socket to this unit. It holds no secret.
  • The service ise-secrets-keys, made from the service template with --into platform/secrets-keys: one module mod-ise-006, schema mod_ise_006, migration V1__secrets_and_keys.sql. It does the following:
  • Inventory. It serves the eight operations of secrets.v1 (DE-ISE-012), with the policy decision point before every action, Idempotency-Key and If-Match.
    • CFG-ISE-014 maxima are checked by class.
    • Grants are least privilege.
    • Changing a policy and revoking are for people only.
  • Store. Items live in OpenBao by type:

    • secrets and service credentials in KV version 2;
    • certificates through a per-item PKI role (ECDSA), with the bundle in KV;
    • keys in Transit (AES-256-GCM, never exportable).

    Grants are an ACL policy and an identity group per item, so a change takes effect at the next request. The unit's own OpenBao policy (his-secrets-controller.hcl) can never read a value. In development and tests a bootstrap prepares the store and then works with a controller token of its own. - Lifecycle, every minute, one replica at a time: - issues Requested certificates; - starts automatic rotations when due, and at two thirds of a certificate's lifetime; - completes them once every granted consumer has used the new generation; - extends an overlap with an alert when a consumer lags; - raises a D10 rotation task for a secret rotated by task; - publishes CertificateExpiring at 30 and 7 days, to the owner; - marks material Expired when its validity passes. - Access records. The receiving end of the store's socket audit device turns every read the store answers or refuses into a history entry and a D10 audit event: ise.secret.accessed, or ise.service-identity.denied as the security event of PR-KEY-001-1. It records the generation read, and that is how consumers are verified. - Revocation takes effect at once: grants are removed, certificates revoked in the CRL and values destroyed. CredentialRotatedOrRevoked is published, and on suspected compromise a security incident is raised (security audit event and alert). - Key recovery under dual control (behaviour 7), through the unit's own api/key-recovery.v1.openapi.yaml: - the Backup and Recovery Operator requests it; - a second person confirms it, never the requester; - the recovery identity may then read the item for one hour. - Encryption (FR-ISE-KEY-002), through the unit's own api/encryption.v1.openapi.yaml: - the provisioning check, which refuses a definition that misses an approved configuration (PR-KEY-002-1, PR-KEY-002-2, mutual TLS for service-to-service); - approved, compensated, time-bound exceptions; - the coverage report with its deviations; - the channel scan, which probes each endpoint with its own ClientHellos and checks mutual TLS against configured anchors.

    The approved configurations are a versioned file, approved-configurations.json, each version recorded with its approver. - Checks. scripts/ends-when.sh is this card's "Ends when", repeatable by later sessions on this unit. - ADR-HIS-064 and its row in the decision record index (63 records).

Dependencies: none added. The module uses only the kit's dependencies; the JWT library its tests use comes with the kit's resource server.

One change to the dependency versions: buildSrc/src/main/kotlin/his.java-module.gradle.kts constrains the two compression libraries that kafka-clients brings to their fixed versions, lz4-java 1.11.4 and snappy-java 1.1.10.9. The template's versions have high findings (CVE-2026-106451, CVE-2026-108106, CVE-2026-93451). This is the same constraint services/ess-governance and services/ess-coordination carry. The lockfiles were rewritten with ./gradlew dependencies --write-locks.

The unit's copy of the kit carries one change: HisException and ProblemAdvice gained the Problem's errors list and an optional status. This is the same extension services/ess-governance made to its copy, so that a refusal lists each unmet precondition, as the ISE contract's README says.

Checks and their result

The integration environment ran as HIS_SESSION=RC-1-S14 (his-rc-1-s14), light profile. The module tests start their own OpenBao, the image of the integration environment pinned by digest. It runs on the host network, named and labelled after the session, and is removed when the test JVM ends. The contract tools ran in the pinned node:22.18-bookworm image, as in the other Java units' contract tests.

Check Command Result
Build and every test ./gradlew build in platform/secrets-keys Passed: 84 tests (module 54, unit 3, kit 27), none failed. One kit test is skipped, the Kafka adapter test, which runs on the full profile only (as in the template)
Provider contract test SecretsContractTest, part of the build his-contract verify contracts/ise on all 8 operations of secrets.v1: 20 cases, none failed. validate-event of the published CredentialRotatedOrRevoked and CertificateExpiring: passed
TEST-ISE-026, secrets in repositories and deployed configuration Step 2 of scripts/ends-when.sh: the pipeline's pinned Gitleaks over every tracked file, and over the unit's built image (the jar's own resources unpacked) No leak found in either
Dependency scan, image scan, static analysis platform/delivery-pipeline/bin/dependency-scan, image-scan and static-analysis on platform/secrets-keys Dependency scan: 0 blocking, after the constraint below. Image scan: 0 blocking. Static analysis: no blocking finding
Secret scan of the change platform/delivery-pipeline/bin/secret-scan code origin/main HEAD and secret-scan docs origin/main HEAD No secret found (code and docs)
The change stays in its unit; no contract changed Step 4 of scripts/ends-when.sh Passed: only platform/secrets-keys/, this handover, ADR-HIS-064 and the decision record index changed
Ends when HIS_SESSION=RC-1-S14 platform/secrets-keys/scripts/ends-when.sh Passed, all four steps
Links under docs/ python3 docs/implementation_plan/tools/check_links.py 0 broken, 0 duplicate anchors
Documentation site mkdocs build Builds. The only warnings are earlier handovers' links to platform/ (FN-S05, RC-1-S11)

Requirements and test scenarios

Every test names its requirement, and its test scenario where one exists (JUnit @Tag and display name). The tests are in platform/secrets-keys/mod-ise-006/src/test/java/care/cema/his/ise/mod006/.

Requirement, criterion or scenario Covered by
FR-ISE-KEY-001 AC-01: no secret in repositories and deployed configuration (SEC-009) scripts/ends-when.sh step 2 (Gitleaks over the repository and the unit's image); ServerConfigurationTest "holds no secret"; AccessTest "valuesNeverRecorded" (no value in API answers, history, audit, events, database or log). The pipeline's secret scan runs on every change (FN-S05)
FR-ISE-KEY-001 AC-02: rotation of a service credential and a certificate without interruption, the old no longer authenticating RotationTest "serviceCredential" (old version readable during the overlap, destroyed after) and "certificate" (old certificate trusted during the overlap, revoked in the CRL after, automatic completion once the consumer uses the new one); "key" for keys
FR-ISE-KEY-001 AC-03: identity without a grant is denied and logged AccessTest "denied" (store refuses, history access/denied, audit ise.service-identity.denied) and "unauthenticated"
FR-ISE-KEY-001 AC-04: expiry notice to the owner in the warning window LifecycleTest "expiryNotice" (warning at 30 days, critical at 7, once each, with the owner)
FR-ISE-KEY-001 behaviour 3, PR-KEY-001-2 (automatic or by task; overdue) RotationTest "overdueAutomatic", "byTask"
FR-ISE-KEY-001 behaviour 5, section 10 (overlap; rotation breaks a consumer) RotationTest "serviceCredential" (refused before the consumer switched), "overlapExtended"
FR-ISE-KEY-001 behaviour 6 (revocation at once, published) LifecycleTest "revocation", "certificateRevocation"
FR-ISE-KEY-001 behaviour 7 (key recovery under dual control) RecoveryTest "dualControl", "destroyedCannotBeRecovered", "grantChangeKeepsRecovery"
FR-ISE-KEY-001 section 7, CFG-ISE-014 (inputs, policy maximum, least privilege) InventoryApiTest "policyMaximum", "leastPrivilege", "registration", "policyChange"
FR-ISE-KEY-001 section 11, CFG-ISE-013 (states, renewal, expiry) LifecycleTest "renewal", "expired"; RotationTest "certificate" (Requested to Active)
FR-ISE-KEY-001 section 12 (every access recorded, values never) AccessTest "denied", "valuesNeverRecorded"; ServerConfigurationTest "auditCannotBeSwitchedOff"
FR-ISE-KEY-001 section 3 and section 10 (policy decision; store unavailable) AccessTest "policyDecision"; InventoryApiTest "storeUnavailable", "policyChange" (a service identity cannot change a policy)
FR-ISE-KEY-001 outputs (expiry and rotation report) InventoryApiTest "listAndReport"
TEST-ISE-026 (scan for secrets; rotate a credential and a certificate; request a secret without a grant) scripts/ends-when.sh step 2; RotationTest "serviceCredential", "certificate"; AccessTest "denied"
FR-ISE-KEY-002 AC-01: encryption coverage verified by configuration review and penetration test EncryptionTest "coverage", "scan"; TlsProbeTest (approved, weak and plain channels); ServerConfigurationTest "channel" (the store's own listener from server.hcl)
FR-ISE-KEY-002 AC-02: an unencrypted store is refused EncryptionTest "unencryptedStoreRefused"
FR-ISE-KEY-002 AC-03: service-to-service traffic encrypted and mutually authenticated EncryptionTest "transportRefused" (definition without mutual TLS refused), "scan"; TlsProbeTest "approvedChannel", "weakChannel"
FR-ISE-KEY-002 PR-KEY-002-1, PR-KEY-002-2; behaviour 4, 5 EncryptionTest "unencryptedStoreRefused", "transportRefused", "keyMustBeActive", "scan"
FR-ISE-KEY-002 behaviour 6, sections 11 and 12 (versions, deprecation, exceptions with approver and expiry) BaselineTest; EncryptionTest "exception", "baselineRecorded"
TEST-ISE-027 (review encryption configuration; penetration test of channels and stores; provision an unencrypted store) EncryptionTest, TlsProbeTest, ServerConfigurationTest
Contract secrets.v1 and events EVT-ISE-005, EVT-ISE-006 (IF-ISE-007) contract/SecretsContractTest

The non-functional targets were designed for as follows: - NFR-ISE-005, security: - the baseline of 9.7 is the provisioning rule and the store's listener; - the controller cannot read values; - grants are least privilege; - every access is audited. - NFR-ISE-009, interoperability: the contract test, and the unit's own APIs in the conventions of contracts/common. - NFR-ISE-012, observability: - the template's correlation identifiers and telemetry; - the metrics his_secrets_access_total, his_secrets_access_denied_total, his_secrets_rotations_total, his_secrets_overlap_extensions_total, his_secrets_expired_total and his_secrets_compromise_revocations_total; - alerts as ERROR log lines that the observability unit's rules can match. - NFR-ISE-016, time integrity: UTC everywhere. Access times are the store's own. Times are compared by generation, never across clocks. - NFR-ISE-018, localization: the unit has no screen. Its messages are English, like every unit's, and times are UTC instants that the screen (RC-1-S22) shows in local time.

Differences from the card or specification

  • A Rotated item behaves as Active. rotateItem start and revokeItem accept Rotated beside Active and Expiring, and a warning window moves a Rotated item to Expiring. secrets.v1 names only Active and Expiring. The review (round 1) asked this on issue #28 under rule 3. The person answered on issue #28 (2026-11-25): follow common practice. In key management (NIST SP 800-57 Part 1, the key states of section 5.3) the replacement is the active material, and a compromise can be declared in any state before destruction; certificate lifecycle tools renew and revoke a renewed certificate like any other (ADR-HIS-064, point 8). Tests: RotationTest.rotatedRotatesAgain, rotatedIsRevoked, rotatedEntersExpiring.
  • A key recovery is checked again at confirmation: a secret, credential or certificate revoked after the request cannot be confirmed (RecoveryTest.revokedAfterRequestCannotBeConfirmed).
  • Recovery and encryption have no contract operation. FR-ISE-KEY-001 behaviour 7 and FR-ISE-KEY-002's coverage report are shown on UI-ISE-008, but secrets.v1 has neither. They are the unit's own APIs (api/), in the conventions of contracts/common, until an ISE contract session moves them in compatibly. No contract file changed (session rule 4).
  • CFG-ISE-014 classes. The contract has four item types; CFG-ISE-014 has finer classes. The unit tells them apart by what the record holds, and by a setting for named long-lived keys (ADR-HIS-064, point 7). Dynamic database credentials (24-hour leases) are leases of the store, not inventory items, and are not built in this card.
  • Certificates are issued by the unit through OpenBao's PKI. cert-manager, named in the contract point, is the production issuer in Kubernetes. There is no Kubernetes in the integration environment, and the rotation behaviour must be proven now, so the unit issues through the same per-item role. The bundle passes through the unit's memory once, on its way into the store, and is never logged, stored or answered. Moving issuance to cert-manager changes only the issuing step (ADR-HIS-064, alternatives).
  • The development root CA. The bootstrap gives a development store a root CA of its own, labelled synthetic. Production imports an intermediate signed by the root in the HSM (9.7); that is a deployment step of RC-1-S20 or later, not built here.
  • The security incident on suspected compromise is a security-category audit event (ise.service-identity.denied, action security-incident) and an alert. No incident service exists yet. Suspending the bound interfaces is the interface registry's (MOD-ISE-003).

Questions for a person

None. The question of review round 1 (may a Rotated item rotate again, be revoked, and enter Expiring?) was answered on issue #28: yes to all three, following common practice. The Enterprise Architecture Board approved ADR-HIS-064 on 2026-11-25; its point 8 was completed after that with the answer.

Follow-ups outside the card

  • D10 audit catalogue (RC-1-S04's unit): register the ISE event types this unit emits, as D02-ISE 9.5 lists them: ise.secret.accessed, ise.key.lifecycle, ise.certificate.lifecycle, ise.service-identity.denied and ise.config.changed. Until then the audit service may quarantine them.
  • D10 task type (RC-1-S15's unit): register the task type ise.secrets.rotation-due and the assignee role security-engineer, the rotation task of a secret rotated by task.
  • D10 policy (RC-1-S16): the actions of the unit's README ("Settings") on ise.CryptographicItem and ise.EncryptedResource. The policy enforces separation of duties (section 3): key custodians do not administer the data the keys protect, and SRE may read metadata and rotate but not change grants.
  • Deployment topology (RC-1-S20):
  • deploy OpenBao from openbao/server.hcl (three Raft nodes, the HSM seal, the TLS material of the listener);
  • run the bootstrap once as a job;
  • give the unit the controller token through the secret mechanism, and set HIS_OPENBAO_WORKLOAD_ISSUER to the cluster's service account issuer;
  • send each store and endpoint definition to checkProvisioning before applying it.
  • Delivery pipeline (RC-1-S19): run checkProvisioning on the OpenTofu plans of platform units, and turn a secret-scan finding into a revocation with suspectedCompromise once the leaked value is matched to an item (behaviour 8).
  • Observability (platform/observability): alert rules on the metrics above and on the unit's ERROR lines (overlap extended, expired, security incident). The unit's access records are already ECS JSON with correlation identifiers.
  • ISE contract session of a later slice:
  • move key-recovery.v1 and encryption.v1 into contracts/ise;
  • let rotateItem start and revokeItem name Rotated beside Active and Expiring (answered on issue #28).
  • Interface registry (MOD-ISE-003): suspend the interfaces bound to an item from CredentialRotatedOrRevoked with suspectedCompromise.
  • Service template (services/_template, a card that covers it): the template still locks lz4-java 1.11.2 and snappy-java 1.1.10.7, so every new unit starts with the same high findings. The constraint above belongs in the template's his.java-module convention. The template's new-unit.sh --into also writes an absolute his.envCommand; a folder at the depth of services/<unit> needs the relative one, which this session set by hand.
  • Development environment (FN-S02): its OpenBao has no audit device, and none can be added through the API. A session that needs access records against the shared environment's store starts its own from openbao/server.hcl, as this unit's tests do.