Skip to content

Commit 7c771ce

Browse files
committed
Security fixes applied
1 parent d2f7728 commit 7c771ce

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

publish-service/src/main/java/com/ericsson/eiffel/remrem/publish/config/SecurityConfig.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3131
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
3232

33+
import static org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.disable;
34+
3335
/**
3436
* This class is used to enable the ldap authentication based on property
3537
* activedirectory.publish.enabled = true in properties file.
@@ -110,7 +112,13 @@ protected void configure(HttpSecurity http) throws Exception {
110112
.httpBasic()
111113
.authenticationEntryPoint(customAuthenticationEntryPoint)
112114
.and()
113-
.csrf();
114-
// .disable();
115+
.csrf()
116+
// The application uses non-browser clients. Yes, there is swagger interface,
117+
// but is's used only for testing/tuning.
118+
//
119+
// From https://docs.spring.io/spring-security/reference/features/exploits/csrf.html
120+
// "If you are creating a service that is used only by non-browser clients,
121+
// you likely want to disable CSRF protection."
122+
.disable();
115123
}
116124
}

0 commit comments

Comments
 (0)