Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions server/configs/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,30 @@ management.server.port=@@shutdownPort@@
## START OF CSP ENFORCE BLOCK (DO NOT CHANGE THIS TEXT)
#useLocalBuild#csp.enforce=\
#useLocalBuild# default-src 'self' https: ;\
#useLocalBuild# connect-src 'self' ${LABKEY.ALLOWED.CONNECTIONS} ;\
#useLocalBuild# connect-src 'self' ${CONNECTION.SOURCES} ;\
#useLocalBuild# object-src 'none' ;\
#useLocalBuild# style-src 'self' https: 'unsafe-inline' ;\
#useLocalBuild# style-src 'self' https: 'unsafe-inline' ${STYLE.SOURCES} ;\
#useLocalBuild# img-src 'self' https: data: ;\
#useLocalBuild# font-src 'self' data: ;\
#useLocalBuild# font-src 'self' data: ${FONT.SOURCES} ;\
#useLocalBuild# script-src 'self' 'unsafe-eval' 'strict-dynamic' 'nonce-${REQUEST.SCRIPT.NONCE}' ;\
#useLocalBuild# base-uri 'self' ;\
#useLocalBuild# frame-ancestors 'self' ;\
#useLocalBuild# frame-src 'self' ${FRAME.SOURCES} ;\
#useLocalBuild# report-uri /admin-contentsecuritypolicyreport.api?${CSP.REPORT.PARAMS} ;
## END OF CSP ENFORCE BLOCK (DO NOT CHANGE THIS TEXT)

## START OF CSP REPORT BLOCK (DO NOT CHANGE THIS TEXT)
csp.report=\
default-src 'self' ; /* Limit the default to only the current server */\
connect-src 'self' ${LABKEY.ALLOWED.CONNECTIONS} ; /* For security purposes limit allowed connection sources, can be substituted and appended via the LabKey Admin UI */\
connect-src 'self' ${CONNECTION.SOURCES} ; /* For security purposes limit allowed connection sources, can be substituted and appended via the LabKey Admin UI */\
object-src 'none' ; /* These tags are not currently used by LKS */\
style-src 'self' 'unsafe-inline' ; /* We currently have a few inline <style> tags that we are weeding out */\
style-src 'self' 'unsafe-inline' ${STYLE.SOURCES} ; /* We currently have a few inline <style> tags that we are weeding out */\
img-src 'self' data: ; /* Limit image loading locations */\
Copy link
Contributor

Choose a reason for hiding this comment

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

I will be surprised if we don't end up fielding a request to customize img-src at some point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, probably. It will be very easy to add more directives in follow-on PRs... perhaps even the UI one coming up. I was mostly focused on getting the infrastructure in place and tested, and resolving immediate failures caused by the recent CSP changes (ReactJS hot reloading, CDS tests, etc.).

font-src 'self' data: ; /* Limit font source loading locations */\
font-src 'self' data: ${FONT.SOURCES} ; /* Limit font source loading locations */\
script-src 'unsafe-eval' 'strict-dynamic' 'nonce-${REQUEST.SCRIPT.NONCE}' ; /* Limit scripts that are allowed to those with nonces or transitive scripts */\
base-uri 'self' ; /* Limit the base tags to only source from current server */\
frame-ancestors 'self' ; /* Only allow embedding resources to the current server */\
frame-ancestors 'self' ; /* Only allow iframe resources to the current server */\
frame-src 'self' ${FRAME.SOURCES} ; /* Only allow iframe resources from the current server plus explicitly declared external sources */\
report-uri /admin-contentsecuritypolicyreport.api?${CSP.REPORT.PARAMS} ; /* Reports any encountered CSP conflicts to the supplied URL */
## END OF CSP REPORT BLOCK (DO NOT CHANGE THIS TEXT)

Expand Down