Spring5学习(二)-spring projects之Spring Security

来源:互联网 发布:hibernate数据库方言 编辑:程序博客网 时间:2024/06/11 00:56

Spring Security

Spring Security is a powerful and highly customizable(定制的) authentication(认证) and access-control framework. It is the de-facto(事实上的) standard(标准) for securing Spring-based applications.



Spring Security is a framework that focuses on providing both authentication(认证) and authorization(授权) to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements




Features

  • Comprehensive(全面的) and extensible(可扩展的) support for both Authentication and Authorization
  • Protection against attacks(防止攻击) like session fixation(会话固定), clickjacking(点击劫持), cross site request forgery(跨站请求伪造), etc
  • Servlet API integration
  • Optional integration with Spring Web MVC
  • Much more…




Quick Start
snapshot:5.0.1
maven:
<dependencies>    <dependency>        <groupId>org.springframework.security</groupId>        <artifactId>spring-security-web</artifactId>        <version>5.0.1.BUILD-SNAPSHOT</version>    </dependency></dependencies><repositories>    <repository>        <id>spring-snapshots</id>        <name>Spring Snapshots</name>        <url>https://repo.spring.io/libs-snapshot</url>        <snapshots>            <enabled>true</enabled>        </snapshots>    </repository></repositories>
gradle:
dependencies {    compile 'org.springframework.security:spring-security-web:5.0.1.BUILD-SNAPSHOT'}repositories {    maven {        url 'https://repo.spring.io/libs-snapshot'    }}





附录:
1. session fixation:会话固定攻击。Session fixation attack(会话固定攻击)是利用服务器的session不变机制,借他人之手获得认证和授权,然后冒充他人。(参考:iteye)

2. clickjacking:点击劫持,clickjacking,也被称为UI-覆盖攻击。这个词首次出现在2008年,是由互联网安全专家罗伯特·汉森和耶利米·格劳斯曼首创的。它是通过覆盖不可见的框架误导受害者点击。虽然受害者点击的是他所看到的网页,但其实他所点击的是被黑客精心构建的另一个置于原网页上面的透明页面。这种攻击利用了HTML中<iframe>标签的透明属性。(参考:百度百科)

3. cross site request forgery:跨站请求伪造(英语:Cross-site request forgery),也被称为one-click attack或者session riding,通常缩写为CSRF或者XSRF, 是一种挟制用户在当前已登录的Web应用程序上执行非本意的操作的攻击方法。跟跨网站脚本(XSS)相比,XSS利用的是用户对指定网站的信任,CSRF 利用的是网站对用户网页浏览器的信任。(参考:百度百科)










阅读全文
0 0