Skip to content

Commit 667595e

Browse files
committed
enable actuator security in config server
1 parent 7772ef6 commit 667595e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

config/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ MAINTAINER Alexander Lukyanchikov <[email protected]>
44
ADD ./target/config.jar /app/
55
CMD ["java", "-Xmx200m", "-jar", "/app/config.jar"]
66

7-
HEALTHCHECK --interval=10s --timeout=3s CMD curl -f http://localhost:8888/health || exit 1
7+
HEALTHCHECK --interval=10s --timeout=3s CMD curl -f http://localhost:8888/actuator/health || exit 1
88

99
EXPOSE 8888
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.piggymetrics.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
5+
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
6+
7+
/**
8+
* @author cdov
9+
*/
10+
@Configuration
11+
public class SecurityConfig extends WebSecurityConfigurerAdapter {
12+
13+
@Override
14+
protected void configure(HttpSecurity http) throws Exception {
15+
http.csrf().disable();
16+
http
17+
.authorizeRequests()
18+
.antMatchers("/actuator/**").permitAll()
19+
.anyRequest().authenticated()
20+
.and()
21+
.httpBasic()
22+
;
23+
}
24+
}

0 commit comments

Comments
 (0)