Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for image-src external sources #999

Merged
merged 3 commits into from
Feb 21, 2025
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
24 changes: 13 additions & 11 deletions server/configs/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,29 @@ management.server.port=@@shutdownPort@@
#jsonaccesslog.condition-unless=attributeName

## START OF CSP ENFORCE BLOCK (DO NOT CHANGE THIS TEXT)
## CSP Version: e10
#useLocalBuild#csp.enforce=\
#useLocalBuild# default-src 'self' https: ;\
#useLocalBuild# connect-src 'self' ${CONNECTION.SOURCES} ;\
#useLocalBuild# object-src 'none' ;\
#useLocalBuild# style-src 'self' https: 'unsafe-inline' ${STYLE.SOURCES} ;\
#useLocalBuild# img-src 'self' https: 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# default-src 'self' https: ; \
#useLocalBuild# connect-src 'self' ${CONNECTION.SOURCES} ; \
#useLocalBuild# object-src 'none' ; \
#useLocalBuild# style-src 'self' https: 'unsafe-inline' ${STYLE.SOURCES} ; \
#useLocalBuild# img-src 'self' https: data: ${IMAGE.SOURCES} ; \
#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 Version: r11
csp.report=\
default-src 'self' ; /* Limit the default to only the current server */\
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' ${STYLE.SOURCES} ; /* We currently have a few inline <style> tags that we are weeding out */\
img-src 'self' data: ; /* Limit image loading locations */\
img-src 'self' data: ${IMAGE.SOURCES} ; /* Limit image 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 */\
Expand Down