Firewall config
Field-level reference for the firewall configuration object, the unit that config export and import operate on.
The firewall config is the complete description of one firewall: identity, upstreams, policy, and access grants. It is what bsfw config export writes and bsfw config import applies, and what the dashboard edits piece by piece.
Shape
{
"id": "3e7f5cb806f26e3beae2",
"version": 12,
"ecosystem": "npm",
"name": "npm production",
"description": "Firewall for all production npm installs",
"upstreams": [
{
"id": "npmjs",
"endpoint": "https://registry.npmjs.org",
"credentials": {},
"internal": false,
"cached": false
}
],
"publishTarget": "npmjs",
"rules": [
{
"id": "delay-new-versions",
"executionPhase": "versions",
"selector": { "maxAgeHours": 168 },
"ruleEffect": { "block": true, "log": true },
"description": "Block versions younger than 7 days"
}
],
"exceptions": [],
"permissions": {
"everybody": ["fw:access", "fw:clone", "fw:read"],
"platform": ["fw:access", "fw:read", "fw:update:rule", "fw:update:exception"]
},
"updatedAt": "2026-07-02T09:30:00Z"
}Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique within the namespace. Part of every client-facing URL, so treat it as permanent. See Firewall ID |
version | number | Incremented on every config change. Log entries record the version they were evaluated under, and caches key on it |
ecosystem | string | npm, pypi, maven, nuget, go, or conda (beta). Choose it at creation and treat it as permanent |
upstreams | array | Registries the firewall resolves from. See Upstreams |
publishTarget | string | ID of the upstream that receives publishes. Optional; without it the firewall is install-only |
rules | array | Array order is not evaluation order: rules are evaluated cheapest first. See Evaluation order |
exceptions | array | Waivers bound to rules by ID. See Exceptions |
name | string | Display name. Optional |
description | string | Free text. Optional |
parentId | string | ID of a firewall to inherit configuration from. Optional. Must name an existing firewall of the same ecosystem, and must not create a cycle. See Share configuration across firewalls |
permissions | object | Map of team ID to permission list for this firewall. See Permissions |
updatedAt | string | RFC 3339 timestamp of the last change. Set by the server |
With parentId set, the stored config keeps holding only the firewall's own entries; inherited rules, exceptions, and upstreams are resolved from the parent chain at serving time. Exports and the granular rule/exception endpoints operate on the firewall's own entries only.
Do not change ecosystem in an exported config
The dashboard does not let you change a firewall's ecosystem. A full config import may accept the change when no other firewall inherits from it, but it does not translate the config. The API rejects selector functions or version ranges that are incompatible with the new ecosystem, but it does not check whether upstream endpoints speak that ecosystem's protocol. Create a new firewall with the required ecosystem instead.
Firewall ID
The ID is a path segment in every client-facing URL, so it is constrained to characters that need no escaping:
- Letters, digits, and dashes only
- Must start and end with a letter or digit, so no leading dash (which reads as a flag on a command line) and no trailing dash
- At most 128 characters
The server rejects anything else with 400. The rule applies to every config write, not just creation, so an existing firewall with a non-conforming ID cannot carry it forward through an import. The dashboard generates conforming IDs on its own.
Import semantics
bsfw config import PUTs the whole object:
- Importing a config with a new
idcreates the firewall (requiresfw:create). - Importing an existing
idreplaces its configuration. - Plaintext values in
credentialsare rejected. On an existing firewall, an exported placeholder keeps the stored value for the same upstream. When a new firewall ID or upstream has no stored value, the placeholder resolves to empty; set its credentials separately through the dashboard orbsfw config credentials. - The ecosystem must be one of the supported values. Rules and exceptions whose selector function or version range does not support that ecosystem are rejected.
- The
permissionsmap is optional on create. Without one, the server applies the defaults for a new firewall. The create request body also accepts anownerfield (a team ID, not stored on the config): the named team receives the full default permission set instead of theeverybodyteam. - A
permissionsmap that would leave no team withfw:update:config, or would drop the caller's own ability to update the configuration, is rejected; see Permissions.
See CLI.
Related
- Reference: Upstreams, Rules and selectors, Exceptions, Permissions, CLI
- How-to: Configure upstreams