Identity-aware Software-Defined Perimeter
Keycloak checks who the user is, with MFA, before any packet reaches a gateway. The gateway checks the token again on every request, and an IDS revokes the session as soon as its behaviour drifts.
The user logs in to Keycloak with password and TOTP. The access token carries the realm roles that decide what the user may ask for.
The problem
A classic SDP trusts the device key pair. Whoever holds it gets every service listed for that device, and once the gateway opens, nobody looks at what the session does.
A stolen device key is enough to pass the controller.
No roles: a device reaches every service it is registered for.
An authorized session can consume anything without anyone noticing.
Password and TOTP, realm roles and short-lived session tokens.
IAM →The controller and each gateway validate the token on their own.
Architecture →Thompson sampling picks a classifier from a pool for every window.
IDS →Each user is compared with their own usual behaviour, not with everyone.
UEBA →What the proposed architecture adds to the SDP (paper, Sect. 5).
How it works
Every session starts with an MFA login and ends with a disconnect or with a revocation the IDS asked for. The demo checks each step against the running lab.
Password and TOTP at Keycloak; the token's realm roles decide which services a user may request.
The controller validates and introspects the token; the gateway checks it again for every request.
Per-session telemetry feeds the IDS; an alert removes rules, connections and the Keycloak session.
$ ./scripts/demo.sh PASS password without the TOTP code is refused PASS password + TOTP: token for alice with realm role researcher PASS MFA token -> SPA + mTLS controller -> SPA accepting host -> HTTP 200 PASS no token: the controller refuses the session (401) even with a valid device certificate PASS wrong role: bob (viewer) is refused records (403) PASS accepting host refuses a request on alice's session without the token (independent validation) PASS IDS raised an alert for alice's session 339521b94a0479a9ceb2e1d4 PASS controller acknowledged the alert and revoked the session PASS Keycloak session of alice ended (audit: iam_logout) PASS bob's session is unaffected (/portal/ -> HTTP 200) PASS alice re-authenticated (password + TOTP) and reached the portal All checks passed.
Recorded from the lab (11 of the 22 checks shown). The IDS alert comes from a short load test with hey on alice's own session. What the demo checks →
Run it
One policy maps services to Keycloak realm roles and devices to their owners. Docker Compose starts Keycloak, the IDS, the controller, a gateway in front of nginx and two clients, with the PKI created at start-up.
services:
portal:
path: /portal/
roles: [viewer, researcher, admin]
records:
path: /records/
roles: [researcher, admin] # sensitive data
devices:
ih-alice:
owner: alice # researcher
services: [portal, records, admin]
ih-bob:
owner: bob # viewer
services: [portal, records, admin]
$ docker compose exec ih-alice sdp-client connect records 1. IAM login (password + TOTP) 58.2 ms 2. SPA to the controller 70.7 ms 3. mTLS session request 60.3 ms 4. SPA to 1 accepting host(s) 115.4 ms 5. first request /records/ 2.8 ms gw-129 -> HTTP 200 $ docker compose exec ih-bob sdp-client connect records denied: controller denied the session (403): forbidden: roles [viewer] do not grant records
Policy decision point: token validation, RBAC, sessions, revocation.
Controller →Default-drop iptables, fwknopd, token-checking proxy, telemetry.
Accepting host →MFA login, SPA, mTLS, local forwarder, workloads and benchmark.
Initiating host →Apollon MAB over a classifier pool plus a per-identity baseline, in Python.
IDS and UEBA →Results reported in the paper
The paper measured four topologies with and without Keycloak and the IDS. Connection set-up grew by roughly 75–100 ms and about 3.3 KB per session; throughput stayed almost unchanged.
Connection set-up time as reported in Payá et al., IJIS 2025 (Tables 2–5). Not regenerated with this implementation; scripts/bench/run.sh measures it on your machine, and one labelled local run is on the performance page.
No. The repository cited by the paper held only an initial commit when it was published. This implementation was written in 2026 following the architecture the paper describes; the paper's numbers were not regenerated with it. See provenance.
No. The repository is defensive: authorization tests and one monitoring test that runs a standard benchmarking tool on a user's own session. The credential-theft and DoS scenarios are summarised as reported in the paper on the security evaluation page.
A small classifier pool, chosen per window by Apollon's multi-armed bandit, over per-session request statistics recorded from benign lab workloads, combined with a baseline per user. It is a lab model, not the paper's Apollon model trained on public intrusion datasets. IDS and UEBA explains how to plug in your own.
It is research software. The lab provisions demo TOTP secrets at realm import, keeps sessions in memory and shares one certificate between gateway replicas. Review components and configuration before reusing any part of it.
They belong to the same research line. SDP Lab runs the Waverley Labs SDP with fwknop, SecureSDP implements the Bridge model, and iam-ids-sdp adds identity and threat detection.
Cite the article in the International Journal of Information Security 24, 178 (2025). BibTeX is on the paper page.
Start the lab, log in with MFA and watch the IDS revoke a session.
git clone https://github.com/antoniopaya22/iam-ids-sdp && cd iam-ids-sdp && ./scripts/gen-env.sh && docker compose up -d --build --wait