You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BugzillaClient::new builds its reqwest client with a timeout and nothing else (crates/bugwarden-core/src/client.rs:46-49), and reqwest only emits a User-Agent header when one is configured. So every request bugwarden makes to Bugzilla is anonymous: on the wire it carries accept and host and no more.
Found while fixing #53, and it is the same question in the other direction. #53 was "a client cannot tell which server it reached"; this is "the Bugzilla admin cannot tell which client reached them". A deployment that starts behaving badly — hammering /rest/bug, tripping a rate limit, holding connections open — is unattributable from the server side, and the operator on the other end has no name to complain about or allowlist.
That matters more here than for a typical REST client, because bugwarden is built to be run as fleet infrastructure with a server-held key (#27): many agent containers, one Bugzilla account, no per-caller identity yet (#32). A useful UA is the only thing distinguishing that traffic from a person with a browser.
The trap in the obvious fix
The natural place to set it is where the client is built, in bugwarden-core. Done there, env!("CARGO_PKG_NAME") expands to bugwarden-core, and CARGO_PKG_VERSION to that crate's version — the exact shape of #53, one layer down, and just as invisible: the header would look entirely plausible.
The identity has to come from the binary crate that already owns SERVER_NAME / SERVER_VERSION (crates/bugwarden/src/server.rs) and be threaded in as a parameter. bugwarden-core is a library other things may embed, so it should not assert an identity of its own at all.
Notes
Any value chosen is public: it is sent to every configured Bugzilla, appears in their access logs, and is not secret material. It must not include the API key, the policy path, or anything else about the deployment (I12) — name and version only.
Whether to include a contact URL is a real choice; some trackers ask for one, and it is another thing that becomes wrong when the repo moves.
Requests to Bugzilla carry a User-Agent naming bugwarden and this build's version, sourced from the binary crate, never from bugwarden-core's own CARGO_PKG_*.
A test asserts the header on the wire and fails if it names bugwarden-core.
The value contains no key material or deployment detail.
BugzillaClient::newbuilds its reqwest client with a timeout and nothing else (crates/bugwarden-core/src/client.rs:46-49), and reqwest only emits aUser-Agentheader when one is configured. So every request bugwarden makes to Bugzilla is anonymous: on the wire it carriesacceptandhostand no more.Found while fixing #53, and it is the same question in the other direction. #53 was "a client cannot tell which server it reached"; this is "the Bugzilla admin cannot tell which client reached them". A deployment that starts behaving badly — hammering
/rest/bug, tripping a rate limit, holding connections open — is unattributable from the server side, and the operator on the other end has no name to complain about or allowlist.That matters more here than for a typical REST client, because bugwarden is built to be run as fleet infrastructure with a server-held key (#27): many agent containers, one Bugzilla account, no per-caller identity yet (#32). A useful UA is the only thing distinguishing that traffic from a person with a browser.
The trap in the obvious fix
The natural place to set it is where the client is built, in
bugwarden-core. Done there,env!("CARGO_PKG_NAME")expands tobugwarden-core, andCARGO_PKG_VERSIONto that crate's version — the exact shape of #53, one layer down, and just as invisible: the header would look entirely plausible.The identity has to come from the binary crate that already owns
SERVER_NAME/SERVER_VERSION(crates/bugwarden/src/server.rs) and be threaded in as a parameter.bugwarden-coreis a library other things may embed, so it should not assert an identity of its own at all.Notes
Acceptance criteria
User-Agentnaming bugwarden and this build's version, sourced from the binary crate, never frombugwarden-core's ownCARGO_PKG_*.bugwarden-core.