Skip to content

fix(backstage): no avatars host in the portal's CSP - #614

Closed
teemow wants to merge 1 commit into
mainfrom
teemow/portal-csp-no-avatar-host
Closed

teemow wants to merge 1 commit into
mainfrom
teemow/portal-csp-no-avatar-host

Conversation

@teemow

@teemow teemow commented Sep 21, 2026

Copy link
Copy Markdown
Member

Problem

The connectivity chart's rendered Backstage app-config listed https://avatars.<global.domain> in the Content-Security-Policy's img-src, because the portal's <img>s loaded agent avatars from that host. Since giantswarm/backstage#2521 (Backstage 2.48.9) the portal's backend fetches the avatars from the installation's DiceBear host and serves them same-origin, so the entry is dead configuration, and a header sent with the unauthenticated page no longer needs to name a host of the installation.

Change

  • templates/backstage/app-config.yaml: the img-src list is 'self', data: and the app-icon CDN; the DiceBear guard around the avatars entry goes with it. The DiceBear component and its public route are unchanged: the backend fetches from them.
  • tests/verify-target.py: the dicebear on/off check asserts that the portal's CSP names no avatars. host either way (and still carries the CDN); a hold keeps the removed line and the app-config checksum it moves out of the golden comparison with origin/main until main carries this.
  • Makefile.custom.mk verify-wiring: the avatars host leaves the expected-pattern list; a negative check refuses any avatars. host in the rendered app-config.
  • CHANGELOG: the entry, and the Unreleased header a previous edit had mangled (\1, literal \n\n) restored.

Verification

make verify-wiring and make verify-target pass locally (5 renders byte-identical to origin/main with the hold). Merge after the Backstage release runs on the fleet.

The portal loads agent avatars through its own backend since backstage
plugin-agent-platform proxies them from this deployment's DiceBear host, so
the rendered Content-Security-Policy names no host of the installation. The
DiceBear component and its route stay: the backend fetches from them. Also
restores the changelog's Unreleased header a previous edit mangled.
@teemow
teemow requested a review from a team as a code owner September 21, 2026 12:12
@teemow teemow changed the title backstage app-config: no avatars host in the portal's CSP fix(backstage): no avatars host in the portal's CSP Sep 21, 2026
@teemow

teemow commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Closed for now, not abandoned: nine fleet instances still run Backstage 0.245.0, whose frontend loads the avatars from the installation host directly and needs the CSP entry. Reopens once every instance this touches runs 2.48.9 or later.

@teemow teemow closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant