{"id":753,"date":"2005-07-14T17:44:00","date_gmt":"2005-07-15T02:44:00","guid":{"rendered":"http:\/\/www.cloudidentity.com\/blog\/2005\/07\/14\/ws-securitypolicy-il-bignami\/"},"modified":"2013-03-15T21:53:32","modified_gmt":"2013-03-16T06:53:32","slug":"438999","status":"publish","type":"post","link":"https:\/\/www.cloudidentity.com\/blog\/2005\/07\/14\/438999\/","title":{"rendered":"WS-SecurityPolicy: il Bignami"},"content":{"rendered":"<p><P>WS-SecurityPolicy is a very interesting specification. It really shows that it incorporated the feedback of people which actually used WS-Security: it address historical concerns like the order of operations, the&nbsp;role of the tokens (initiator rather than recipient), the protection of elements of the wsse:security header&#8230; hey, it even acknowledges that sometimes the security may come from the transport! It gives up some &#8220;mathematical&#8221; beauty in favor of a more immediate usage, at the price of a proliferation of the assertions. And it&#8217;s clear from the property approach that it was designed also with the enforcing stage in mind, besided the checking one. However it got pretty think, it&#8217;s a 90 pg PDF: and some part of it is inevitably syntactic sugar.<\/P><br \/>\n<P>So I thought it could be useful to pull out a Bignami out of it. &#8220;Bignami&#8221; was (is?) a collection of small sub-pocket books, which covered the absolute essentials of various school subject (Math, Latin, Italian, Phisics&#8230;) and was especially handy before classworks. I have to warn you, in the shrinking effort I may leave out important things or simplify to the point of being wrong (despite mr. Einstein advice. BTW: I had the pleasure to have tea more than once with mr. Trautman, he&#8217;s an exquisite person); plus, here it&#8217;s way past midnight and the usual drowsiness is already clouding my judgement \ud83d\ude42<\/P><br \/>\n<P>==================================================<\/P><br \/>\n<P>WS-SecurityPolicy describes an assertion framework which covers WSS, WS-Trust and WS-SecueConversation; however it can leverage security features of transport, too. Let&#8217;s have a short summary of relevant sections.<\/P><br \/>\n<P>3.1 &#8211; WS-SP assertions fall in 5 main categories. <STRONG>protection assertions<\/STRONG> rule confidentiality and integrity; <STRONG>conditional assettions <\/STRONG>express conditions; <STRONG>security binding assertions<\/STRONG> gather general assertions, ruling how to deal with parts: quoting the spec, &#8220;At its simplest form, the security binding restricts what can be placed in the wsse:Security header and the associated processing rules.&#8221;; <STRONG>supporting token assertions<\/STRONG> describe token which perform &#8220;ancillary&#8221; operations in respect to the ones which determines the binding pattern (more about this later); <STRONG>WSS &amp; trust assertions<\/STRONG>&nbsp;express how certain specific aspects of the specifications are applied.<\/P><br \/>\n<P>3.2 &#8211; in depht explanation of nesting and &#8220;combinatorial&#8221; assetion algebra<\/P><br \/>\n<P>3.3 &#8211; gives more detail about what a binding is. WS-SP supplies 3 bindings: symmetric binding, asymmetric binding, transport binding. They represent common patterns, that&#8217;s to say specific values for the following carachteristics:<\/P><br \/>\n<UL><br \/>\n<LI>which tokens will have to be there, and their role in the message<br \/>\n<LI>how to&nbsp;transfer keys&nbsp;<br \/>\n<LI>which message parts are mandatory<br \/>\n<LI>how wsse:security will look like in terms of kind, number &amp; order of elements<br \/>\n<LI>how the messages will be correlated<\/LI><\/UL><br \/>\n<P>4 &#8211; details of the nesting machanism. From now on, every assertion will implicitly have a sp:policy subassertion evan if I don&#8217;t mention it<\/P><br \/>\n<P>4.2&nbsp;&#8211; policy subjects. there are 3 possible subjects to which the policy may refer to: <STRONG>Message<\/STRONG>, <STRONG>Operation<\/STRONG>, <STRONG>Endpoint<\/STRONG>. Different kinds of assertions apply to different subjects.<\/P><br \/>\n<P>5 &#8211; Protection Assertions, straightforward.<\/P><br \/>\n<P>5-1 <STRONG>Integrity<\/STRONG>, tells you what to sign. Comes in 2 flavors: <STRONG>SignedParts<\/STRONG>, which can specify parts by qname (body or headers, nothing inside wsse:security), and <STRONG>SignedElements<\/STRONG>, which specify the signee via XPath.<\/P><br \/>\n<P>5-2 <STRONG>Confidentiality<\/STRONG>, with <STRONG>EncryptedParts<\/STRONG> and <STRONG>EncryptedElements<\/STRONG> pretty symmetric to the aboves.<\/P><br \/>\n<P>5-3 <STRONG>RequiredElemnts<\/STRONG>, tells&nbsp;you&nbsp;(via XPath) what must be present in the message <\/P><br \/>\n<P>6 token assertions. Features a complete collection of modern kinds. I&#8217;ll be very quick &amp; cryptic from now on<\/P><br \/>\n<P>6-1-1: <STRONG>TokenInclusion<\/STRONG> property: determines how the token must be included<\/P><br \/>\n<UL><br \/>\n<LI><STRONG>Never<\/STRONG>: the token must not travel, ever.You can use references<br \/>\n<LI><STRONG>Once<\/STRONG>: it must travel the first time the target endpoint is contacted, then no more. useful for spreading session.<br \/>\n<LI><STRONG>AlwaysToRecipient<\/STRONG>: everytime the initiator sends a message, the token must appear; everytime the recipient sends a message back, it must not<br \/>\n<LI><STRONG>Always<\/STRONG>: !(Never)<\/LI><\/UL><br \/>\n<P>6-2 <STRONG>Derived Keys<\/STRONG> property: indicates if it is mandated what is explained in ws-SecureConversation spec.<\/P><br \/>\n<P>6-3-1 <STRONG>UsernameToken<\/STRONG><BR>U can speciffy the ut profile version (10,11). Usual worning about cryptographic weakness.<\/P><br \/>\n<P>6-3-2 <STRONG>IssuedToken<\/STRONG><BR>Interesting!&nbsp;A token issued as described in ws-trust. Subassertions:<\/P><br \/>\n<UL><br \/>\n<LI>Issuer (an EP)<br \/>\n<LI>RequestSecurityTokenTemplate<br \/>\n<LI>RequireDerivedKeys<br \/>\n<LI>RequireInternalRef<br \/>\n<LI>&nbsp;RequireExternalRef<\/LI><\/UL><br \/>\n<P>633 <STRONG>X509Token<\/STRONG><BR>Standard X509 token. Usual properties, distinction per profile level<\/P><br \/>\n<P>Includeserial,keyid,thumbprint, X509 token profile props<\/P><br \/>\n<P>634 <STRONG>KerberosToken<\/STRONG><BR>Include, derived, keyid, kerberos profile<\/P><br \/>\n<P>635 <STRONG>SpnegoContextToken<\/STRONG> (n-leg ws-trust)<BR>Include, issuer, derivedkeys<\/P><br \/>\n<P>636 <STRONG>SecurityContextToken<\/STRONG> <\/P><br \/>\n<P>Assumes you already have one SCT; otherwise you need SecureConversationToken (below) or IssuedToken<BR>Ws-sc<BR>Include,derived, requireexternalurireference,sc10seccontexttoken<\/P><br \/>\n<P>637 <STRONG>SecureConversationToken<\/STRONG><BR>If it describes full cycle (issue+usage) of SCT, there&#8217;s the need for 2 policies: Bootstrap and Outer<BR>Include, issuer (if different from target), derived, externaluri<\/P><br \/>\n<P>638 <STRONG>SamlToken<\/STRONG> (assumes u already have one)<BR>Include, derivedm, samlvers(10,11,20)+profvers(10,11)<\/P><br \/>\n<P>639 <STRONG>RelToken<\/STRONG><BR>Include,requirederived, requirekeyidrf, relver (10,20)+profvers (10,11)<\/P><br \/>\n<P>6310 <STRONG>HttpsToken<\/STRONG><\/P><br \/>\n<P>Indicates use of HTTPS. Can specify if the client certificate is mandatory<BR><\/P><br \/>\n<P>7 Security Bindings Properties<\/P><br \/>\n<P>Like variables in code, properties are assigned according to the content of the corresponding assertions. it seems that all together they are the state of the policy. quick descriptions<\/P><br \/>\n<P>71 algorithm suite, kind of algorithm used (DES and similar)<BR>72 timestamp<BR>73 protection order (encryptbeforesigning, signbeforeencrypting)<BR>74 Signature protection (signature has to be encrypted)<BR>75 tokenprotection (token has to be included in the signature)<BR>76 entire header and body signature (most patrs have to be signed)<BR>77 SecurityHeaderLayout (how wsse:security elements order is affected by the policy) <\/P><br \/>\n<UL><br \/>\n<LI><STRONG>Strict<\/STRONG>, everything must be declared before being used (a signing token appears before the signature, signed elements in wsse:security must appear before their signature, etc)<br \/>\n<LI><STRONG>Lax<\/STRONG> doesn&#8217;t matter<br \/>\n<LI><STRONG>LaxTimestampFirst<\/STRONG> doesn&#8217;t matter, but Timestam as first thing<br \/>\n<LI>&nbsp;<STRONG>LaxTimestampLast<\/STRONG> doesn&#8217;t matter, but Timestam as&nbsp;last thing<\/LI><\/UL><br \/>\n<P>8 securitybinding assertions<\/P><br \/>\n<P>how properties are mapped into assertions<BR>81 <STRONG>AlgorithmSuite<\/STRONG> sp:<STRONG>Basic128<\/STRONG>, sp:<STRONG>TripleDes<\/STRONG>, etc etc<BR>82 <STRONG>Layout<\/STRONG> sp:<STRONG>Strict<\/STRONG>,\u2026 <STRONG>LaxTsFist<\/STRONG>,\u2026<BR><\/P><br \/>\n<P>83 TransportBinding <\/P><br \/>\n<P>This is the first security binding we meet. No WSS requested. It has the following subassertions:<BR>Transporttoken, Algorithmsuite, Layout, includetimestamp<\/P><br \/>\n<P>84 SymmetricBinding<\/P><br \/>\n<P>Assumes symmetric interaction between initiator and recipient. And the use of WSS, of course.<BR>Can have EncryptionToken and&nbsp;SignatureToken, OR ProtectionToken (used for both encryption and signing). The two sides of the OR cannot mix. If the messages go back and forth, the above directives will be honored also from ecipient to intiator (SignatureToken will sign both requeste and replies). Subassertions:<BR>Algosuite, layout, includets, encryptbeforesign, protectstoken, onlysignentireheadersandbody<\/P><br \/>\n<P>85 AsymmetricBinding<\/P><br \/>\n<P>Assumes asymmetrical communication. And WSS.<BR><STRONG>InitiatorToken<\/STRONG> is used for signing initiator-&gt;recipient and encrypting recipient-&gt;initiator, <STRONG>RecipientToken <\/STRONG>is specular. Subassertions:<BR>&nbsp;algosuite, layout, includets, encbeforesign, protrctstoken, onlysignentireheadersandbody<\/P><br \/>\n<P>9 Supporting Tokens assertions<\/P><br \/>\n<P>Those tokens are not the ones which determines the kind of security binding, yet they are present in the message and they often perform an active role. 4 kinds.<\/P><br \/>\n<P>91 <STRONG>SupportingTokens<\/STRONG> simply appear in wsse:security. They can sign and encrypt different parts. Subassertions:<BR>Token assertion, Algosuite, SignedParts\/Elements,encparts\/els<\/P><br \/>\n<P>92 <STRONG>SignedSupportingTokens<\/STRONG>, as the above but they are included in the main signature (the one of the security binding level)<\/P><br \/>\n<P>93 <STRONG>EndorsingSupportingTokens<\/STRONG>, they sign the main signature<\/P><br \/>\n<P>94 <STRONG>SignedEndorsingSupportingTokens<\/STRONG>. The two tokens sign each other (92+93)<\/P><br \/>\n<P>10: wss options<\/P><br \/>\n<P>Those are options of the WSS standard,can&#8217;t really dig them at this hour of the night \ud83d\ude42 two main&nbsp; flavor: Wss10, Wss11. They decide the version of WSS to which they refer to, and they contains the options in form of subassertions. For example a property may decide if the refcipien must be able to understand embedded tokens, or references made by serial number.<\/P><br \/>\n<P>11: ws-trust options<\/P><br \/>\n<P>Same as above, but for WS-Trust. Trust10 is the container of MustSupportClientchallenge, Server challenge, Client entropy, Server entropy, IssuedToken&#8230;<\/P><br \/>\n<P><BR>&nbsp;<\/P><\/p>\n<div style=\"clear:both\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>WS-SecurityPolicy is a very interesting specification. It really shows that it incorporated the feedback of people which actually used WS-Security: it address historical concerns like the order of operations, the&nbsp;role of the tokens (initiator rather than recipient), the protection of elements of the wsse:security header&#8230; hey, it even acknowledges that sometimes the security&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[61],"tags":[],"class_list":["post-753","post","type-post","status-publish","format-standard","hentry","category-architecture-ws"],"_links":{"self":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":1850,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/753\/revisions\/1850"}],"wp:attachment":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/media?parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/categories?post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/tags?post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}