🛡️
core/sksec · v1

sksec

CrowdSec at the edge, before anything reaches your apps.

sksec puts behavioral intrusion detection and crowd-sourced reputation in front of every service behind the fleet's Traefik edge, with a bouncer that fails closed and a dashboard that stays behind single sign-on. It does not guess whether a request is human or machine. It watches what the request does.

What sksec is

sksec is the core deployment role (core/sksec) inside SKStacks, SKWorld's Ansible + Docker Swarm sovereign infrastructure framework. It runs CrowdSec, an open-source behavioral detection engine with a crowd-sourced reputation feed, alongside a Traefik forwardAuth bouncer, so every router in the cluster can be put behind the same decision with one middleware line.

Behavioral detection

CrowdSec tails the edge's own access logs and scores behavior against its scenario collections (crowdsecurity/linux, crowdsecurity/traefik by default), not just a static IP list.

Crowd-sourced reputation

CrowdSec's community blocklist (CAPI) shares attacker reputation across every participating CrowdSec deployment worldwide, so one site's detection can protect every other site before an attacker ever reaches it.

Fail-closed bouncer

The Traefik bouncer answers 403 when it cannot reach CrowdSec's LAPI, rather than quietly letting every request through. Run a canary router first, widen only after it checks out.

Operator allowlist

Your own ranges (LAN, VPN, CI runners, the cluster's own public address) are enforced at both the local parser and CrowdSec's own LAPI, so a community or manual ban can never catch you.

High availability

Optional bouncer replicas (one per node) mean one node going down never takes the gate down with it. The bouncer itself is stateless.

Local-disk LAPI fix

CrowdSec's hot-path database can now pin to local disk on one node instead of shared network storage, removing the slow-lookup-to-fail-closed failure mode entirely (see below).

§Why it is built this way

A bouncer that fails closed is only trustworthy if the thing it depends on cannot quietly become the slowest part of the request path. sksec was built, and then fixed, around exactly that failure mode.

  1. The database write that was never supposed to matter, did. The bouncer checks CrowdSec's database on every protected request. On the original default, that database lived on networked shared storage, and under load its writes started to serialize. Once a single lookup crossed the bouncer's timeout, it failed closed, and because the bouncer is the same gate for every router behind it, that meant 403 on every protected route in the cluster, not only the slow ones. One real incident put it at roughly 1 in 20 external requests rejected over a thirty-minute window.
  2. The fix moves the hot path, not the gate. sksec now supports pinning that database to local disk on one chosen node, with write-ahead logging turned on only once it is safely off network storage (SQLite's own documentation is explicit that its shared-memory locking is not reliable over a network filesystem). The decision data and bouncer registration survive a migration; nothing about the fail-closed behavior itself changes, it just stops tripping on ordinary load.
  3. An operator allowlist that actually covers every decision path. A local parser whitelist alone would stop a false local detection, but not a community blocklist entry or a manual ban. sksec syncs the same list into CrowdSec's own LAPI allowlist, so the operator's own ranges are protected against every decision source, not just the obvious one.
  4. The client address is derived, not trusted blindly. Behind a CDN or tunnel, the leftmost address in a forwarded-for header is whatever the client puts there. sksec's trusted-proxy configuration makes the bouncer walk that header from the right and stop at the first address it does not already trust, so a forged header in front cannot be used to dodge a ban.
  5. Visibility does not mean exposure. The optional dashboard (sksec-web, below) reads and shows the same alerts and decisions an operator would otherwise read through a command-line tool, but it sits behind the fleet's own single sign-on and starts read-only, so adding visibility never widens who can change what.

§Fighting AI-speed attacks

The honest version of the pitch is not that sksec can tell an AI agent from a person. It cannot, and no network control honestly can. What changed is the speed and reach of what is on the other end of the connection, and that is the part a behavior-and-reputation-based gate was already built to answer.

real threatExploit chains weaponized in days, not months

This month alone, two chained disclosures moved from public CVE to active in-the-wild exploitation fast enough that a fleet checking patch status by tag name, not by actually running the binary, would have missed it: a PHP runtime remote-code-execution chain (PHP2Shell) and a related chain against a popular media server (Plex2Shell). Automated scanners and agentic tooling can probe thousands of endpoints for a fresh exploit signature far faster than a human operator can patch everything by hand, and they do not get tired, take weekends, or stop at the first failed attempt.

  • Behavior beats identity. CrowdSec's scenarios score what a request sequence does (credential-stuffing patterns, known exploit paths, scanning behavior) against its parser and scenario collections, such as the hub's crowdsecurity/http-cve collection for known CVE exploitation signatures and crowdsecurity/traefik for the edge's own access logs. It does not need to know who, or what, is driving the request.
  • Reputation is crowd-sourced, on purpose. An address burning through exploit attempts against one CrowdSec-protected site anywhere in the community blocklist can be a known-bad signal before it ever reaches a sksec-protected router, which matters most against tooling that fans a single exploit chain out across many targets at once.
  • The gate sits in front of the app, every time. Because the bouncer middleware applies at the Traefik layer, a fresh exploit against an application sksec protects still has to clear CrowdSec's decision first, independent of whether that application has been patched yet.
  • Patch status is checked by running the code, not trusting the tag. SKStacks' fleet vulnerability register and daily image monitor inventory every running service's actual pinned image, probe runtimes like PHP against a floor table seeded with fixes such as PHP2Shell's, and flag anything below it the same day, rather than waiting for someone to notice.

What sksec does not claim: it is not "AI-proof," it does not block all automated traffic, and it does not replace patching. It is one honest layer: slow down and catch what behaves badly at the edge, keep the operator's own addresses safe from false positives, and keep the admin tools that manage all of it behind single sign-on.

§sksec-web: seeing the gate, without widening it

The optional sksec-web role adds crowdsec-web-ui, a browser dashboard for the cluster's existing CrowdSec instance: investigate alerts, review decisions, watch runtime metrics, without SSHing into a node and running cscli by hand. It deploys after core/sksec and talks to that stack's own LAPI; it ships no CrowdSec engine or bouncer of its own.

PropertyDetail
CredentialIts own registered CrowdSec machine account, separate from the Traefik bouncer's key. Rotating one never touches the other.
Default accessRead-only at two independent layers: the dashboard's own read-only setting, and CrowdSec's own server-side rule on which machine accounts may delete a decision. Deleting is an explicit, separate, manual opt-in.
Sign-inAuthentik forward auth (SSO) in front by default, the same double-gate pattern used for every other admin-grade tool in the stack. A no-SSO mode exists only behind an explicit, named risk flag.
Portal visibilityIts tile is bound to the instance's admin group, not every signed-in user, the same convention the fleet already uses for its other admin dashboards.

§How sksec fits the security stack

sksec is one layer in a stack built so no single piece has to be perfect on its own.

request -> skfenceha (Traefik HA edge: certs, routing, the worker tier that takes every hit) -> sksec crowdsec-bouncer@file (fail-closed forwardAuth: behavior + reputation decision) -> sksso (Authentik SSO) for admin tools, including sksec-web itself -> the application in parallel: fleet vulnerability register + daily image monitor -> inventories every running image, probes real runtime versions, flags anything below a patched floor the same day it is found release discipline: new sksec / sksec-web capability -> proven on a disposable lab cluster (skstack06) -> only then considered part of a release

skfenceha

The HA Traefik edge that terminates every request. sksec's bouncer is a middleware on skfenceha's routers, not a separate network hop.

sksso

Authentik-based single sign-on. Gates every admin-grade tool in the stack, sksec-web included, with the same double-gate pattern.

Vulnerability register + image monitor

Daily, unattended inventory of every running service's real pinned image and runtime version, cross-referenced against a tracked CVE register, flagging what is unreviewed instead of silently dropping it.

skstack06 lab gate

New sksec and sksec-web capability is proven end to end on a disposable test cluster before it ships, the same release discipline the rest of the framework's services use.

Deployment

sksec deploys through a standard Ansible playbook per environment (dev, staging, prod), every setting coming from a per-environment vault file, never hardcoded. The bouncer fails closed, so the framework's own README walks through activation order: set the operator allowlist first, deploy, confirm log acquisition and a test ban, canary one low-value router, then widen.

Part of the ecosystem

sksec guards the gate every other sovereign service sits behind. skhub holds the files, skwrit publishes the paperwork, and every one of them routes through the same Traefik edge sksec protects. All part of SKWorld, the sovereign AI ecosystem where you own the whole stack, from silicon to soul.