The <PolicyRule> element configures a plugin used to enforce a security policy requirement or to provide for a particular kind of authentication technology.

In versions prior to 2.2, this element was named <Rule>, which conflicts with the identically-named element used in the access control syntax. For obscure schema design reasons, the elements co-existed, but this conflict has been corrected in subsequent versions.

During message processing, at least one rule must successfully authenticate a message or it will be rejected.

Common Attributes


MessageFlow Rule

Identified by type="MessageFlow", this rule enforces replay detection and freshness requirements to prevent replay attacks.

<PolicyRule type="MessageFlow" checkReplay="true" expires="60"/>

Attributes


ClientCertAuth Rule

Identified by type="ClientCertAuth", enables TLS/SSL client certificate authentication for back-channel SOAP communication to the SP.

<PolicyRule type="ClientCertAuth" errorFatal="true"/>

Attributes


XMLSigning Rule

Identified by type="XMLSigning", enables XML signature authentication of messages and assertions.

<PolicyRule type="XMLSigning" errorFatal="true"/>

Attributes


SimpleSigning Rule

Identified by type="SimpleSigning", enables "simple" signature authentication of messages. A simple signature is a bulk signature over the raw content of a message, rather than embedded inside the message.

<PolicyRule type="SimpleSigning" errorFatal="true"/>

Attributes


Conditions Rule (Version 2.2 and Above)

Identified by type="Conditions", processes SAML 1.x and 2.0 "condition" elements found in assertions, which control the circumstances under which they may be accepted by the SP for use. In the absence of this rule, any conditions found will result in rejection of an assertion.

This rule also enforces the NotBefore and NotOnOrAfter attributes accompanying the assertion, if any.

If no child elements are supplied, the plugin will install itself with a default set of rules equivalent to the following:

<PolicyRule type="Conditions" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
    <PolicyRule type="Audience"/>
    <PolicyRule type="Ignore">saml:DoNotCacheCondition</PolicyRule>
    <PolicyRule type="Ignore">saml2:OneTimeUse</PolicyRule>
    <PolicyRule type="Ignore">saml2:ProxyRestriction</PolicyRule>
</PolicyRule>

Child Elements


Audience Rule (Version 2.2 and Above)

Identified by type="Audience", processes SAML 1.x and 2.0 "AudienceRestriction" conditions. The set of allowed "audience" values are normally supplied within the rule configuration or can be supplied by unspecified means (e.g., the SP will normally ensure that its own entityID is an allowable value without special setup).

<PolicyRule type="Audience"/>

Child Elements


Delegation Rule (Version 2.2 and Above)

Identified by type="Delegation", processes SAML 2.0 "DelegationRestriction" conditions. A rule can either generically permit delegation, or require specific delegates with a variety of matching options.

<PolicyRule type="Delegation" match="oldest"
    xmlns:del="urn:oasis:names:tc:SAML:2.0:conditions:delegation"
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
  <del:Delegate>
    <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://portal.example.org/shibboleth</saml:NameID>
  </del:Delegate>
  <del:Delegate ConfirmationMethod="urn:oasis:names:tc:SAML:2.0:cm:holder-of-key">
    <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://portal2.example.org/shibboleth</saml:NameID>
  </del:Delegate>
  <del:Delegate>
    <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://portal3.example.org/shibboleth</saml:NameID>
  </del:Delegate>
</PolicyRule>

Attributes

Child Elements


Ignore Rule (Version 2.2 and Above)

Identified by type="Ignore", signals to a containing Conditions rule (see above) that a condition has been understood and should not affect the processing of an assertion. Many condition types do not affect validity per se, but all SAML conditions require explicit acknowledgement and acceptance of their semantics.

The content of this element is an XML QName identifying the XML element or schema type of a SAML condition to ignore and treat as successfully processed.

<PolicyRule type="Ignore" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">saml2:ProxyRestriction</PolicyRule>

SAML1BrowserSSO (Version 2.2 and Above)

Identified by type="SAML1BrowserSSO", enforces the general assertion requirements of the SAML 1.x Browser SSO profile. Normally not used explicitly, this rule is applied automatically to any policy running inside an AssertionConsumerService that implements the profile.


Bearer (Version 2.2 and Above)

Identified by type="Bearer", allows a SAML 2.0 assertion with the "bearer" subject confirmation method to be accepted when possible. Normally not used explicitly, this rule is applied automatically to any policy running inside an AssertionConsumerService that implements SAML 2.0 profiles that make use of this confirmation type.

Attributes


NullSecurity Rule

Identified by type="NullSecurity", enables debugging by disabling security and permitting unauthenticated messages to pass successfully into higher layers.

<PolicyRule type="NullSecurity"/>

Do NOT use this rule in production, as it will leave your system vulnerable to attackers.