Skip to content
SDP Lab

Software-Defined Perimeter lab

One packet
opens the door.

Services stay invisible behind a default-deny gateway. A client sends one encrypted, authenticated packet; the gateway opens a path for that client alone, for thirty seconds.

  • Published as SecureSDP in the International Journal of Information Security, 2024
  • Five containers on three networks, one docker compose up
  • Tested end to end in CI on every change
Access flowSimulation of the lab
private network mTLS · access list mTLS · credentials Controller policy · PKI Client initiating host Gateway fwknop · iptables Service nginx · hidden iptables: INPUT DROP · FORWARD DROP

The gateway connects to the controller over mutual TLS and receives the service and access lists.

WhereIn front of any TCP service
What it stopsScans and unsolicited connections
CostOne UDP packet per session

The problem

An open port
is a target.

A service that answers everyone can be found, fingerprinted and attacked before any credential is checked. A Software-Defined Perimeter turns that around: nothing answers until the client has proven who it is.

Scanners find it

Any reachable port shows up in a sweep of the network.

Banners give it away

Versions and software leak before authentication.

Exploits come first

A pre-authentication bug is enough to get in.

Exposed servicescanning…
scan port 8080 open nginx
Behind the SDP gatewayscanning…
scan default deny nginx

Illustration of the mechanism, not a measurement.

How it works

Authenticate,
then connect.

The controller runs the PKI and the policy. The gateway drops everything and listens for Single Packet Authorization. A valid packet opens a short-lived rule for one client, one service and one address.

01

Enroll

Every member authenticates to the controller with mutual TLS; the gateway gets its access list.

02

Knock once

The client sends a single encrypted, HMAC-authenticated SPA packet with fwknop.

03

Open for one

fwknopd adds DNAT and FORWARD rules for that client's address and removes them after 30 s.

docker compose logs sdp-gateway
$ docker compose logs -f sdp-gateway
[gateway] SDP ID 1 listening for SPA on eth1 (10.231.0.20)
(sdp_ctrl_client.c:627) Credentials-good message received
Added service entry for Service ID 1
Added access entry for SDP ID 3
Starting fwknopd main event loop.
(stanza #0) SPA Packet from IP: 10.231.0.40 received with access source match
Added FORWARD rule to FWKNOP_FORWARD for 10.231.0.40 -> 10.231.1.30 port 80
Added DNAT rule to FWKNOP_PREROUTING for 10.231.0.40 -> 0.0.0.0/0 port 8080
Removed rule 1 from FWKNOP_FORWARD with expire time of 1794560303

Recorded from the lab. Full sequence diagrams →

Run it

Three commands
to a dark service.

The controller creates the CA and every member's keys on first start; nothing secret lives in the repository. The demo script checks the whole flow and fails loudly if anything is off.

docker-compose.yml
sdp-gateway:
  build: ./gateway
  cap_add: [NET_ADMIN, NET_RAW]   # iptables + SPA sniffing
  sysctls:
    net.ipv4.ip_forward: "1"
  volumes:
    - type: volume
      source: bundles              # its own credentials only
      target: /bundle
      read_only: true
      volume: { subpath: "1" }
  networks:
    sdp-public:  { ipv4_address: 10.231.0.20 }
    sdp-private: { ipv4_address: 10.231.1.20 }
terminal
$ cp .env.example .env
$ docker compose up -d --build --wait
$ ./scripts/demo.sh
[1/4] Request before SPA          PASS service hidden
[2/4] Private network             PASS unreachable
[3/4] fwknop -n service_gate      PASS SPA accepted
[4/4] Request after SPA           PASS HTTP 200
All checks passed.

Results

Hardened, component
by component.

SecureSDP also hardens each SDP component with Egida, using controls that do not break the services it runs. The paper audited the controller with three tools, before and after applying them.

Audit toolDefaultWith EgidaChange
Lynis52.0 %86.0 %+65 %
Chef InSpec36.2 %64.3 %+78 %
OpenSCAP63.5 %82.9 %+30 %

Lynis

Hardening index of the host; warnings and suggestions count as failures.

Chef InSpec

CIS Distribution Independent Linux benchmark profile.

OpenSCAP

CIS Level 1 Server profile for Ubuntu 20.04 LTS.

As reported in Payá et al., IJIS 2024, Table 2 (SDP controller). Not regenerated with this lab, whose containers are not hardened with Egida.

Questions.

Is this ready for production?

No. It is a research and teaching lab. The upstream SDP controller and fwknop fork are no longer actively maintained; review credentials handling and firewall rules before reusing any part of it.

Why the Waverley Labs fork of fwknop?

It adds the SDP control channel: fwknopd receives its service and access lists from the controller over mutual TLS instead of a static access.conf, and clients rotate their keys on every session.

Can I add clients and services?

Yes. Add rows to the seed data and a client service in Compose; the configuration guide walks through it.

Does the lab run Egida?

No. Egida hardens full hosts through Ansible, which does not fit containers. To reproduce the hardening results, deploy the components on virtual machines and run Egida there.

How does this relate to Secure-SDP?

Both accompany the same article. This lab runs the Waverley Labs SDP; Secure-SDP is a Go implementation of the Bridge model described in the paper.

How do I cite it?

Cite the SecureSDP article in the International Journal of Information Security 23(4), 2793–2808, 2024. BibTeX is on the paper page.

Hide your
services.

Clone the lab, start it and watch a service disappear until you knock.

$git clone https://github.com/antoniopaya22/Software-Defined-Perimeter && cd Software-Defined-Perimeter