Allow additional CSP hosts in <iframe> embeds
What does this MR do and why?
Allow additional CSP hosts in <iframe> embeds.
Figma requires redirecting their embeds through www.figma.com; it's why the old domain instructions required allowlisting "embed.figma.com" and "www.figma.com" separately; see our old CR at Enable content embeds in Markdown on GitLab.com (gitlab-com/gl-infra/production#20902 - closed) where we had to set both.
Permit specifying "additional CSP hosts" in provider config, and add www.figma.com to that list for Figma embeds. Note that this is only used if an instance admin enables Figma as an embed source.
Feature is wip FF'd; no active users
MR stack
MR 6/12 of Rework <iframe> embed configuration (#599713):
- Add `<iframe>` provider model and parser (!254943 - merged)
- Add `<iframe>` provider loader and base config (!254944 - merged)
- Convert `<iframe>` allowlist setting to provide... (!254945 - merged)
- Move to `<iframe>` providers (!254946 - merged)
- Remove dead `<iframe>` transform code (!254947 - merged)
- Allow additional CSP hosts in `<iframe>` embeds (!257463 - merged)
⬅️ you are here - Reject sneaky dot segments in `<iframe>` URLs (!258894 - merged)
- Frontend `<iframe>` hardening (!254948 - merged)
- Render `<iframe>` embeds in Vue (!259513 - merged)
- Click-to-activate functionality for `<iframe>`s (!254949 - merged)
- Admin UI for `<iframe>` providers (!254950 - merged)
- Mark `<iframe>` config, loader and renderers as... (!255246)
Part of <iframe> embeds in Markdown content (#282443).
How to set up and validate locally
- Check out
master. - Enable the
allow_iframes_in_markdownFF on your instance. - Navigate to Admin → Settings → General → Embedded content.
- Check "Enable embedded content", and in the "Allowed domains" list, enter just "figma", then click "Save changes":
(This is odd but will be fixed as of Admin UI for `<iframe>` providers (!254950 - merged).) - You may wish to restart your GDK or re-
caproni run; the FF or settings check might be cached. - Navigate to a work item, enter the following in a plain-text area (can be the work item description, or a new comment), and save:
{width=800} - It should fail to load:

- Check out this branch. (I didn't have to restart anything here; YMMV.)
- Refresh the page.
- It should load successfully!

MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.


