API Reference limen v#0.2.1

Copy Markdown View Source

Modules

Native Elixir L7 bot protection.

The proof-of-work challenge, modelled on the Anubis proxy.

The challenge page's script, worker and stylesheet.

The challenge interstitial, and how to make it your own.

The pass cookie a client gets for solving a challenge.

Makes every challenge token single-use.

Rotates an instance's replay filter every challenge :ttl.

Stateless, signed challenge tokens.

Propagates an instance's bans across a cluster of nodes.

Instance configuration.

Keys derived from the configured secret.

Everything Limen knows about a request while it is being evaluated.

A Phoenix LiveDashboard page for a Limen instance.

Node-local figures of an instance for dashboards: counters, the busiest clients, bans and recent decisions.

The explainable record of a verdict.

A rule that matched, and the values its condition observed.

A sampled, structured decision log.

Drains an instance's decision log buffer to its sink periodically, see Limen.DecisionLog.Sink.

The default Limen.DecisionLog.Sink: logs every sampled decision as a structured Logger report (see Limen.DecisionLog.report/1).

Where Limen.DecisionLog.Flusher writes sampled decisions.

IP address helpers: parsing, prefix aggregation and CIDR matching.

A running Limen instance: its configuration and handles to its state.

Named lists policies can test membership against, such as known-bad JA4 fingerprints or allow-listed networks.

Gates LiveView connections, see Limen.Socket.

An endless maze of slow, plausible pages for clients caught misbehaving.

The maze model of Limen's own corpus, built at compile time.

Loaded dice: weighted random choices in constant time.

The language model maze pages are written with.

Owns an instance's tables and publishes its Limen.Instance.

The request gate.

A compiled DSL for bot policies.

The policy Limen.Plug uses when none is given.

Functions compiled policies call on the request path.

A source of facts about a request.

Maps the client address to its autonomous system (ASN).

Fetches IP-to-ASN data over HTTP(S) into a file, only when it changed.

Loads IP-to-ASN data for Limen.Signal.Asn and keeps it current, off the request path.

When the ASN loader checks for new data, as pure functions of the time.

Where Limen.Signal.Asn looks client addresses up.

IP-to-ASN data packed into a handful of binaries, for one :persistent_term entry.

What each client prefix has been doing over the last minute.

Resolves the client address and prefix.

Verifies that a request claiming to come from a search engine crawler really does, with forward-confirmed reverse DNS (FCrDNS): the check search engines document themselves, as Google does for Googlebot.

DNS lookups used to verify crawlers, as a behaviour so they can be replaced (in tests, or with a caching resolver).

Limen.Signal.Fcrdns.DNS on top of OTP's :inet_res resolver.

Verifies an instance's queued crawler addresses in the background.

Checks whether a request looks like what its user agent claims to be.

Reads the JA4 TLS client fingerprint set by the TLS terminator.

A deliberately small user agent classifier.

Fixed-memory probabilistic structures for high-cardinality state.

A lock-free Bloom filter on :atomics.

A lock-free Count-Min Sketch on :atomics.

A lock-free HyperLogLog on :atomics.

"Seen recently" as two Bloom filter generations.

Gates WebSocket connections, which bypass Limen.Plug.

An instance's shared, lock-free state.

Banned prefixes, with expiry.

Lock-free GCRA (generic cell rate algorithm) rate limiting on ETS.

Clears an instance's expired time-window slots shortly after each epoch boundary.

Periodically removes an instance's expired bans and idle GCRA keys.

Sliding-window request counters.

Lock-free, node-local counters for dashboards and health checks.

Supervises one Limen instance.

Holds tarpitted requests before denying them.

Telemetry events emitted by Limen.

Helpers for testing an application that uses Limen.

Honeypots: places only automated clients go, and what happens when they do.