Differenze tra le versioni di "SAML-Subject-ID-Attribute"

Da WIKI IDEM GARR.
Jump to navigation Jump to search
Riga 18: Riga 18:
 
*<nowiki>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</nowiki>
 
*<nowiki>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</nowiki>
  
L'impiego di Email Address come identificatore è altamente sconsigliato/vietato (https://spaces.at.internet2.edu/display/federation/why-is-email-not-an-appropriate-user-identifier).
+
L'impiego di Email Address come identificatore è vietato nella nostra Federazione (https://spaces.at.internet2.edu/display/federation/why-is-email-not-an-appropriate-user-identifier).
  
 
===Definizione di SAML Subject-ID===
 
===Definizione di SAML Subject-ID===
Riga 32: Riga 32:
 
(https://wiki.oasis-open.org/security/SAMLSubjectIDAttr)<br />L'attributo è destinato a sostituire identificatori legacy come eduPersonTargetedID e SAML 2.0 persistent NameID.
 
(https://wiki.oasis-open.org/security/SAMLSubjectIDAttr)<br />L'attributo è destinato a sostituire identificatori legacy come eduPersonTargetedID e SAML 2.0 persistent NameID.
  
=== Approfondimento: Perché è necessario adottare i nuovi Subject Identifiers? ===
+
===Approfondimento: Perché è necessario adottare i nuovi Subject Identifiers?===
 
Spiegazione
 
Spiegazione
  

Versione delle 18:30, 21 ago 2023

Subject Identifiers nella Federazione IDEM

Dal 2019 con la pubblicazione del documento [SAML-SubjectID-v1.0] "SAML V2.0 Subject Identifier Attributes Profile Version 1.0" sono stati standardizzati due nuovi attributi SAML per l'identificazione dei soggetti di sicurezza, con lo scopo di risolvere molti dei problemi legati ai precedenti Subject Identifier.

I nuovi standard sono:

  • urn:oasis:names:tc:SAML:attribute:subject-id
  • urn:oasis:names:tc:SAML:attribute:pairwise-id

Quelli che finora sono stati impiegati nella nostra Federazione sono i seguenti (provenienti dallo schema eduPerson):

  • eduPersonTargetedID (attributo deprecato normalmente valorizzato con urn:oasis:names:tc:SAML:2.0:nameid-format:persistent)
  • eduPersonPrincipalName
  • eduPersonUniqueID

Oltre all'impiego di attributi è in uso nella nostra Federazione il rilascio dei Name Identifiers nel subject dell'asserzione SAML:

  • urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
  • urn:oasis:names:tc:SAML:2.0:nameid-format:transient

L'impiego di Email Address come identificatore è vietato nella nostra Federazione (https://spaces.at.internet2.edu/display/federation/why-is-email-not-an-appropriate-user-identifier).

Definizione di SAML Subject-ID

A scoped, opaque, not reassignable, non-targeted pseudonym for a subject (person) – consultare Name Identifiers per chiarimenti sulla terminologia.

(https://wiki.oasis-open.org/security/SAMLSubjectIDAttr)

L'attributo è destinato a sostituire identificatori legacy come eduPersonUniqueID e possibilmente eduPersonPrincipalName

Definizione di SAML Pairwise-ID

A scoped, opaque, not reassignable, targeted pseudonym for a subject (person) – consultare Name Identifiers per chiarimenti sulla terminologia.

(https://wiki.oasis-open.org/security/SAMLSubjectIDAttr)
L'attributo è destinato a sostituire identificatori legacy come eduPersonTargetedID e SAML 2.0 persistent NameID.

Approfondimento: Perché è necessario adottare i nuovi Subject Identifiers?

Spiegazione

Come segnalare la richiesta di tali attributi da parte di un SP

I Service Provider segnalano la richiesta di ricevere "Subject Id" o "Pairwise Id" attraverso la dichiarazione nei metadata di uno specifico Entity Attribute.

I valori possibili per l'Entity Attribute sono subject-id, pairwise-id, any und none. Nel caso sia specificato any allora l'Identity Provider dovrebbe rilasciare pairwise-id.

Configurazione per supportare i nuovi standard in Shibboleth Idp e Sp

Identity Provider (>=4.0.0)

Per abilitare il supporto ed il rilascio di subject-id e pairwise-id è necessario:

  1. Modificare attribute-resolver.xml
  2. Modificare, se necessario, attribute-filter.xml (la versione di default già contiene le regole di rilascio opportune)
  3. Modificare, se necessario, services.xml

Attribute Resolver

Nel file "attribute-resolver.xml" si deve aggiungere la definizione dei 2 nuovi attributi con:

<!-- Schema: SAML Subject ID attributes -->
 
<AttributeDefinition id="samlPairwiseID" xsi:type="Scoped" scope="%{idp.scope}">
    <InputDataConnector ref="computed" attributeNames="computedId" />
</AttributeDefinition>
 
<AttributeDefinition id="samlSubjectID" xsi:type="Scoped" scope="%{idp.scope}">
    <InputDataConnector ref="myLDAP" attributeNames="%{idp.persistentId.sourceAttribute}" />
</AttributeDefinition>

Attribute Filter

Nel file "attribute-filter.xml", all'interno dell'elemento <AttributeFilterPolicyGroup> deve essere presente la seguente regola:

    <!--
    Example rule for honoring Subject ID requirement tag in metadata.
    The example supplies pairwise-id if subject-id isn't explicitly required.
    -->
    <AttributeFilterPolicy id="subject-identifiers">
        <PolicyRequirementRule xsi:type="ANY" />

        <AttributeRule attributeID="samlPairwiseID">
            <PermitValueRule xsi:type="OR">
                <Rule xsi:type="EntityAttributeExactMatch"
                    attributeName="urn:oasis:names:tc:SAML:profiles:subject-id:req"
                    attributeNameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
                    attributeValue="pairwise-id" />
                <Rule xsi:type="EntityAttributeExactMatch"
                    attributeName="urn:oasis:names:tc:SAML:profiles:subject-id:req"
                    attributeNameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
                    attributeValue="any" />
            </PermitValueRule>
        </AttributeRule>

        <AttributeRule attributeID="samlSubjectID">
            <PermitValueRule xsi:type="EntityAttributeExactMatch"
                attributeName="urn:oasis:names:tc:SAML:profiles:subject-id:req"
                attributeNameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
                attributeValue="subject-id" />
        </AttributeRule>
    </AttributeFilterPolicy>

Services

Nel file services.xml va abilitato l'attribute-filter.xml contenente le regole per il rilascio di subject-id e pairwise-id

<util:list id ="shibboleth.AttributeFilterResources">
   <value>%{idp.home}/conf/attribute-filter.xml</value>
   <ref bean="IdemAttributeFilterFull"/>
</util:list>

Service Provider (>=3.0.0)

Per abilitare il supporto ed l'utilizzo di subject-id e pairwise-id è necessario:

  1. Modificare, se necessario, attribute-policy.xml
  2. Modificare attribute-map.xml
  3. Abilitare la richiesta su IDEM Entity Registry

Attribute Policy

Per richiedere il subject-id e pairwise-id per il proprio SP nel formato corretto:

<AttributeRule attributeID="subject-id">
   <PermitValueRuleReference ref="ScopingRules"/>
</AttributeRule>

<AttributeRule attributeID="pairwise-id">
   <PermitValueRuleReference ref="ScopingRules"/>
</AttributeRule>

Attribute Map

<!-- New standard identifier attributes for SAML. -->

<Attribute name="urn:oasis:names:tc:SAML:attribute:subject-id" id="subject-id">
   <AttributeDecoder xsi:type="ScopedAttributeDecoder" caseSensitive="false"/>
</Attribute>
  
<Attribute name="urn:oasis:names:tc:SAML:attribute:pairwise-id" id="pairwise-id">
   <AttributeDecoder xsi:type="ScopedAttributeDecoder" caseSensitive="false"/>
</Attribute>

IDEM Entity Registry

Configurare il valore del Subject-ID richiesto dalla scheda EntityAttribute di IDEM Entity Registry tenendo in considerazione che selezionando "Any" si riceverà prevalentemente il valore di pairwise-id in quanto più safe di subject-id.

Configurazione per per supportare i nuovi standard in SimpleSAMLphp Idp e Sp

Il supporto ufficiale alla generazione e al rilascio di subject-id e pairwise-id in SimpleSAMLphp arriva ufficialmente dalla v2.0.0.

Nella nuova versione di SimpleSAMLphp sono stati sviluppati 2 nuovi moduli per il loro supporto:

Identity Provider (>=2.0.0)

Gli Identity Provider che sono stati configurati secondo i nostri idem-tutorials per la v2.x sono già in grado di rilasciare subject-id e pairwise-id.

idem-attribute-filter.php da testare: https://gitlab.dir.garr.it/-/snippets/7

Service Provider

TBD

Riferimenti

https://docs.oasis-open.org/security/saml-subject-id-attr/v1.0/saml-subject-id-attr-v1.0.pdf