BunkerWeb
v0.8.0Operate BunkerWeb, the open-source WAF, through its API: services, bans, configs, jobs.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_api_token Create API token
Create a BunkerWeb API token (Biscuit) for use outside this server; returns only the token, a live credential to keep secret. Give username and password, or omit both to use the server's credentials. Needs an API user; lifetime is BunkerWeb's API_BISCUIT_TTL_SECONDS. Redaction may mask it.
| Parameter | Type | Description |
|---|---|---|
password | Password of that API user | |
payload | Extra JSON fields for the /auth body; a username or password in it overrides the parameters | |
username | API user name; give it with password, or omit both to use the server's credentials |
ping_api Ping API
Check that the BunkerWeb API answers (GET /ping, returns pong); needs no credentials. The fastest liveness probe. Use diagnose_bunkerweb to also check authentication, version and instances, ping_instances to reach the instances themselves.
diagnose_bunkerweb Diagnose BunkerWeb
Read-only report on the connected BunkerWeb: API reachability, authentication, version, MULTISITE and instance counts; service (a service ID) adds its existence, draft state and setting owners. A failed check shows as FAIL or null, not an error. Use ping_api for a bare probe.
| Parameter | Type | Description |
|---|---|---|
service | Optional service ID (its first SERVER_NAME) to also check existence, draft state and setting owners |
list_instances List instances
List every registered BunkerWeb instance (hostname, name, port, method, status, last_seen). Cached up to 60 s. This is registration data, not a live check: use ping_instances for reachability, get_instance for one host.
ping_instances Ping instances
Ping one instance (hostname) or every registered instance (hostname omitted) and return each answer; BunkerWeb replies 502 if any ping fails. Read-only. Use list_instances for registration data without pinging.
| Parameter | Type | Description |
|---|---|---|
hostname | Hostname of one instance, as returned by list_instances; omit to ping every instance |
stop_instances Stop instances
Stop one instance (hostname) or every registered instance (all=true), never both; stopped instances serve no traffic until restarted outside this API. 502 if a stop is not acknowledged. Use reload_instances to apply config instead. Acts on the instances immediately.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Act on every registered instance; give it or hostname, not both |
hostname | Hostname of one instance, as returned by list_instances; give it or all=true, not both |
get_instance Get instance
Fetch one registered instance by hostname (name, ports, server_name, method, status, last_seen); 404 if unknown. Cached up to 60 s. Use list_instances to find hostnames, ping_instances to test reachability.
| Parameter | Type | Description |
|---|---|---|
hostname * | string | Instance hostname |
create_instance Create instance
Register an instance (hostname may carry a scheme and port, https://host:5443). Name defaults to 'manual instance', method to api; fails if it exists. Use update_instance to change one. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
hostname * | string | Hostname or IP the scheduler uses to reach the instance API |
https_port | Instance API HTTPS port | |
listen_https | Whether the instance API is reached over HTTPS | |
method | Source method tag recorded on the instance | |
name | Friendly instance name | |
port | Instance API HTTP port (API_HTTP_PORT) | |
server_name | Host header sent to the instance API (API_SERVER_NAME) |
update_instance Update instance
Change a registered instance's name, ports, HTTPS flag, server_name or method; omitted fields keep their value. Unknown or read-only instances are rejected. Use create_instance for a new host. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
hostname * | string | Hostname of the registered instance to update |
https_port | New instance API HTTPS port; omit to keep | |
listen_https | Reach the instance API over HTTPS; omit to keep | |
method | New source method tag; omit to keep | |
name | New friendly name; omit to keep | |
port | New instance API HTTP port; omit to keep | |
server_name | New Host header for the instance API; omit to keep |
delete_instances Delete instances
Unregister instances by hostname; use list_instances to find them. Hosts keep running (stop_instances halts them). Only UI/API-registered ones go; others come back as skipped, 404 if none can. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
instances * | array | Hostnames to unregister, as list_instances returns them |
reload_instances Reload instances
Reload configuration on one instance (hostname) or every registered instance (all=true), never both. test=true (default) checks the config first, then reloads; test=false reloads without the check. Returns only success or a 502 error. Use stop_instances to halt. Acts on the instances immediately.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Act on every registered instance; give it or hostname, not both |
hostname | Hostname of one instance, as returned by list_instances; give it or all=true, not both | |
test | boolean | Test the configuration first and reload only if the test passes; this still reloads, it is not a dry run. |
list_bans List bans
List active bans as each instance reports them (ip, scope, service, kind, incl. CrowdSec entries), grouped per instance. Cached up to 30 s. Use it to check whether an IP is banned, or for the exact ip and service that unban_ips when writes are enabled needs.
| Parameter | Type | Description |
|---|---|---|
limit | Maximum items to return, 1 to 1000; default 100 | |
offset | integer | Items to skip; pass next_offset from the previous page to read the next one |
ban_ips Ban IPs
Ban IPs on every instance: bans is a list of {ip, exp, reason, service}, exp in seconds (0 = permanent), service omitted for global. All IPs are validated before any is banned. Use unban_ips to lift a ban. Acts on the instances immediately.
| Parameter | Type | Description |
|---|---|---|
bans * | array | List of ban requests |
unban_ips Unban IPs
Lift bans for IPs on every instance, globally or per service; match the scope list_bans shows. An IP also blocked by CrowdSec may be refused (409). Use list_bans first to find them. Acts on the instances immediately.
| Parameter | Type | Description |
|---|---|---|
bans * | array | List of unban requests |
list_services List services
List services (id, method, is_draft, template, security mode, dates); with_drafts=false hides drafts. Cached up to 5 min. Use get_service for one service's settings, get_global_config for global ones.
| Parameter | Type | Description |
|---|---|---|
limit | Maximum items to return, 1 to 1000; default 100 | |
offset | integer | Items to skip; pass next_offset from the previous page to read the next one |
with_drafts | boolean | Include draft services |
get_service Get service
Read one service's settings by ID (its first SERVER_NAME), with the method that set each; full=true adds defaults, with_drafts=false hides drafts. 404 if unknown. Cached up to 5 min. Use list_services to find IDs, get_global_config for global ones.
| Parameter | Type | Description |
|---|---|---|
service * | string | Service ID (its first SERVER_NAME), as list_services returns it |
full | boolean | Include derived defaults |
methods | boolean | Include method metadata |
with_drafts | boolean | Include draft services |
create_service Create service
Create a service named by SERVER_NAME (first word becomes its ID) with optional unprefixed settings and a draft flag. Fails if the name or a server name is taken. Use update_service to change one. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
server_name * | string | Server name; its first word becomes the service ID |
is_draft | boolean | Create as an unpublished draft |
variables | Unprefixed per-service setting names and values, e.g. {"USE_MODSECURITY": "yes"} |
update_service Update service
Change a service's settings, rename it or set is_draft; needs MULTISITE=yes. Unknown or externally owned keys are skipped, and a receipt reads back the stored values. Use update_global_config for global. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
service * | string | Existing service identifier |
is_draft | True makes the service an unpublished draft, false publishes it | |
server_name | Rename the service | |
variables | Unprefixed per-service setting names and values; unknown or externally owned names are skipped and reported. |
delete_service Delete service
Delete a service and all its settings, not reversible; wizard-managed services are refused. Use update_service with is_draft=true to take one offline instead. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
service * | string | Service ID (its first SERVER_NAME) to delete, with all its settings |
get_global_config Get global config
Read global settings; full=true adds defaults, methods=true adds the method that set each. Cached up to 10 min. Use get_service for one service's settings.
| Parameter | Type | Description |
|---|---|---|
full | boolean | Include defaulted settings |
methods | boolean | Include method metadata |
update_global_config Update global config
Set global settings from key-value pairs; settings you omit are kept, values are stored as strings. Use update_service for one service's settings. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
config * | object | Global setting names and values, e.g. {"USE_ANTIBOT": "no"}; stored as strings |
list_configs List configs
List custom config snippets (service, type, name, draft flag), optionally with content, across every scope unless filtered. Use get_config to read one snippet in full.
| Parameter | Type | Description |
|---|---|---|
service | Filter by service ID; omit or 'global' to list every scope, global included | |
type | Filter by type. Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after | |
with_data | boolean | Include each snippet's content; false returns metadata only |
with_drafts | boolean | Include snippets of draft services |
get_config Get config
Read one custom config snippet with its content, by service, type and name; 404 if unknown. Use list_configs to find snippets.
| Parameter | Type | Description |
|---|---|---|
name * | string | Snippet name: letters, digits, _ or -, no extension |
type * | string | Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after |
service | Service ID that owns the snippet; omit or 'global' for global |
create_config Create config
Create one custom config snippet from text (method api); fails if the name exists or the service is unknown. Use create_configs_from_files to upload files. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
data * | string | Snippet content as UTF-8 text, e.g. nginx or ModSecurity directives |
name * | string | Snippet name: letters, digits, _ or -, no extension |
type * | string | Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after |
is_draft | boolean | Create as draft |
service | Service ID that owns the snippet; omit or 'global' for global |
update_config Update config
Edit, rename or move a snippet from text; omitted fields keep their value. UI/API-managed or template-derived only; templates cannot be renamed. A no-op is rejected. Use update_config_from_file for files. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
name * | string | Snippet name: letters, digits, _ or -, no extension |
type * | string | Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after |
data | New snippet content; omit to keep | |
is_draft | Set the draft flag; omit to keep | |
new_name | Rename the snippet; omit to keep | |
new_service | Move to this service; omit to keep | |
new_type | Change the type; omit to keep | |
service | Service ID that owns the snippet; omit or 'global' for global |
delete_configs Delete configs
Delete config snippets: configs is a list of {service, type, name}, service 'global' for global ones. Only UI/API-managed ones go; others come back as skipped, 404 if none. Use list_configs to find them. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
configs * | array | Snippets to delete, each by service, type and name |
create_configs_from_files Create configs from files
Create snippets from base64 files ({filename, content_base64}) sharing one type and service; each is named after its sanitized file stem and bad files are reported, not fatal. Use create_config for text. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
config_type * | string | Type for every uploaded file. Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after |
files * | array | Files to create, one snippet per file, named after the sanitized file stem |
is_draft | boolean | Create as draft |
service | Service ID for every file; omit or 'global' for global |
update_config_from_file Update config from file
Replace a snippet from a base64 file ({filename, content_base64}); without new_name the stem renames it. UI/API-managed or template-derived only; templates cannot be renamed. Use update_config for text. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
file * | File whose content replaces the snippet's | |
name * | string | Snippet name: letters, digits, _ or -, no extension |
type * | string | Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after |
new_is_draft | Set the draft flag; omit to keep | |
new_name | New name; if omitted the file stem renames the snippet, so pass the current name to keep it | |
new_service | Move to this service; omit to keep | |
new_type | Change the type; omit to keep | |
service | Service ID that owns the snippet; omit or 'global' for global |
list_plugins List plugins
List installed plugins, filtered by type (all, external, ui, pro). type=ui lists the IDs accepted by uninstall_plugin when writes are enabled. Use list_jobs for jobs.
| Parameter | Type | Description |
|---|---|---|
type | string | Plugin type filter: all, external, ui or pro |
with_data | boolean | Include each plugin's archive data |
install_plugins Install plugins
Install UI plugins from base64 archives ({filename, content_base64}; .zip, .tar.gz, .tar.xz with plugin.json). An existing plugin ID is refused; bad archives are reported. Uninstall first to replace. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
files * | array | Plugin archives (.zip, .tar.gz or .tar.xz), base64 encoded |
method | string | Installation method; the API supports only ui |
uninstall_plugin Uninstall plugin
Uninstall one UI-installed plugin by plugin_id; external and pro plugins are refused, 404 if absent. Use list_plugins type=ui to find IDs, install_plugins to add one (uninstall first to replace). Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.
| Parameter | Type | Description |
|---|---|---|
plugin_id * | string | ID of a UI plugin, as returned by list_plugins type=ui |
list_cache_files List cache files
List files that scheduler jobs cached (service, plugin, job, file name, checksum, last_update). with_data inlines text only; binary files show a placeholder, so read them with get_cache_file download=true. Use get_cache_file to read one.
| Parameter | Type | Description |
|---|---|---|
job_name | Filter by job name | |
limit | Maximum items to return, 1 to 1000; default 100; 10 with with_data | |
offset | integer | Items to skip; pass next_offset from the previous page to read the next one |
plugin | Filter by plugin ID, e.g. letsencrypt | |
service | Filter by service ID; omit or 'global' to list every scope, global included | |
with_data | boolean | Include text file contents inline; false returns metadata only |
delete_cache_files Delete cache files
Delete job cache files: files is a list of {service, plugin, job_name, file_name} service omitted for global. Use list_cache_files to find the keys. Missing files are reported per file; run_jobs regenerates them. Queued for the scheduler; this tool cannot confirm it ran.
| Parameter | Type | Description |
|---|---|---|
files * | array | Cache files to delete, each keyed as in list_cache_files |
get_cache_file Get cache file
Read one job cache file by service, plugin, job_name and file_name as list_cache_files shows. Returns printable text; download=true returns base64 bytes instead. 404 if missing; sensitive files are refused when secret redaction is on. Use list_cache_files to find files.
| Parameter | Type | Description |
|---|---|---|
file_name * | string | File name, as listed by list_cache_files |
job_name * | string | Job that wrote the file, as listed by list_cache_files |
plugin * | string | Plugin ID that owns the file, as listed by list_cache_files |
download | boolean | True returns the raw bytes as data_base64; false returns JSON with printable text only |
service | Service ID that owns the file; omit for global |
list_jobs List jobs
List scheduler jobs with their run history and cache metadata. Use list_cache_files for the files they wrote, and run_jobs when writes are enabled to trigger them.
| Parameter | Type | Description |
|---|---|---|
limit | Maximum items to return, 1 to 1000; default 20 | |
offset | integer | Items to skip; pass next_offset from the previous page to read the next one |
run_jobs Run jobs
Trigger every job of the listed plugins (jobs: {plugin, name}; name is informational, all of a plugin's jobs run), e.g. after delete_cache_files. Returns only 'Jobs scheduled'; use list_jobs to check results. Queued for the scheduler; this tool cannot confirm it ran.
| Parameter | Type | Description |
|---|---|---|
jobs * | array | Jobs to trigger, as list_jobs shows; each plugin's jobs all run |
search_bunkerweb_docs Search BunkerWeb docs
Search the official BunkerWeb documentation by meaning, in any language. Returns up to limit sections with title, URL, category, relevance and content, one per document. Use it for how-to and setting questions; use the API tools to read live state. Lower min_score if nothing matches.
| Parameter | Type | Description |
|---|---|---|
query * | string | Question or topic in natural language, any language |
category | Optional docs section filter, e.g. api, plugins, features | |
limit | integer | Maximum results to return, 1 to 50 |
max_content_length | integer | Characters of content per result; 0 returns full sections |
min_score | number | Relevance threshold from 0 to 1; lower it when nothing matches |