求助 spring-cloud-config 安全问题
来源:7-4 Spring Cloud Stream的使用(上)

轶哥
2018-11-29
在生产环境部署spring-cloud-config及api gateway,那么config是可以直接通过路径访问到的。
如果不写配置中心代码,仅依靠配置的情况下,如何确保配置内容的安全性呢?毕竟可能会有数据库等密钥信息。
经过我查找资料,zuul.ignoredServices: config 可以阻止外部访问配置内容,但也同时阻止了Webhook用到的/monitor
。
资料说spring-boot-starter-security
能够进行加密,但是总觉得这不是一个最佳方案:
security:
user:
name:
password:
通过zuul
的ignoredPatterns
配置,也没有办法很好的解决只允许/monitor
的问题。
请问还有别的方法能确保安全性的同时不影响WebHook,同时不用编码来实现吗?
6回答
-
好多回答。。。解决了就好,这个是spring推荐的方式。最佳实践。
112018-12-02 -
轶哥
提问者
2018-12-02
已解决。
00 -
轶哥
提问者
2018-11-30
去除ignoredServices限制 后,/monitor报404
00 -
轶哥
提问者
2018-11-30
我用Basic Auth可以正常访问配置了,但是POST方法的/monitor仍然报401。
00 -
轶哥
提问者
2018-11-30
@缪师兄 如果我按官网所述添加了密码,config是不能被访问了,但是WebHook也不行了?
00 -
轶哥
提问者
2018-11-30
5.3 Security
You can secure your Config Server in any way that makes sense to you (from physical network security to OAuth2 bearer tokens), because Spring Security and Spring Boot offer support for many security arrangements.
To use the default Spring Boot-configured HTTP Basic security, include Spring Security on the classpath (for example, through spring-boot-starter-security). The default is a username of user and a randomly generated password. A random password is not useful in practice, so we recommend you configure the password (by setting spring.security.user.password) and encrypt it (see below for instructions on how to do that).
00
SpringCloud Finchley(M2+RELEASE+SR2)微服务实战
5672 学习 · 2489 问题
相似问题