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
573cb98d
Commit
573cb98d
authored
Jun 01, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make management security configuration back off when SAML present
Fixes gh-21620
parent
14c9804c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
1 deletion
+42
-1
pom.xml
...g-boot-project/spring-boot-actuator-autoconfigure/pom.xml
+5
-0
ManagementWebSecurityAutoConfiguration.java
...urity/servlet/ManagementWebSecurityAutoConfiguration.java
+2
-1
ManagementWebSecurityAutoConfigurationTests.java
.../servlet/ManagementWebSecurityAutoConfigurationTests.java
+11
-0
certificate-location
...utoconfigure/src/test/resources/saml/certificate-location
+24
-0
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml
View file @
573cb98d
...
...
@@ -622,6 +622,11 @@
<artifactId>
spring-security-oauth2-jose
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.security
</groupId>
<artifactId>
spring-security-saml2-service-provider
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.yaml
</groupId>
<artifactId>
snakeyaml
</artifactId>
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfiguration.java
View file @
573cb98d
...
...
@@ -27,6 +27,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.saml2.Saml2RelyingPartyAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.WebSecurityEnablerConfiguration
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -48,7 +49,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
@AutoConfigureBefore
(
SecurityAutoConfiguration
.
class
)
@AutoConfigureAfter
({
HealthEndpointAutoConfiguration
.
class
,
InfoEndpointAutoConfiguration
.
class
,
WebEndpointAutoConfiguration
.
class
,
OAuth2ClientAutoConfiguration
.
class
,
OAuth2ResourceServerAutoConfiguration
.
class
})
OAuth2ResourceServerAutoConfiguration
.
class
,
Saml2RelyingPartyAutoConfiguration
.
class
})
@Import
({
ManagementWebSecurityConfigurerAdapter
.
class
,
WebSecurityEnablerConfiguration
.
class
})
public
class
ManagementWebSecurityAutoConfiguration
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java
View file @
573cb98d
...
...
@@ -28,6 +28,7 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoC
import
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.saml2.Saml2RelyingPartyAutoConfiguration
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.test.context.assertj.AssertableWebApplicationContext
;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
...
...
@@ -109,6 +110,16 @@ class ManagementWebSecurityAutoConfigurationTests {
.
run
((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
ManagementWebSecurityConfigurerAdapter
.
class
));
}
@Test
void
backOffIfSaml2RelyingPartyAutoConfigurationPresent
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
Saml2RelyingPartyAutoConfiguration
.
class
))
.
withPropertyValues
(
"spring.security.saml2.relyingparty.registration.simplesamlphp.identity-provider.sso-url=https://simplesaml-for-spring-saml/SSOService.php"
,
"spring.security.saml2.relyingparty.registration.simplesamlphp.identityprovider.entity-id=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php"
,
"spring.security.saml2.relyingparty.registration.simplesamlphp.identityprovider.verification.credentials[0].certificate-location=classpath:saml/certificate-location"
)
.
run
((
context
)
->
assertThat
(
context
).
doesNotHaveBean
(
ManagementWebSecurityConfigurerAdapter
.
class
));
}
private
HttpStatus
getResponseStatus
(
AssertableWebApplicationContext
context
,
String
path
)
throws
IOException
,
javax
.
servlet
.
ServletException
{
FilterChainProxy
filterChainProxy
=
context
.
getBean
(
FilterChainProxy
.
class
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/saml/certificate-location
0 → 100644
View file @
573cb98d
-----BEGIN CERTIFICATE-----
MIIEEzCCAvugAwIBAgIJAIc1qzLrv+5nMA0GCSqGSIb3DQEBCwUAMIGfMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCQ08xFDASBgNVBAcMC0Nhc3RsZSBSb2NrMRwwGgYD
VQQKDBNTYW1sIFRlc3RpbmcgU2VydmVyMQswCQYDVQQLDAJJVDEgMB4GA1UEAwwX
c2ltcGxlc2FtbHBocC5jZmFwcHMuaW8xIDAeBgkqhkiG9w0BCQEWEWZoYW5pa0Bw
aXZvdGFsLmlvMB4XDTE1MDIyMzIyNDUwM1oXDTI1MDIyMjIyNDUwM1owgZ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Y1YlQ4/tlpgTgfIJxKV6nyPiLoK0nywbMd+vpAirDt2Oc+hk
-----END CERTIFICATE-----
\ No newline at end of file
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