Skip to content

Allow customization of the CSP #5333

Closed

Description

@Alemmi

Describe the solution you'd like

The current Content Security Policy is hardcoded, but not all deployments have the same requirements. It would be helpful to allow customizing the CSP, for example, from an ini file.

Activity

  1. nilmerg commented on Mar 7, 2025

    @nilmerg
    Member

    Hi, and what are those requirements? If we talk about ini configuration, this is important to me since it might answer the question whether only some features can be toggled or if the full policy should be possible to override.

  2. Alemmi commented on Mar 17, 2025

    @Alemmi
    Author
  3. nilmerg commented on Mar 17, 2025

    @nilmerg
    Member

    I'd rather want to avoid that we open up the override of the policy without verifying that some of the parts are a candidate to include in the default.

    Many of those are just simple flags, and the only variables are the nonce and the root url, both of which Icinga Web knows very well. Because of this, many of the parts might be a candidate.

    So if you know what you want, you should be able to tell me what could be in the default policy. Though, if it's about unsafe-* I'm afraid that's not an option ;) (Just mentioning this because that's what the grafana docs mention)

  4. Alemmi commented on Mar 17, 2025

    @Alemmi
    Author

    Yes, you're right, some of these candidates can be included in the default (for example base-uri 'none' etc).
    But what I'm thinking is, for example, if I wanted to add a default-src 'self' or 'none' I would then have to add a whitelist for the things I need (ideally img-src domain.com data:// etc.) or for example, If I use some CDN I have to add CDN domain to script-src.

  5. nilmerg commented on Mar 17, 2025

    @nilmerg
    Member

    If you use a CDN, it sounds like a very isolated occurrence. Can't you just patch the header using the web server?

  6. nilmerg commented on May 14, 2025

    @nilmerg
    Member

    Please see my latest comment in the linked PR

  7. added theissue type on May 14, 2025
  8. added this to the 2.13 milestone on May 14, 2025
  9. removed this from the 2.13 milestone on Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions