Skip to content

Hazeloft Security console: keys, modes, alerts

What you tune from the Hazeloft Security console, for each API key, from the Live and Dry run modes to the deny log, usage charts and alerts.

Last updated:

Your code says which routes protection runs on. How each capability behaves (on or off, Live or Dry run, with which thresholds) is tuned from the Security console in the platform, per API key, without a redeploy. Each capability has its own page.

Live and Dry run

  • Live refuses the requests it rejects.
  • Dry run only records what would have been rejected.

The mode is chosen globally, per key, and can be overridden on each capability. A key with nothing saved runs in Dry run.

Start a capability in Dry run, on real traffic, read the log and move to Live when it shows what you expect.

The console reaches your application through two pieces of the engine:

import {
  HazeloftSecurity,
  consoleRules,
  createConfigClient,
  createEventReporter,
} from "@hazeloft/security";

export const security = new HazeloftSecurity({
  apiKey: process.env.HAZELOFT_SECURITY_API_KEY,
  configClient: createConfigClient(),
  eventReporter: createEventReporter(),
  rules: consoleRules,
});
  • configClient brings the configuration from the console. The SDK re-reads it at most every 60 seconds. Without it, the rules run with their defaults.
  • eventReporter sends decisions, in batches, for the log and the charts in the console.

Both let your application keep running when the service does not answer: without remote configuration your defaults remain, and events that cannot be sent are dropped, without blocking requests.

The same configuration applies both to rules mounted with consoleRules and to protectSignup().

What a capability’s page has

  • the Live / Dry run switch;
  • its thresholds;
  • a usage chart, hourly and daily;
  • the deny event log: which requests were rejected and why.

All of them are for the chosen API key. Deny events are kept for 30 days.

Two things worth knowing:

  • A key’s last-used date updates on any use: decisions, configuration reads, event batches. A key shown as never used means nothing in your application has used it yet, not merely that it has rejected nothing.
  • Saving a page writes the key’s whole configuration. The form starts from the effective state, so saving without changing anything changes nothing.

API keys

Each key has its own configuration, its own log and its own quota. You can have at most 5 active keys, with the hzx-sec_ prefix. The secret is shown once, at creation.

Usage and quota

The console shows how much of the monthly decision quota each capability has used. The quota is counted per UTC calendar month, per key, all capabilities together. Its size depends on the plan and is on the product page.

When the quota runs out, protection stops: requests pass unchecked until the reset or until you move to a larger plan. Your site is not blocked.

Alerts

Alert When it arrives
80% of the quota You still have time to move to a larger plan.
Quota used up Protection has stopped, requests pass unchecked.
Spike in denials In one hour, more requests were refused than the threshold you chose.

You get them by email and, if you want, on an HTTPS webhook.

All documentationSecurity product page

This site uses measurement and advertising technologies. You can accept or decline them.

How we handle your data: Privacy policy · Cookie policy