Skip to content

Update static page styling for CSP.#361

Open
melaniekung wants to merge 2 commits into2.10from
dev/csp-static
Open

Update static page styling for CSP.#361
melaniekung wants to merge 2 commits into2.10from
dev/csp-static

Conversation

@melaniekung
Copy link
Copy Markdown
Collaborator

No description provided.

@melaniekung melaniekung requested review from anvit and sbreker March 3, 2026 20:25
@melaniekung melaniekung self-assigned this Mar 3, 2026
Copy link
Copy Markdown
Member

@sbreker sbreker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Mel - It is a great idea to update this documentation and link to CSP. I have added a couple comments:

  • it is possible to still use styles and scripts with static pages, they must be signed with a nonce however.
  • it would be good to add a link to the CSP page.

Comment thread user-manual/administer/static-pages.rst Outdated
Comment thread user-manual/administer/static-pages.rst Outdated
Comment thread user-manual/administer/static-pages.rst Outdated
Copy link
Copy Markdown
Member

@sbreker sbreker Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section is still demonstrating using inline styles. Can these examples be reworked with BS5 styling?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've rearranged this section so that the BS5 classes are mentioned first, but kept the inline example at the end with an important box that this won't work if htmlpurifier or CSP are enforced.

AtoM now enforces a :ref:`security-csp-headers` across the application.
As a result, inline CSS styles within static page content will no longer
be applied. Consider using Markdown formatting or BS5 classes instead where
styling is required.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add something to the effect of "CSP can be disabled which would allow inline scripts and styles to be used in static pages, but this is not recommended."?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so anvit and i have discussed that an experienced dev who understands the implications of CSP would know that disabling CSP is an option, but we don't want to openly suggest to users (who may not have a good technical background) that disabling CSP is an option. thoughts?

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.

3 participants