diff --git a/converter/pom.xml b/converter/pom.xml index c31ccd371..819a9cf93 100644 --- a/converter/pom.xml +++ b/converter/pom.xml @@ -166,6 +166,12 @@ 2.12.2 test + + gov.cms.qpp.conversion + commons + 2022.2.0-RELEASE + compile + diff --git a/rest-api/src/main/java/gov/cms/qpp/conversion/api/config/SecurityConfig.java b/rest-api/src/main/java/gov/cms/qpp/conversion/api/config/SecurityConfig.java index d71fd2a4a..9f73dc8ee 100644 --- a/rest-api/src/main/java/gov/cms/qpp/conversion/api/config/SecurityConfig.java +++ b/rest-api/src/main/java/gov/cms/qpp/conversion/api/config/SecurityConfig.java @@ -1,11 +1,13 @@ package gov.cms.qpp.conversion.api.config; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; import gov.cms.qpp.conversion.api.security.JwtAuthorizationFilter; @@ -42,6 +44,11 @@ protected void configure(HttpSecurity http) throws Exception { .addFilter(new JwtAuthorizationFilter(authenticationManager(), Set.of(orgName, rtiOrgName))) .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and().cors() - .and().csrf().disable(); + .and().csrf().disable() + .headers(headers -> headers + .contentSecurityPolicy(csp -> csp + .policyDirectives("script-src 'self'") + ) + ); } }