> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/28.-security/28.4-actuator-security/28.4.1-cross-site-request-forgery-protection.md).

# 28.4.1 跨站请求伪造保护

由于Spring Boot依赖Spring Security的默认配置，CSRF保护默认启用。这意味着：当默认安全配置在使用中时，需要`POST`（关机和记录器端点）、`PUT`或者`DELETE`的执行器端点会得到一个403的禁止错误。

**注** 我们推荐只在创建由非浏览器客户端使用的服务时，完全禁用CSRF保护。

可以在[Spring Security参考指南](https://docs.spring.io/spring-security/site/docs/5.0.3.RELEASE/reference/htmlsingle#csrf)查看与CSRF保护相关的额外信息。
