Skip to content

Commit d548178

Browse files
authored
add stricter report policy for testing in LKSM (#141)
1 parent 6170b69 commit d548178

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ LabKey*.tar.gz
1111
startup/lims_starter-with-startup.properties
1212
startup/samplemanagement-with-startup.properties
1313
mounts/
14+
.DS_Store

application.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,20 @@ csp.enforce=\
178178
report-uri https://www.labkey.org/admin-contentsecuritypolicyreport.api?${CSP.REPORT.PARAMS} ;
179179
## END OF CSP ENFORCE BLOCK (DO NOT CHANGE THIS TEXT)
180180

181+
## START OF CSP REPORT BLOCK (DO NOT CHANGE THIS TEXT)
182+
csp.report=\
183+
default-src 'self' ; /* Limit the default to only the current server */\
184+
connect-src 'self' ${CONNECTION.SOURCES} ; /* For security purposes limit allowed connection sources, can be substituted and appended via the LabKey Admin UI */\
185+
object-src 'none' ; /* These tags are not currently used by LKS */\
186+
style-src 'self' 'unsafe-inline' ${STYLE.SOURCES} ; /* We currently have a few inline <style> tags that we are weeding out */\
187+
img-src 'self' data: ; /* Limit image loading locations */\
188+
font-src 'self' data: ${FONT.SOURCES} ; /* Limit font source loading locations */\
189+
script-src 'unsafe-eval' 'strict-dynamic' 'nonce-${REQUEST.SCRIPT.NONCE}' ; /* Limit scripts that are allowed to those with nonces or transitive scripts */\
190+
base-uri 'self' ; /* Limit the base tags to only source from current server */\
191+
frame-ancestors 'self' ; /* Only allow iframe resources to the current server */\
192+
frame-src 'self' ${FRAME.SOURCES} ; /* Only allow iframe resources from the current server plus explicitly declared external sources */\
193+
report-uri https://www.labkey.org/admin-contentsecuritypolicyreport.api?${CSP.REPORT.PARAMS} ; /* Reports any encountered CSP conflicts to the supplied URL */
194+
## END OF CSP REPORT BLOCK (DO NOT CHANGE THIS TEXT)
195+
181196
## Load optional application.properties if file exists - used for one-off labkey cloud use cases etc.
182197
spring.config.import=optional:file:${LABKEY_HOME}/config/optional.application.properties

0 commit comments

Comments
 (0)