Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c2f7dd86
Commit
c2f7dd86
authored
Feb 28, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert default for CRSF enabled to false
Fixes gh-12267
parent
45249218
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
+9
-7
SecurityProperties.java
...ework/boot/autoconfigure/security/SecurityProperties.java
+1
-1
SecurityPropertiesTests.java
.../boot/autoconfigure/security/SecurityPropertiesTests.java
+4
-4
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-1
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+3
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java
View file @
c2f7dd86
...
...
@@ -75,7 +75,7 @@ public class SecurityProperties implements SecurityPrerequisite {
/**
* Enable Cross Site Request Forgery support.
*/
private
boolean
enableCsrf
=
tru
e
;
private
boolean
enableCsrf
=
fals
e
;
private
Basic
basic
=
new
Basic
();
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityPropertiesTests.java
View file @
c2f7dd86
...
...
@@ -123,11 +123,11 @@ public class SecurityPropertiesTests {
}
@Test
public
void
testCSrf
()
{
assertThat
(
this
.
security
.
isEnableCsrf
()).
isEqualTo
(
true
);
this
.
binder
.
bind
(
new
MutablePropertyValues
(
Collections
.
singletonMap
(
"security.enable-csrf"
,
false
)));
public
void
testCsrf
()
{
assertThat
(
this
.
security
.
isEnableCsrf
()).
isEqualTo
(
false
);
this
.
binder
.
bind
(
new
MutablePropertyValues
(
Collections
.
singletonMap
(
"security.enable-csrf"
,
true
)));
assertThat
(
this
.
security
.
isEnableCsrf
()).
isEqualTo
(
true
);
}
}
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
c2f7dd86
...
...
@@ -447,7 +447,7 @@ content into your application; rather pick only the properties that you need.
security.basic.enabled=true # Enable basic authentication.
security.basic.path=/** # Comma-separated list of paths to secure.
security.basic.realm=Spring # HTTP basic realm name.
security.enable-csrf=
tru
e # Enable Cross Site Request Forgery support.
security.enable-csrf=
fals
e # Enable Cross Site Request Forgery support.
security.filter-order=0 # Security filter chain order.
security.filter-dispatcher-types=ASYNC, FORWARD, INCLUDE, REQUEST # Security filter chain dispatcher types.
security.headers.cache=true # Enable cache control HTTP headers.
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
c2f7dd86
...
...
@@ -2536,8 +2536,9 @@ The basic features you get out of the box in a web application are:
* HTTP Basic security for all other endpoints.
* Security events published to Spring's `ApplicationEventPublisher` (successful and
unsuccessful authentication and access denied).
* Common low-level features (HSTS, XSS,
CSRF,
caching) provided by Spring Security are
* Common low-level features (HSTS, XSS, caching) provided by Spring Security are
on by default.
* Cross Site Request Forgery (CSRF) checks are disabled by default.
All of the above can be switched on and off or modified using external properties
(`+security.*+`). To override the access rules without changing any other auto-configured
...
...
@@ -2790,6 +2791,7 @@ If the Actuator is also in use, you will find:
* Security events are transformed into `AuditEvent` instances and published to the
`AuditEventRepository`.
* The default user will have the `ACTUATOR` role as well as the `USER` role.
* Cross Site Request Forgery (CSRF) checks are disabled for actuator endpoints.
The Actuator security features can be modified using external properties
(`+management.security.*+`). To override the application access rules
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment