Skip to content
iam-ids-sdp

Identity-aware Software-Defined Perimeter

Verify who.
Watch how.

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.

  • Published in the International Journal of Information Security, 2025
  • Two modes traditional and proposed, same lab, same demo
  • Provenance written in 2026 following the paper; its results were not regenerated with this code. Details
Session lifecycleSimulation of the lab
private MFA introspect SPA · mTLS · token keys · identity SPA telemetry alert Keycloak MFA · realm roles Controller policy · RBAC IDS MAB · UEBA Client sdp-client · alice Gateway SPA · token check Service nginx · hidden gateway: INPUT DROP · no session for alice

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.

WhereIn front of internal web services
What it addsMFA, roles and live revocation
CostAbout 75–100 ms per set-up, as reported

The problem

A key is not
a person.

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.

Devices, not users

A stolen device key is enough to pass the controller.

All or nothing

No roles: a device reaches every service it is registered for.

Blind after the knock

An authorized session can consume anything without anyone noticing.

What the proposed architecture adds to the SDP (paper, Sect. 5).

How it works

From login
to revocation.

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.

01

Authenticate

Password and TOTP at Keycloak; the token's realm roles decide which services a user may request.

02

Authorize twice

The controller validates and introspects the token; the gateway checks it again for every request.

03

Watch and revoke

Per-session telemetry feeds the IDS; an alert removes rules, connections and the Keycloak session.

./scripts/demo.sh
$ ./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

Roles in,
sessions out.

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.

config/policy.yaml
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]
terminal
$ 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

Results reported in the paper

Identity costs
milliseconds.

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.

TopologyTraditionalProposedDifference
1 IH, 1 AH103 ms181 ms+78 ms
1 IH, 2 AHs115 ms180 ms+65 ms
1 IH, 5 AHs137 ms230 ms+93 ms
5 IHs, 10 AHs143 ms247 ms+104 ms

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.

Questions.

Is this the code used in the paper's evaluation?

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.

Does it reproduce the paper's attack experiments?

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.

What does the IDS actually learn?

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.

Can I run it in production?

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.

How does it relate to SDP Lab and SecureSDP?

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.

How do I cite it?

Cite the article in the International Journal of Information Security 24, 178 (2025). BibTeX is on the paper page.

Put identity
on the perimeter.

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