Aller au contenu principal

Quick reference

The HTTP signals, the vocabulary, the go-live steps and the kokiguard command, to keep at hand.

R.2 Recognize a kokiGUARD response​

SituationCodeSignal that the client sees
Blocked by a rule403x-waf-action: blocked header and block page with an ID, which the X-Request-ID header also gives
Blocked by country403X-Geo-Blocked: 1 header
Robot blocked403X-Bot-Blocked header: the name of the robot, or impostor for an impostor
Challenge requested403Challenge page on a web page, which a browser solves by itself; 403 without a page for another type of request
Body larger than the inspected size413x-waf-action: body-too-large header
Rate limit exceeded429retry-after: 60 header
Waiting room queue full429retry-after: 10 header and waiting page
Maintenance mode503Maintenance page
JS challenge200Calculation page instead of the site; a browser gets through by itself
Banned IP—Connection cut or timeout, depending on the ban method
Site in Detect mode200No signal: look at the logs

R.3 Glossary​

TermDefinition
WAFWeb application firewall. It reads the content of HTTP requests, where a network firewall sees only addresses and ports.
ASAutonomous system: the network (hosting provider, operator, cloud provider) that announces an IP address on the Internet. Badge next to each address, tab of the threat radar.
CRSOWASP Core Rule Set: the reference open-source ruleset, which kokiGUARD uses through the Coraza engine.
Anomaly scoreTotal of the points that the rules add when they react to a request. Above the threshold of the site, the request is blocked.
Paranoia (PL)Severity level of the rules, from 1 to 4. The higher the level, the more it detects, and the more false positives it causes. Set with Kokiris.
Training phaseGo-live period in which Kokiris adds all your sites in Detect mode, corrects the false positives and adjusts the configuration, before the change to Block, then to Ban.
False positiveLegitimate request that the WAF takes for an attack. You correct it with the narrowest possible scope, on one or more rules and one or more fields.
RadiographyFull view of a recent request: its outcome and its HTTP code, its score, the rebuilt request with what triggered, the statistics of the field over 24 h and the correction that already covers it.
Trusted trafficTraffic exempted from inspection (“Skip inspection”) or forced to inspection (“Always inspect”).
IP groupNamed list of addresses (IP or CIDR), which the path rules of trusted traffic can use again, in “Skip inspection” or “Restricted access” (403 for the other addresses).
ReputationPoints that an IP accumulates in Ban or Challenge mode, which decide if the IP is banned or challenged.
ChallengeCalculation (proof of work) that a browser does by itself in less than one second, and that a simple script does not do. Replaces the ban in Challenge mode, and is also an action against a robot.
Verified robot, impostorA verified robot has the User-Agent of a known robot and an address in the ranges that its owner publishes. An impostor has this User-Agent, but an address outside these ranges.
ConditionCriterion on the request (header, parameter, cookie…) that limits a correction or a trusted entry to the requests that meet it.
Body too largeRequest whose body is larger than the size that kokiGUARD inspects: refused with 413 or let through, depending on the site.
Automatic applySetting that makes the leader apply the pending changes, when they have not changed for 90 seconds.
JailFail2Ban ban queue, with its duration: 10 min, 6 h, 24 h or permanent.
RevisionFull, validated version of the configuration, which you can compare and apply again.
Back-office pathFolder of the admin area of a PrestaShop or Magento shop, declared in the site page. The Kokiris rulesets recognize the back office only under this path.
Custom profileRead / Write permission grid, page by page, for an account or an API key. The menus follow the grid.
Reseller, memberAccounts of a shared kokiGUARD, limited to their sites. The reseller creates its members, within its rights and among its sites.
API keyAccess of a script to the panel, without a password. Its rights never go above the rights of its creator.
LeaderCluster node that accepts the changes and sends them to the other nodes.
Scanner detectionCounts, per address, the error responses of the sites. Above the threshold, the address appears in the logs (“Scan · N/min”) and, in Ban mode, it is banned from all sites.
Detection-only ruleRule of a Kokiris ruleset that reports without blocking: 0 points, for the score and for the ban.
Canary ruleHarmless rule that blocks a known request, to check that the WAF applies the rules correctly.

R.4 The go-live steps​

To follow the progress with Kokiris. You can tick the boxes to help you; they stay in this browser.

R.5 kokiguard (shell)​

For administrators who have root access to a kokiGUARD node, usually at Kokiris. Without shell access, do the same actions in the panel: Cluster Management (chapter 5.3) and Fail2Ban (chapter 4.1).

CommandEffect
kokiguard statusThe cluster as this node sees it: leader (★), term, and for each node its role, its state and the applied revision.
kokiguard ban <ip|cidr> [--jail <prison>]Bans an address or a network on the full cluster, through the leader: the ban is in the history and in the audit log. Default jail: waf-ban-10m.
kokiguard unban <ip|cidr>Removes the address from all jails, on the full cluster.
kokiguard checkHealth check of this node, read-only: services, API, haproxy -c, Redis, bans, scanner detection, version, disks. Icinga exit code: 0 OK, 1 WARNING, 2 CRITICAL, 3 UNKNOWN.
kokiguard updateUpdates this node and its remote nodes. It does nothing if the published version is already installed. In a cluster, run it on the node that deploys the cluster (node-1).
kokiguard help <commande>The details of a command and of its options.
terminal · root on a node
kokiguard status
kokiguard ban 203.0.113.0/24 --jail waf-ban-24h
kokiguard unban 203.0.113.0/24
--local: emergency use only

kokiguard ban --local and kokiguard unban --local go through Fail2Ban on this node only, when the API or the leader does not answer. The other nodes are not notified, and the action is not in the history or in the audit log. When the API answers again, do the action again without --local.

Installation, repair, leader failover and emergency recovery: see the installation guide INSTALL.md of the kokiGUARD repository.