Implementation plan / Session plan / Handover RC-1-S11
Handover RC-1-S11 Build: Platform: network and workload protection¶
Card: RC-1-S11. Issue: cema-care/his#25. Branch: session/RC-1-S11. Slice: RC-1. Decision record: ADR-HIS-055.
What was built and where¶
All of it is in platform/network-protection/. Its README has the commands. MOD-ISE-007 is one checked model, rendered to every enforcement point (ADR-HIS-055).
The model, TOML under the unit:
- model/zones.toml: the eight zones of ASM-ISE-003, each with its restriction policy for unmanaged and non-compliant assets (PR-NET-001-2);
- model/flows.toml: 21 allowlisted flows (DE-ISE-003), each with source and destination zone, protocol, ports, purpose, owner, status, review date, proposer and approver;
- model/admin-access.toml: the management path: administrative ports, the adm.<name> identity, MFA methods, required SSH methods and session recording;
- model/baselines.toml: seven hardened baselines and the CFG-ISE-019 patch timeframes;
- model/environments/reference.toml: the reference addressing plan (private ranges, documentation ranges for the external peers);
- inventory/assets.toml: ten synthetic assets (DE-ISE-004);
- isolations/: the isolation records, empty in the repository.
The tool bin/netprotect (package netprotect/), Python 3.11 or later, standard library only:
- check: the policy check. It rejects:
- direct external access to the data zone ("route through gateway");
- user zones to the data zone;
- external traffic anywhere but the secure edge (BR-ISE-001);
- an administrative port opened from outside the management zone;
- egress to external without named peers;
- missing mandatory fields;
- a self-approved or unapproved Active rule;
- bad lifecycle or review dates;
- a missing zone;
- a policy that leaves an unmanaged asset connected in a clinical or data zone;
- inconsistent environments and asset records.
- render: writes rendered/<env>/:
- the zone-edge nftables rule set;
- a Cilium cluster-wide policy per cluster zone, and the Cilium and Hubble settings;
- the Argo CD Application per cluster;
- the API server's structured authentication with MFA and administrative-identity rules;
- the sshd settings and the gate settings for the bastion and the nodes.
rendered/reference/ is committed, and the tests fail when it is stale.
- reconcile: compares discovered assets (a discovery document, or the Kubernetes API) with the inventory. It writes the compliance report of part 9 (JSON and Markdown, UTC and local time) and quarantines unmanaged assets at the zone edge. It emits SecurityAlertRaised (unmanaged-asset, baseline-deviation).
- isolate, authorize and lift: each acts for the person whose own D10 access token it is given (from a file or HIS_NETPROTECT_ACTOR_TOKEN, verified RS256 against the issuer's keys; netprotect/tokens.py). Each is decided by the D10 policy decision point for that identity (ise.NetworkIsolation), with the incident among the attributes. A Tier 1 isolation waits as Awaiting authorization until the Incident Commander runs authorize with their own token. An applied isolation:
- keeps a record;
- changes the edge's isolated set at once;
- adds a Cilium deny policy for a workload;
- emits SecurityAlertRaised (isolation) and ise.isolation.applied or .lifted.
- alerts: turns the zone edge's drop log (nftables to ulogd) into SecurityAlertRaised (blocked-flow, admin-access-refused, isolation). One alert is raised per flow per five minutes.
- deliver: sends the outbox. Audit events go to the audit intake; alerts, keyed by aggregate, go to a backbone producer command. Only what is acknowledged is marked delivered.
- changes: one ise.config.changed per rule, zone, asset, baseline or management-path change between two revisions, with the approver.
- gate, and bin/admin-gate: the sshd ForceCommand of the bastion and the nodes. It refuses a session from outside the management path, by a non-administrative identity, without both sign-in methods, or that cannot be recorded. It keeps nothing itself: it streams the session from script(1) to the session recorder.
- recorder: the session recorder, a daemon running as the system user his-recorder (netprotect/recorder.py). It takes the administrator's identity from the kernel (SO_PEERCRED) and records only administrative identities. It writes the recording, ise.privileged-session.started and .ended, and the gate's admin-access-refused alerts, where the administrator cannot read or change them. A session cut off without its end is recorded as failed.
Ansible (ansible/), syntax-checked:
- netprotect: the tool and model on a host, and the outbox;
- zone-edge: the rule set, checked with nft -c before install; ulogd; a one-minute alerts and delivery timer;
- bastion: the sshd settings, the gate, the PAM second factor, the session recorder (its user, service, recording directory and outbox), and the timer that delivers the recorder's outbox as his-recorder;
- control-plane: the API server's authentication file through the RKE2 configuration.
Tests:
- test/unit/: 90 tests;
- test/testbed/: 11 tests. The zones are Docker networks, a zone-edge container loads the rendered rule set, and every acceptance criterion is probed with real connections. A bastion runs OpenSSH with PAM, the rendered settings, the gate and the recorder, and takes real SSH sessions. A local issuer signs the people's tokens. The contract checks follow: the Domain 10 stub for decisions and audit, and validate-event for the alerts.
test/run.py writes each result and what it covers to test/out/results.json.
Scripts:
- ci.sh: what the pipeline runs (kind script): the check, the rendering current, all tests;
- scripts/ends-when.sh: this card's "Ends when", with the full profile's backbone.
ADR-HIS-055 and its row in the decision record index.
Checks and their result¶
The checks ran on this server with Python 3.14 and Docker 29.9. The integration environment ran as HIS_SESSION=RC-1-S11 (his-rc-1-s11) and was reset afterwards. The testbed objects are named his-np-rc-1-s11-* and are removed at the end.
| Check | Command | Result |
|---|---|---|
| Model and environments | bin/netprotect check |
0 errors, 0 warnings |
| Rendering current | bin/netprotect render --env reference --check |
current |
| Unit tests | python3 test/run.py --unit |
90 of 90 passed |
| Enforcement and contract tests (TEST-ISE-029) | python3 test/run.py |
11 of 11 passed (about 70 s) |
| Pipeline build | ./ci.sh |
passed |
| Ansible | ansible-playbook --syntax-check (ansible-core 2.18.20) |
both playbooks pass |
| Alerts on the backbone | scripts/ends-when.sh, step 3 |
16 alerts published on his.ise.securityalert.v1, 16 read back, all pass validate-event |
| Ends when | HIS_SESSION=RC-1-S11 platform/network-protection/scripts/ends-when.sh |
passed |
| Static analysis | platform/delivery-pipeline/bin/static-analysis platform/network-protection |
no blocking finding |
| Secret scan | platform/delivery-pipeline/bin/secret-scan code origin/main HEAD |
no secret |
| Documentation links | python3 docs/implementation_plan/tools/check_links.py |
0 broken |
| Documentation site | mkdocs build |
builds |
The unit has no third-party dependency, so it has no lockfile and the dependency scan has nothing to find.
How the "Ends when" lines are met:
- Every acceptance criterion of FR-ISE-NET-001 has a passing test: the table below.
- The listed test scenario passes: TEST-ISE-029 is the testbed suite, with real traffic.
- The contract tests pass:
- every SecurityAlertRaised the tests produced passes his-contract validate-event against contracts/ise, and again after a round trip through Kafka;
- the policy decisions and audit events sent to his-contract serve contracts/ess record no violation.
- The change touches only the unit's files: platform/network-protection/, plus this handover, ADR-HIS-055 and its index row.
Requirements and test scenarios¶
FR-ISE-NET-001, with the tests that cover it. Test names are shortened. Each test names its identifiers in its description and in test/out/results.json.
| Criterion or part | Tests |
|---|---|
| AC-01 a non-allowlisted flow between zones is blocked and logged | testbed TestAC01Flows (TEST-ISE-029): allowlisted flows pass; four others are dropped, and the drop is logged as blocked-flow and turned into an alert. Unit tests: ZoneEdge.test_default_deny_and_log, Kubernetes.test_the_application_zone_policy_allows_only_its_flows, FlowLog.test_a_dropped_flow_becomes_a_blocked_flow_alert |
| AC-02 administration without MFA or outside the management path is refused | testbed TestAC02ManagementPath (TEST-ISE-029): SSH from the clinical, secure-edge and application zones is refused and logged as admin-access-refused; from the privileged workstation it passes. Testbed TestAC02bPrivilegedSessions: real SSH sessions to the bastion; two administrators on one day are recorded; a session from a management host that is no privileged workstation, with a wrong second factor, without a key, or by an everyday identity is refused; the administrator cannot list, delete or forge the recording or its audit events. Unit tests: AdminGate.* (outside the path, no MFA, everyday identity, no recorder, refusal alerted as the kernel's identity, session cut off), FlowRules.test_an_administrative_port_from_outside_the_management_zone_is_rejected, ZoneEdge.test_administrative_ports_are_refused_before_any_flow_rule, Kubernetes.test_the_cluster_api_accepts_only_mfa_and_administrative_identities, ManagementPath.test_sshd_* |
| AC-03 no unmanaged asset is connected to a clinical or data zone | testbed TestAC03Inventory (TEST-ISE-029): an unknown host joins the clinical network, reconcile finds it, and it is quarantined at once. It loses everything but remediation, while the managed and the flagged non-compliant workstations keep working. Unit tests: Unmanaged.*, ZonesAssetsEnvironments.test_unmanaged_assets_are_quarantined_in_clinical_and_data_zones, Sources.test_workloads_from_the_kubernetes_api |
| AC-04 a compromised endpoint is contained without affecting other zones | testbed TestAC04Isolation (TEST-ISE-029):- the isolated workstation reaches nothing and is reached only by the forensic collector; - the other workstation and every other zone's flows keep working; - lifting restores it; - a Tier 1 isolation waits, isolating nothing; an authorization without a token, or with a forged one, is refused; the Incident Commander's own authorization applies it. Unit tests: Isolate.*, ZoneEdge.test_isolation_cuts_established_flows_and_keeps_forensics, Kubernetes.test_an_isolated_workload_gets_a_deny_all_policy |
| Behaviour 1, zones | ReferenceModel.*, ZonesAssetsEnvironments.test_environments_keep_zones_apart |
| Behaviour 2, allowlisted flows; no direct user or external access to databases | FlowRules.*, ZoneEdge.test_the_data_zone_is_reached_only_from_the_application_and_management_zones, ZoneEdge.test_only_active_rules_are_enforced |
| Behaviour 3, management path, MFA, separate identities, recording | AC-02 tests, ZonesAssetsEnvironments.test_the_management_path_needs_mfa_and_recording, AdminGate.test_an_accepted_session_is_recorded_between_audit_events |
| Behaviours 4 to 6, inventory, baselines, patches | Baselines.* (including CFG-ISE-019 timeframes), Sources.* |
| Behaviour 7, rapid isolation preserving evidence | AC-04 tests |
| Behaviour 8, controlled egress | FlowRules.test_egress_to_external_names_its_destinations, ZoneEdge.test_external_traffic_only_at_the_secure_edge_and_to_named_peers |
| Part 7, inputs | FlowRules.test_a_flow_rule_has_its_mandatory_fields, ZonesAssetsEnvironments.test_an_asset_record_has_owner_zone_type_and_baseline, Isolate.test_an_isolation_request_has_actor_scope_and_reason |
| PR-NET-001-1 to -3 | AC-01, AC-03 and AC-02 tests |
| Part 9, outputs | Sources.test_the_report_shows_utc_and_local_time, Rendered.*, TestZContracts.test_every_security_alert_meets_the_ise_contract |
| Part 10, validation and error handling | FlowRules.test_direct_external_access_to_the_data_zone_is_rejected, Isolate.test_isolation_that_cuts_a_tier1_service_requires_the_incident_commander, Isolate.test_a_zone_isolation_of_a_tier1_zone_needs_the_incident_commander |
| Part 11, lifecycles | FlowRules.test_lifecycle_and_review_dates, Baselines.test_an_isolated_asset_is_reported_isolated, Unmanaged.test_a_decommissioned_asset_seen_again_is_unmanaged |
| Part 12, audit | Changes.test_each_rule_change_is_audited_with_its_approver, Isolate.*, AdminGate.*, Delivery.*, TestZContracts.test_decisions_and_audit_events_meet_the_ess_contract |
| Part 3, permissions | PolicyDecision.*, Verify.* and CommandLine.* (tokens), Isolate.test_the_incident_is_required_and_given_to_the_decision, Isolate.test_without_a_permit_nothing_is_isolated, FlowRules.test_a_rule_is_active_only_when_approved_by_someone_else |
Non-functional targets of the card:
- NFR-ISE-005, security: no third-party dependency; static analysis and secret scan clean; the policy decision point fails closed.
- NFR-ISE-009, interoperability: the contract tests above.
- NFR-ISE-012, observability:
- ECS JSON logs with the correlation identifier;
- every alert and audit event carries one;
- drops are deduplicated per window, so alerts stay actionable.
- NFR-ISE-016, time integrity: every time is UTC with Z, and zone edges run on UTC.
- NFR-ISE-018, localization: the compliance report shows UTC and the environment's time zone.
Differences from the specification or contract, and why¶
- EVT-ISE-013's producer. D02-ISE section 8.5 names MOD-ISE-008 as the producer of SecurityAlertRaised. The contract points of
contracts/isegive this session the publishing for blocked flows, unmanaged assets, refused administrative access and isolation, and this session follows the contract. The events carry producerise-network-protectionand source/his/ise/network-protection. The contract fixes no producer per topic. Architecture 6.3 says only the topic's owner publishes, and RC-1-S10 (observability) and RC-1-S14 (credential-access-denied) will also raise security alerts. RC-1-S13 must settle the owner ofhis.ise.securityalert.v1(follow-ups). - The integration zone. Architecture section 10.1 draws an "integration zone" for Kafka, Camel and HAPI FHIR. FR-ISE-NET-001 and ASM-ISE-003 name eight zones, so it is a segment of the application zone here.
privacyReviewNeededis set where patient data may have been within reach:- a blocked flow toward the data zone;
- an unmanaged asset in the data zone;
- an isolation in the clinical-endpoints, application or data zone.
The contract leaves the trigger open. Question 3 asks the privacy officer to confirm it.
- AC-03 at the zone edge. A quarantined asset loses every flow that crosses a zone edge. Inside its own network segment it can still reach its neighbours at layer 2, until the access switch shuts its port. Switch-port control (802.1X or port security) is network hardware outside this repository (follow-ups).
- Cluster enforcement is rendered, not yet exercised. The Cilium policies, the Hubble settings and the API server's authentication rules are generated and unit-tested, but there is no cluster yet (RC-1-S20). The zone-edge rule set is exercised with real traffic.
- What the recorder cannot stop. The session's processes belong to the administrator, so an administrator who can become root on the host (sudo) could stop the recorder or the stream from then on. That is recorded as a session ended with outcome failure, and whatever was recorded before stays out of their reach. Forwarding recordings to the SIEM as they are written (RC-1-S10) moves them off the host as well.
- The Kubernetes sign-in no longer checks a role claim. The first version required platform-administrator in realm_access.roles. The D10 token profile (ADR-HIS-048) makes roles no claims, so the rule now requires the second factor (acr aal2 or an amr method) and the administrative identity. What an administrator may do in a cluster is RBAC on oidc:adm.<name> (follow-ups).
Review round 1¶
The review asked for four changes, all made on this branch:
- The Incident Commander's authorization could be faked. The decision subject and the authorizer were command-line names.
isolate,authorizeandliftnow take the acting person's own token and verify it against the issuer's keys. The decision point is asked about that identity, and the call carries the unit's service token.--actor,--roleand--authorized-byare gone, and option abbreviations are off, so no prefix can stand in for them.- A Tier 1 isolation waits until the commander authorizes it with their own token.
- Tests:
test_tokens.py,Isolate.*, testbedTestAC04Isolation, including a forged token. - The second administrator of a day was locked out. The gate made a per-day folder under the first administrator's identity. The recorder now writes one file per session in its own directory. Tests:
AdminGate.test_every_administrator_of_the_day_is_recorded, testbedTestAC02bPrivilegedSessions, with realscript(1)and real sshd. - The administrator could alter their session record. Recording and audit now go through the session recorder, which runs as
his-recorderand takes the administrator's identity from the kernel. Tests:AdminGate.*, and testbedtest_the_administrator_cannot_change_the_record. - The incident was not in the decision.
--incidentis now required, and the incident is an attribute of every isolate, authorize and lift decision. Test:Isolate.test_the_incident_is_required_and_given_to_the_decision.
Found while fixing these: the Kubernetes sign-in rule read a role claim, which the D10 token profile does not carry. It no longer does (above).
Review round 2¶
The review asked for four changes, all made on this branch:
- The authorization did not bind what is applied.
authorizenow recomputes the networks and Tier 1 services from the model and refuses a record that no longer matches. The decision point is told what is cut.renderandliftalso take the addresses from the model, never from the record. Tests:Isolate.test_a_record_widened_after_the_request_is_not_authorized,ZoneEdge.test_the_rendered_isolation_comes_from_the_model_and_the_records_environment. - A waiting Tier 1 request, and refusals, were not audited. Every step is now audited.
- A request, an authorization and an application each give
ise.isolation.applied, with actionrequest,authorizeorisolateand outcomesuccessordenied. A refused lift givesise.isolation.liftedwith outcomedenied. - Each event carries the actor, the time, the reason and the incident.
- Section 9.5 registers only
appliedandliftedfor isolation, so the steps use those types (follow-up). - Tests:
Isolate.test_isolation_that_cuts_a_tier1_service_waits_for_the_incident_commander,test_a_refused_request_and_a_refused_lift_are_audited,test_an_authorization_the_decision_point_does_not_permit_isolates_nothing. - Records were not tied to an environment. Each record now names its environment.
render,reconcile,authorizeandliftuse only that environment's records, and a record without an environment is never rendered. Test:Isolate.test_a_record_belongs_to_its_environment. - The token's audience was not checked. The token must be issued for the environment's
commandAudience: itsaudnames it, or itsazpis it. Every environment must name it (check NET-CHK-012). Test:Verify.test_a_token_of_another_client_is_refused.
Review round 3¶
The review asked for two changes and a nit, all made on this branch:
- Live isolation and quarantine did not survive a reload. The rule set replaces the table whole, with empty
isolatedandquarantinedsets, and the boot service and the deployment handler reload it. - A live change now goes through
netprotect edge seton the edge (netprotect/edge.py). It writes the edge's state file (/var/lib/his/zone-edge/isolated,quarantined; synced, replaced atomically) before it changes the set. - The edge loads its rule set only through
netprotect edge load. The load adds the state in the same nftables transaction.his-zones.serviceand the zone-edge Ansible handler now use it. - Tests:
test_edge.py, plus a reload in testbedTestAC03Inventory(the quarantined host stays blocked) andTestAC04Isolation(the isolated endpoint stays contained; a lifted one stays lifted). - Two requests at once could share a record. The record's file is now reserved with
O_EXCLbefore the decision call, and a taken number moves to the next. A refused request keeps its record with statusRefused. Test:Isolate.test_requests_made_at_once_get_their_own_records. - Nit: the pull request description and this handover give the same counts: 90 unit tests and 11 testbed tests.
Reconcile is not scheduled by this unit. Its discovery input, the Wazuh inventory, comes with RC-1-S10 (follow-ups). Meanwhile the last quarantine list is kept on the edge and survives a reload.
Questions for a person¶
None blocks this session; the unit applies the setting shown until answered. All three are on issue #25 (comment) and under "Needs a person" in the pull request.
| # | Question | Owner | What the unit does now |
|---|---|---|---|
| Q1 | PR-NET-001-2 says an unmanaged or out-of-baseline asset has its network access "restricted per policy", and no policy states which. Are these defaults right? | Security and privacy office; clinical engineering for devices | Unmanaged assets are quarantined in every zone except devices, where they are flagged to clinical engineering. In the clinical-endpoints and data zones quarantine is mandatory (AC-03). Out-of-baseline assets are flagged, not restricted, in every zone. All of it is set per zone in model/zones.toml |
| Q2 | When the D10 policy decision point is unavailable, may a Security Engineer still isolate a compromised endpoint (a break-glass for containment), or does isolation wait? | Security and privacy office, with the D10 owner | Isolation is refused, as for any Deny: "an error is a Deny at the caller", contracts/ess policy-decision. The only other way is a reviewed commit of an isolation record, rendered and applied by Ansible |
| Q3 | Which security alerts need a Domain 10 privacy review (privacyReviewNeeded)? |
Privacy officer (D10) | The triggers listed above |
Follow-ups outside the card¶
- RC-1-S20 (deployment topology):
- set
cni: ciliumin RKE2; - label every namespace
his.cema.care/zone, and every workloadapp.kubernetes.io/name; - apply
rendered/<env>/kubernetes/<cluster>/cilium-settings.yaml; - write each real environment's file in
model/environments/; - build the zone-edge firewalls, and run the Ansible roles of this unit on the edges, the bastion, the nodes and the RKE2 servers;
- verify the Cilium policies in a real cluster.
- RC-1-S16 (D10 decision service):
- register the resource type
ise.NetworkIsolationwith actionsisolate(Security Engineer, during an incident),authorize(Incident Commander) andlift; - the attributes
scope,tier1Impact,incidentandrequestedByofise.NetworkIsolation, so that the policy can require the Security Engineer's incident authority and refuse a requester authorizing their own Tier 1 isolation if the policy owner wants that; - MFA claims (
amr) in the realm, as RC-1-S01 and RC-1-S03 also noted. - Audit (MOD-ESS-006, merged in RC-1-S04): register the event types
ise.config.changed,ise.isolation.applied,ise.isolation.lifted,ise.privileged-session.startedandise.privileged-session.ended, if they are not in the catalogue yet. - RC-1-S13 (event backbone):
- settle the owner of
his.ise.securityalert.v1: this unit, observability and secrets-keys all raise security alerts; - provide the producer command or API that
netprotect deliver --alerts-commandhands alerts to.scripts/ends-when.shuses Kafka's console producer of the integration environment. - RC-1-S10 (observability):
- have the Wazuh agent forward
/var/log/his/zone-edge-blocked.log, Hubble'shis-dropped-flows.logand the privileged session recordings; - add the detection rules that correlate them.
- RC-1-S19 (delivery pipeline): on merge to main, run
bin/netprotect changes --base <before> --head <after>anddeliver, so each rule change is audited with its approver. - D10 MFA for SSH: the PAM line of the second factor is a deployment variable (
his_ssh_mfa_pam) until D10 publishes how its MFA reaches SSH. - Network hardware: 802.1X or port security on the access switches of the clinical and data networks, so a quarantined asset is cut off inside its segment too (AC-03).
- An audit event type for an isolation request: D02-ISE section 9.5 has only
ise.isolation.appliedand.lifted. The owner of D02 may addise.isolation.requested(and register it in the audit service). The unit then moves therequestandauthorizesteps to it. - Scheduled reconciliation (RC-1-S10): run
netprotect reconcile --apply-with ...on a timer from the management zone, once the Wazuh inventory export gives it its discovery document. - D10 client
his-network-protection: the realm needs the client whose tokens the isolation commands accept (commandAudience). - Cluster RBAC for administrative identities: bind
oidc:adm.<name>users to cluster roles (RC-1-S20), or put a webhook authorizer to the D10 decision point in front of the API server. - Design system: none; this unit has no screens.