| Section 6 |
|---|
6.1 Identify correct descriptions or statements about the security issues:
|
6.2 Identify the deployment descriptor element names, and their structure, that declare the following:
|
6.3 Given an authentication type:
|
6.1 Identify correct descriptions or statements about the security issues:
Authentication:
The act of determining the identity of the requesting entity is known as authentication.
<web-app>
<login-config>
<auth-method> BASIC </auth-method>
<realm-name> jpets </realm-name>
</login-config>
</web-app>
-------------
<web-app>
<login-config>
<auth-method> FORM </auth-method>
<form-login-config>
<form-login-page> login.jsp </form-login-page>
<form-error-page> error.jsp </form-error-page>
</form-login-config>
</login-config>
</web-app>
-------------
<web-app>
<login-config>
<auth-method> CLIENT_CERT </auth-method>
</login-config>
</web-app>
The existing data:
The practice of capturing a record of security-related events to hold
users or systems accountable for their actions.
Face three types of attacks in a distrubuted computing system:
6.2 Identify the deployment descriptor element names, and their structure, that declare the following:
lets you designate URLs that should be protected. It goes hand-in-hand with
the login-config element. It should come immediately before login-config in
web.xml and contains four possible sub-elements.
<web-app>
<servlet>
<servlet-name>secretSalary</servlet-name>
<servlet-class>SalaryServer</servlet-class>
</sevlet>
<security-constraint>
<web-resource-collection>
<web-resource-name>protectedResource</web-resource-name>
<url-pattern>/servlet/SalaryServer</url-pattern>
<url-pattern>/servlet/secretSalary</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
<role-name>ceo</role-name>
</auth-constraint> NOTE: if no role-name, then not viewable by any user; if role-name = "*" then viewable by all roles
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Each security-constraint element must contain one or more web-resource-collection entries.
<security-constraint>
<web-resource-collection>
<web-resource-name>Proprietary</web-resource-name>
<url-pattern>/proprietary/*</url-pattern>
</web-resource-collection>
<web-resource-collection>
<web-resource-name>Account</web-resource-name>
<url-pattern>/admin/account.jsp</url-pattern>
</web-resource-collection>
<!-- ... -- >
</security-constraint>
Use the login-config element to control the authentication method.
To use form-based authentication, supply a value of FORM for the auth-method sub-element
and use the form-login-config subelement to give the locations of the login. and login-failure pages.
<login-config>
<auth-method> FORM </auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/login-error.html</form-error-page>
</form-login-config>
</login-config>
All the login page requires is a form with an ACTION of j_security_check, a textfield
named j_username, and a password field named j_password. All forms that have password fields should use a
METHOD of POST. For example:
<BODY> ... <FORM ACTION="j_security_check" METHOD="POST"> <TABLE> <TR><TD>User Name: <INPUT TYPE="TEXT" NAME="j_username"> <TR><TD>Password: <INPUT TYPE="PASSWORD" NAME="j_password"> <TR><TH><INPUT TYPE="SUBMIT" VALUE="Log In"> </TABLE> </FORM> ... </BODY>
The security-role element gives a list of security roles that will appear in the role-name
subelements of the security-role-ref element inside the servlet element.
<servlet>
<!-- ... -- >
<security-role-ref>
<role-name>boss</role-name> <!-- New alias -- >
<role-link>manager</role-link > <!-- Real name -- >
</security-role-ref >
</servlet >
Another example:
<web-app>
<!-- ... !-->
<login-config>
<auth-method>BASIC/DIGEST/FORM/CLIENT-CERT</auth-method>
<realm-name>Default </realm-name> <!-- optional, only useful for BASIC authentication -->
<form-login-config> <!-- optional, only useful for FORM based authentication -->
<form-login-page>/loginpage.html</form-login-page>
<form-error-page>/errorpage.html</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>manager</role-name>
</security-role> not req'd; explicitly declaring the webapp's roles supports tool-based manipulation of the file
</web-app>
6.3 Given an authentication type: BASIC, DIGEST, FORM, and CLIENT-CERT, identify the correct definition of its mechanism.
BASIC
DIGEST
FORM
CLIENT-CERT