Implementation plan / Session plan / Handover RC-1-S28-F28
Handover RC-1-S28-F28 Fix: ess-runtime-decision audits service-identity misuse without the affected component, and outage refusals under an unregistered type¶
Card: RC-1-S28-F28. Issue: cema-care/his#280. Branch: session/RC-1-S28-F28. Slice: RC-1. This is a round 2 fix of the gate session RC-1-S28-G2. The unit belongs to RC-1-S16. No new decision record: the rule is the ruling on #277 with ADR-HIS-101 (below).
The session ran twice: 1. The first run repaired the misuse events. It stopped on the outage refusals, because they hit the rule 3 question already asked on cema-care/his#277 (cases 1 to 3). 2. The ruling was then given there, option A (comment 7309523834), relayed for the Security and Privacy Office and the Domain 10 owner. It names this card. This run implements it.
The failure¶
The gate's evidence is in the first comment on #280 (run 20261201T000308Z-fa9c, audit-quarantine.csv). The audit service quarantined 13 events from ess-runtime-decision:
| Events | Reason | Cause in the code |
|---|---|---|
ess.iam.service-identity-misuse 11 |
/affectedComponent "is required for a security event (D10-ESS 9.5)" |
ServiceIdentities.misuse audited through Audit.record, which sends no top-level category field. D10-ESS 9.5 makes "affected component" mandatory in Security |
access-check-unavailable 2 |
not in the audit event catalogue | The kit's PolicyEnforcer audited an outage under this fixed type with outcome failure. It audited a Deny under the equally unregistered access-denied |
The run's API record shows no 503 from this unit outside POST /v1/decisions. The decision service does not audit its own outage answer through the kit. So the two refusals came from calls the scenario does not record, such as another unit reading this unit's registers.
What was changed and where¶
Only services/ess-runtime-decision.
1. Misuse names its affected component (first run):
- mod-ess-001 support.Audit.security (new) sends a Security event with affectedComponent, which it requires.
- ServiceIdentities.misuse audits through it, with the component from its caller:
| Path | Affected component |
|---|---|
SubjectDirectory.serviceUse, from the decision service (DecisionService.serviceUse): out of scope, wrong environment, a display device writing or reading an unconfigured board |
the unit that asked to act as the identity, named from the authenticated caller (DecisionService.callerComponent): its service identity's client service-account-<unit> gives <unit>; this unit's own enforcement point asks as service:ess-runtime-decision. The request's environment.sourceSystem is set by the caller and is not used (review round 1) |
SubjectDirectory.serviceUse, from DecisionController.caller(): a service identity calling /v1/decisions without the decision scope |
this unit (his.unit.name, ess-runtime-decision) |
SignIns.handle: an interactive sign-on with a service identity |
identity-provider:<client>, the identity provider's sign-on to the client it was tried at; identity-provider when no client is reported |
- api.SubjectAttributes.serviceUse takes a component argument. It is the unit's internal port between MOD-ESS-001 and MOD-ESS-002, not a contract. |
2. A refusal is audited under the refused action's own type (this run, ruling on #277, option A):
- Kit, AuditRecord: two new components, decisionUnavailable and recordNotCreated, with builder methods. AuditEmitter writes each as true when it applies and leaves it out otherwise (ADR-HIS-048, ADR-HIS-101). This is the form RC-1-S28-F22 gave adm-identity's kit.
- Kit, RefusalAuditTypes (new interface): each module names the audit event type of the policy actions it owns. For a type in Administration and configuration, it also gives the current version of the existing item, or none. HisKitAutoConfiguration passes every such bean to the enforcer.
- Kit, PolicyEnforcer: it audits both refusals under the module's type, outcome denied.
- A Deny carries its decision.
- An outage carries decisionUnavailable and no decision.
- In Administration and configuration, an existing item is named with its version. A refusal that concerns no existing item (a list, a creation, an identifier no item has) carries recordNotCreated. Before and after values are not sent, since nothing changed, and the ruling waives them.
- An action no module claims falls back to the first three parts of its code (PolicyEnforcer.typeOfAction), with a warning in the log.
- access-check-unavailable and access-denied are no longer written.
- mod-ess-001 support.IdentityRefusalTypes: every type is in Administration and configuration.
| Policy actions | Type |
|---|---|
ess.iam.account.*, ess.iam.source-event.submit |
ess.iam.account |
ess.iam.role.*, ess.iam.assignment.*, ess.iam.campaign.* |
ess.iam.role |
ess.iam.service-identity.* |
ess.iam.service-identity |
The item's version comes from its table (account, assignment, service identity, campaign). A role's version is its active version.
- mod-ess-002 support.AuthzRefusalTypes:
- ess.auz.decision.* is audited as ess.auz.decision, in Authorization and emergency access, where decisionUnavailable waives the decision;
- ess.auz.policy.* is audited as ess.auz.policy, in Administration and configuration. Its only enforced action is the list, so it carries recordNotCreated.
- Test fixtures: kittest.AuditCategoryRules gets the Security and Authorization categories and two refusal checks:
- refusalMissing: what the rulings on #220 and #277 require of a refusal. It is the ruling, not today's intake;
- intakeRefusalMissing: a copy of what services/ess-audit's SubmissionValidator quarantines of a refusal today (main at 34536a02), without the #277 waiver. It is a copy of the intake's rules, not the intake itself, which this unit's build cannot run.
The cached-decision-used audit of the Tier 1 outage cache is unchanged: this unit does not turn the cache on (follow-up).
No contract, dependency, lockfile or setting changed.
Checks and their result¶
Light profile as HIS_SESSION=RC-1-S28-F28 (his-rc-1-s28-f28). The host's load average was 34 to 50 during this run.
| Check | Command | Result |
|---|---|---|
| The misuse tests with the emitter as on main | ./gradlew :mod-ess-001:test --tests '*ServiceIdentityTest*', with ServiceIdentities.misuse auditing through Audit.record |
3 of 9 fail (AC-01, AC-02, AC-05), each Expecting empty but was: ["/affectedComponent"], the gate's pointer |
| The refusal tests with the enforcer as on main | ./gradlew :mod-ess-001:test --tests '*RefusalAuditTest*' :mod-ess-002:test --tests '*DecisionOutageTest*', with PolicyEnforcer auditing under access-check-unavailable (failure) and access-denied |
Fails: 3 of 3 (both RefusalAuditTest tests, and DecisionOutageTest on the missing ess.auz.decision refusal) |
| The same tests after the repair | the same command | passed: 2 and 1 tests |
| Build and all tests (the owning session's tests) | ./gradlew build in services/ess-runtime-decision, after bringing the branch up to date with main |
Passes: 282 tests, 0 failures, 4 skipped |
| Static analysis | platform/delivery-pipeline/bin/static-analysis services/ess-runtime-decision |
no blocking finding |
| Documentation | python3 docs/implementation_plan/tools/check_links.py |
0 broken links |
Review round 1. The changes requested on #299 are in, listed under "Review round 1" below. Checks after them:
- ./gradlew build: all of mod-ess-002, app and service-kit pass, as do RefusalAuditTest (2), DecisionOutageTest (1) and PolicyDecisionTest (18).
- IdentityContractTest could not complete on this host: the launcher's watcher stops this session's integration environment while the pull request is in review ("stopped the integration environments of RC-1-S28-F28 while it waits"), and its operations fail with "connection refused". The pull request pipeline runs the whole build in an environment of its own.
The slice scenario was attempted and could not run here. HIS_SESSION=RC-1-S28-F28 e2e/harness/scenario run e2e/scenarios/RC-1 stopped at his-env start full: "container his-rc-1-s28-f28-keycloak-1 is unhealthy". RC-1-S28-F22 recorded the same on this host. The watcher above also stops the full profile. So the card's "the slice scenario's tests still pass" has no evidence from this session, and it is listed under "Needs a person". The change affects only the audit event of a refusal and the misuse event. The answers given to callers (403, 503) are unchanged, and DecisionOutageTest and the contract tests check them.
Requirements and test scenarios of the card¶
| Requirement | Test | What it shows |
|---|---|---|
| FR-ESS-AUD-001 part 7 with D10-ESS 9.5 Security; FR-ESS-IAM-003 AC-01, AC-02, AC-05, TEST-ESS-003 | ServiceIdentityTest.ac01OutOfScope, ac02InteractiveSignOn, ac05WallDisplay (extended) |
Every misuse event is denied and names its affected component: the asking unit, or identity-provider:his-web. Each passes the audit service's Security rule |
| FR-ESS-AUZ-001 part 13, FR-ESS-IAM-003 part 6.4 | PolicyDecisionTest.onlyRegisteredServices, serviceSubjects (extended) |
The decision service passes itself, or the asking unit, as the component. A request that states another sourceSystem (fin-revenue-cycle) still names the authenticated caller's unit (adm-identity) |
| FR-ESS-AUD-001 AC-06 with the rulings on #220 and #277; FR-ESS-IAM-001, FR-ESS-IAM-004 | RefusalAuditTest.outageRefusals (new) |
During an outage, these refusals are each audited under their own type, denied, with decisionUnavailable and no decision, and none under access-*: an account read (with the account's version), the account list and an assignment request (recordNotCreated), and a role read (active version 1). An unknown identifier, a malformed one and the feed's submission give no version, so the enforcer sends recordNotCreated. Each passes refusalMissing; on today's intake each is still quarantined for /beforeAfter (intakeRefusalMissing) |
| FR-ESS-AUD-001 AC-06 with the ruling on #277 | RefusalAuditTest.denyRefusals (new) |
A Deny of an account read and of the list is audited under ess.iam.account with its decision identifier and policy version, and no marker |
| FR-ESS-AUZ-001 part 10, TEST-ESS-041; FR-ESS-AUD-001 | DecisionOutageTest.engineOutage (changed) |
The decision read refused in an outage is ess.auz.decision, denied, with decisionUnavailable, and today's intake accepts it. The policy list is ess.auz.policy with recordNotCreated, which today's intake still quarantines. It no longer expects access-check-unavailable |
What the gate line now shows¶
The line is criterion 6 (ACC-005), IF-ESS-008 audit intake, and criterion 4, FR-ESS-AUD-001, of slice gate RC-1. Its check is the audit quarantine after the slice run.
| Events in the gate run | With this branch |
|---|---|
ess.iam.service-identity-misuse 11 |
stored: each names its affected component (the tests above) |
access-check-unavailable 2 |
no longer emitted. Each refusal goes under its action's type, denied. On today's intake only the refusals of ess.auz.decision.* are stored (ADR-HIS-101). Every refusal in Administration and configuration (ess.iam.*, ess.auz.policy) is still quarantined: for /beforeAfter, and also for /recordNotCreated when no item exists. They are stored once services/ess-audit applies the waiver of the ruling on #277, which is outside this card |
So the line's check does not yet fully pass. The misuse events and the decision refusals pass. The configuration refusals pass only once the ess-audit waiver is merged. This unit's side follows the ruling. No card in the plan carries the waiver before the next gate round, RC-1-S28-G3, so G3 would find this line open again. That is asked under "Needs a person" below and on #280.
Differences from the card, specification or contract¶
- The type of account actions that are not edits.
ess.iam.account.unblock,reset-factorsandrevoke-sessionsare audited as refusals underess.iam.account, the type their policy action names. They are not audited underess.iam.block,ess.iam.factororess.iam.session, which are in Authentication and session. That category requires the authentication method and device of a sign-in, which a refused administrative action has none of. "The refused action's own type" is read as the type of its policy action. - A refused request for an identifier no item has still names the identifier asked for, without a version, and says
recordNotCreated. The identifier is what the caller sent, not an invented record. Some paths check that the item exists before the decision and answer 404 (the service identity read does), so the case does not arise there. - No contract change. The markers are those of audit.v1 1.2.
Questions for a person¶
-
A card for the
ess-auditwaiver of the ruling on #277, ahead of RC-1-S28-G3. The waiver is onservices/ess-audit, which this card does not own. Until it lands, this unit's configuration refusals stay in the quarantine, and so do those of RC-1-S28-F25 and F26. The person who plans the fix round should add a fix card onservices/ess-audit(owner RC-1-S04), before G3, that implements the follow-up below. -
The slice scenario run. It could not start on this host (Keycloak unhealthy, and the environment is stopped while the pull request is in review). The RC-1 scenarios should be run on a host or runner that can start the full profile, at the latest by RC-1-S28-G3.
The ruling on #277 settled the question of the first run.
Review round 1¶
The review of #299 asked for changes. What was done:
- The gate line does not yet fully pass. That is stated under "What the gate line now shows", with the ess-audit waiver under "Questions for a person" and in the pull request's "Needs a person".
- The handover contradicted itself on whether a refusal of an existing configuration item is stored today. Corrected: today's intake quarantines it for /beforeAfter.
- Tests against rules this session wrote. refusalMissing now says it is the ruling, not the intake. The new intakeRefusalMissing copies today's SubmissionValidator for refusals, and the tests assert both:
- the ess.auz.decision outage refusal is accepted today;
- the configuration refusals are still quarantined for /beforeAfter.
- The affected component of a misuse came from the caller-set environment.sourceSystem. It now comes from the authenticated caller's service identity (DecisionService.callerComponent). PolicyDecisionTest.serviceSubjects shows that a stated sourceSystem of another unit is ignored.
- The slice scenario was attempted. It did not start (above).
Follow-ups outside the card¶
services/ess-audit(owner RC-1-S04): the waiver of the ruling on #277. In Administration and configuration,SubmissionValidatorshould accept a refusal (outcomedenied):- without before and after values;
- and with
recordNotCreated, without the item reference and version.
Today recordNotCreated is valid only for record change with action create. Until the waiver is in, this unit's configuration refusals without an existing item are quarantined with /recordNotCreated and /beforeAfter, and the others with /beforeAfter. RC-1-S28-F25 and F26 need the same waiver.
- Service template (services/_template, FN-S03's owner): the same unregistered defaults access-check-unavailable and access-denied. This unit's RefusalAuditTypes, and the markers on AuditRecord, are a form the template could take, so that each unit made later names its refusal types.
- cached-decision-used (the Tier 1 outage cache's audit) is also not a registered type. This unit does not use the cache. A unit that does needs a registered type for it.
- Evidence: the gate's API record does not show calls between units, so a refusal's action cannot be traced from the evidence.
- Design system: none from this session.