Skip to content

Commit cd641b0

Browse files
committed
Security fix described
1 parent 82b2c1c commit cd641b0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

service/src/main/java/com/ericsson/eiffel/remrem/generate/config/DisabledSecurityConfig.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@
3434
public class DisabledSecurityConfig extends WebSecurityConfigurerAdapter {
3535
@Override
3636
protected void configure(HttpSecurity http) throws Exception {
37-
http.authorizeRequests().anyRequest().permitAll().and().csrf().disable();
37+
http.authorizeRequests()
38+
.anyRequest()
39+
.permitAll()
40+
.and()
41+
.csrf()
42+
// The application uses non-browser clients. Yes, there is swagger interface,
43+
// but is's used only for testing/tuning.
44+
//
45+
// From https://docs.spring.io/spring-security/reference/features/exploits/csrf.html
46+
// "If you are creating a service that is used only by non-browser clients,
47+
// you likely want to disable CSRF protection."
48+
.disable();
3849
}
3950
}

0 commit comments

Comments
 (0)