Update and rename 41.1. Securing sensitive endpoints to 41.1. Securing sensitive endpoints.md

master
qibaoguang 2015-03-02 23:32:52 +08:00
parent f15130f845
commit d24d9bbdbf
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
### 41.1. 保护敏感端点
如果你的项目中添加的有Spring Security所有通过HTTP暴露的敏感端点都会受到保护。默认情况下会使用基本认证basic authentication用户名为user密码为应用启动时在控制台打印的密码
你可以使用Spring属性改变用户名密码和访问端点需要的安全角色。例如你可能会在application.properties中添加下列配置
```java
security.user.name=admin
security.user.password=secret
management.security.role=SUPERUSER
```
**注**如果你不使用Spring Security那你的HTTP端点就被公开暴露你应该慎重考虑启用哪些端点。具体参考[Section 40.1, “Customizing endpoints”](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-customizing-endpoints)。