Spend and protection

A monthly spending limit with alerts, under-attack mode for sites, bandwidth throttling, abuse detection and an emergency stop.

In preview protection version 1.0.0 Part of Spend and abuse protection

Actions

10 actions, callable from the panel, the command palette and the API as POST /api/v1/a/<id>. Internal actions used between modules are not listed.

ActionWhat it doesRiskPreview
protection.settings.get Spend and protection settings (read) low No dry run
protection.settings.set Change spend and protection settings medium No dry run
protection.spend.get What is committed this month against the limit (read) low No dry run
protection.attack.list Sites and their under-attack state (read) low No dry run
protection.attack.set Switch under-attack mode on or off medium No dry run
protection.abuse.list Resource abuse findings (read) low No dry run
protection.bandwidth.get Bandwidth used this month (read) low No dry run
protection.emergency.get Is the emergency stop on? (read) low No dry run
protection.emergency.stop Emergency stop high
protection.emergency.resume Undo the emergency stop high

Permissions and limits

Permissions

  • protection.view See spending, protection and abuse findings
  • protection.manage Set the spending limit, policies and the emergency stop
  • protection.attack.site Switch under-attack mode on your own sites and see their bandwidth

Plan limits

  • protection.bandwidth_gb Outgoing traffic per month (throttled, never billed)

Engineering notes

Generated from modules/protection/docs.md at build 863171bf. These are the notes the engineers keep next to the code: precise, technical, and honest about what is not done yet.

Set a monthly spending limit, see sites in under-attack mode, watch bandwidth and unusual CPU use, and stop spending with one button. Spec: docs/specs/protection.md. CLI: respirecloudctl protection spend get, protection settings set --json '{"spend_cap":200}', protection attack set --json '{"scope":"site","site_id":"...","on":true}', protection emergency stop / resume.

For other modules: ask sdk/spend before spending.

err := spend.Remote{Host: c.Host, Call: c}.Allow(ctx, spend.Cost{Kind: spend.KindServer, Monthly: price, Ref: name, Source: "autoscale"})
ok, reason, err := spend.Remote{...}.Check(ctx, cost)   // autoscaling's shape: refusal is ok=false with a plain reason

The module must list protection.spend.allow in system_calls.