springsecurity.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <book version="5.0" xml:id="spring-security-reference-guide" xmlns="http://docbook.org/ns/docbook"
  3. xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
  4. <info>
  5. <title>Spring Security</title>
  6. <subtitle>Reference Documentation</subtitle>
  7. <authorgroup>
  8. <author>
  9. <personname>Ben Alex</personname>
  10. </author>
  11. <author>
  12. <personname>Luke Taylor</personname>
  13. </author>
  14. </authorgroup>
  15. <productname>Spring Security</productname>
  16. <releaseinfo>3.1.0-DRAFT</releaseinfo>
  17. </info>
  18. <toc/>
  19. <preface xml:id="preface">
  20. <title>Preface</title>
  21. <para>Spring Security provides a comprehensive security solution for J2EE-based enterprise
  22. software applications. As you will discover as you venture through this reference guide,
  23. we have tried to provide you a useful and highly configurable security system.</para>
  24. <para>Security is an ever-moving target, and it's important to pursue a comprehensive,
  25. system-wide approach. In security circles we encourage you to adopt "layers of
  26. security", so that each layer tries to be as secure as possible in its own right, with
  27. successive layers providing additional security. The "tighter" the security of each
  28. layer, the more robust and safe your application will be. At the bottom level you'll
  29. need to deal with issues such as transport security and system identification, in order
  30. to mitigate man-in-the-middle attacks. Next you'll generally utilise firewalls, perhaps
  31. with VPNs or IP security to ensure only authorised systems can attempt to connect. In
  32. corporate environments you may deploy a DMZ to separate public-facing servers from
  33. backend database and application servers. Your operating system will also play a
  34. critical part, addressing issues such as running processes as non-privileged users and
  35. maximising file system security. An operating system will usually also be configured
  36. with its own firewall. Hopefully somewhere along the way you'll be trying to prevent
  37. denial of service and brute force attacks against the system. An intrusion detection
  38. system will also be especially useful for monitoring and responding to attacks, with
  39. such systems able to take protective action such as blocking offending TCP/IP addresses
  40. in real-time. Moving to the higher layers, your Java Virtual Machine will hopefully be
  41. configured to minimize the permissions granted to different Java types, and then your
  42. application will add its own problem domain-specific security configuration. Spring
  43. Security makes this latter area - application security - much easier. </para>
  44. <para>Of course, you will need to properly address all security layers mentioned above,
  45. together with managerial factors that encompass every layer. A non-exhaustive list of
  46. such managerial factors would include security bulletin monitoring, patching, personnel
  47. vetting, audits, change control, engineering management systems, data backup, disaster
  48. recovery, performance benchmarking, load monitoring, centralised logging, incident
  49. response procedures etc.</para>
  50. <para>With Spring Security being focused on helping you with the enterprise application
  51. security layer, you will find that there are as many different requirements as there are
  52. business problem domains. A banking application has different needs from an ecommerce
  53. application. An ecommerce application has different needs from a corporate sales force
  54. automation tool. These custom requirements make application security interesting,
  55. challenging and rewarding. </para>
  56. <para>Please read <xref linkend="getting-started"/>, in its entirety to begin with. This
  57. will introduce you to the framework and the namespace-based configuration system with
  58. which you can get up and running quite quickly. To get more of an understanding of how
  59. Spring Security works, and some of the classes you might need to use, you should then
  60. read <xref linkend="overall-architecture"/>. The remaining parts of this guide are
  61. structured in a more traditional reference style, designed to be read on an as-required
  62. basis. We'd also recommend that you read up as much as possible on application security
  63. issues in general. Spring Security is not a panacea which will solve all security
  64. issues. It is important that the application is designed with security in mind from the
  65. start. Attempting to retrofit it is not a good idea. In particular, if you are building
  66. a web application, you should be aware of the many potential vulnerabilities such as
  67. cross-site scripting, request-forgery and session-hijacking which you should be taking
  68. into account from the start. The OWASP web site (http://www.owasp.org/) maintains a top
  69. ten list of web application vulnerabilities as well as a lot of useful reference
  70. information. </para>
  71. <para>We hope that you find this reference guide useful, and we welcome your feedback and
  72. <link xlink:href="#jira">suggestions</link>. </para>
  73. <para>Finally, welcome to the Spring Security <link xlink:href="#community"
  74. >community</link>. </para>
  75. </preface>
  76. <part xml:id="getting-started">
  77. <title>Getting Started</title>
  78. <partintro>
  79. <para>The later parts of this guide provide an in-depth discussion of the framework
  80. architecture and implementation classes, which you need to understand if you want to
  81. do any serious customization. In this part, we'll introduce Spring Security 3.0,
  82. give a brief overview of the project's history and take a slightly gentler look at
  83. how to get started using the framework. In particular, we'll look at namespace
  84. configuration which provides a much simpler way of securing your application
  85. compared to the traditional Spring bean approach where you have to wire up all the
  86. implementation classes individually. </para>
  87. <para> We'll also take a look at the sample applications that are available. It's worth
  88. trying to run these and experimenting with them a bit even before you read the later
  89. sections - you can dip back into them as your understanding of the framework
  90. increases. Please also check out the <link
  91. xlink:href="http://static.springsource.org/spring-security/site/index.html"
  92. >project website</link> as it has useful information on building the project,
  93. plus links to articles, videos and tutorials. </para>
  94. </partintro>
  95. <xi:include href="introduction.xml"/>
  96. <xi:include href="new-3-1.xml"/>
  97. <xi:include href="namespace-config.xml"/>
  98. <xi:include href="samples.xml"/>
  99. <xi:include href="community.xml"/>
  100. </part>
  101. <part xml:id="overall-architecture">
  102. <title>Architecture and Implementation</title>
  103. <partintro>
  104. <para>Once you are familiar with setting up and running some namespace-configuration
  105. based applications, you may wish to develop more of an understanding of how the
  106. framework actually works behind the namespace facade. Like most software, Spring
  107. Security has certain central interfaces, classes and conceptual abstractions that
  108. are commonly used throughout the framework. In this part of the reference guide we
  109. will look at some of these and see how they work together to support authentication
  110. and access-control within Spring Security.</para>
  111. </partintro>
  112. <xi:include href="technical-overview.xml"/>
  113. <xi:include href="core-services.xml"/>
  114. </part>
  115. <part xml:id="web-app-security">
  116. <title>Web Application Security</title>
  117. <partintro>
  118. <para> Most Spring Security users will be using the framework in applications which make
  119. user of HTTP and the Servlet API. In this part, we'll take a look at how Spring
  120. Security provides authentication and access-control features for the web layer of an
  121. application. We'll look behind the facade of the namespace and see which classes and
  122. interfaces are actually assembled to provide web-layer security. In some situations
  123. it is necessary to use traditional bean configuration to provide full control over
  124. the configuration, so we'll also see how to configure these classes directly without
  125. the namespace.</para>
  126. </partintro>
  127. <xi:include href="security-filter-chain.xml"/>
  128. <xi:include href="core-filters.xml"/>
  129. <xi:include href="basic-and-digest-auth.xml"/>
  130. <xi:include href="remember-me-authentication.xml"/>
  131. <xi:include href="session-mgmt.xml"/>
  132. <xi:include href="anon-auth-provider.xml"/>
  133. </part>
  134. <part xml:id="authorization">
  135. <title>Authorization</title>
  136. <partintro>
  137. <para>The advanced authorization capabilities within Spring Security represent one of
  138. the most compelling reasons for its popularity. Irrespective of how you choose to
  139. authenticate - whether using a Spring Security-provided mechanism and provider, or
  140. integrating with a container or other non-Spring Security authentication authority -
  141. you will find the authorization services can be used within your application in a
  142. consistent and simple way.</para>
  143. <para>In this part we'll explore the different
  144. <classname>AbstractSecurityInterceptor</classname> implementations, which were
  145. introduced in Part I. We then move on to explore how to fine-tune authorization
  146. through use of domain access control lists.</para>
  147. </partintro>
  148. <xi:include href="authorization-common.xml"/>
  149. <xi:include href="secured-objects.xml"/>
  150. <xi:include href="el-access.xml"/>
  151. </part>
  152. <part xml:id="advanced-topics">
  153. <title>Additional Topics</title>
  154. <!--
  155. Essentially standalone features which do not have to follow on directly from earlier chapters
  156. -->
  157. <partintro>
  158. <para> In this part we cover features which require a knowledge of previous chapters as
  159. well as some of the more advanced and less-commonly used features of the
  160. framework.</para>
  161. </partintro>
  162. <xi:include href="domain-acls.xml"/>
  163. <xi:include href="preauth.xml"/>
  164. <xi:include href="ldap-auth-provider.xml"/>
  165. <xi:include href="taglibs.xml"/>
  166. <xi:include href="jaas-auth-provider.xml"/>
  167. <xi:include href="cas-auth-provider.xml"/>
  168. <xi:include href="x509-auth-provider.xml"/>
  169. <xi:include href="runas-auth-provider.xml"/>
  170. <xi:include href="crypto.xml"/>
  171. </part>
  172. <xi:include href="appendix-db-schema.xml"/>
  173. <xi:include href="appendix-namespace.xml"/>
  174. <xi:include href="appendix-dependencies.xml"/>
  175. </book>