Prisma Cloud Compute:SAML Anforderungen und Antworten
11558
Created On 11/18/19 19:32 PM - Last Modified 03/02/23 02:43 AM
Symptom
SAML ist ein offener Standard für den Austausch von Authentifizierungs- und Autorisierungsdaten zwischen Parteien, insbesondere zwischen einem Identitätsanbieter und einem Dienstanbieter.
- ServiceProvider ( SP ) = Twistlock-Konsole UI
- IdentityProvider (IdP) = SiteMinder, ADFS , Okta, AzureAD, PING Federate, Shibboleth usw.
Die SAML Spezifikation finden Sie hier: http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
In diesem Artikel beschreiben wir SAML Beispielauthentifizierungsanforderungen und SAML -antworten und geben ausführlich, worauf sie in jedem zu achten sind. Ziel ist es, eine Richtlinie zur Fehlerbehebung SAML im Zusammenhang mit Twistlock bereitzustellen.
Environment
- Saas
- Selbst gehostet 19.11 oder höher
Resolution
Beispiel SAML authentifizierungsanforderung, die von Twistlock an IdP gesendet wird ADFS
<samlp:AuthnRequest
AssertionConsumerServiceURL="https://console.lab.twistlock.com/api/v1/authenticate"
Destination="https://saml-adfs.ad.lab.twistlock.com/adfs/ls"
ID ="_56f9f278-c1b1-ed6d-ecc8-c3ce057b2a09" IssueInstant="2019-04-15T20:19:12Z"
ProtocolBinding="urn:oasis:names:names:tc: SAML :2.0:bindings: HTTP-POST " Version="2.0"
xmlns:saml="urn:oasis:names:names:tc: SAML :2.0:assertion"
xmlns:samlp="urn:oasis:names:names:tc: SAML :2.0:protocol">
<saml:Issuer>pfox-twistlock</saml:Issuer>
<samlp:RequestedAuthnContext comparison="exact" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc: SAML :2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:federation:authentication:windows</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
AssertionConsumerServiceURL="https://console.lab.twistlock.com/api/v1/authenticate"
Destination="https://saml-adfs.ad.lab.twistlock.com/adfs/ls"
ID ="_56f9f278-c1b1-ed6d-ecc8-c3ce057b2a09" IssueInstant="2019-04-15T20:19:12Z"
ProtocolBinding="urn:oasis:names:names:tc: SAML :2.0:bindings: HTTP-POST " Version="2.0"
xmlns:saml="urn:oasis:names:names:tc: SAML :2.0:assertion"
xmlns:samlp="urn:oasis:names:names:tc: SAML :2.0:protocol">
<saml:Issuer>pfox-twistlock</saml:Issuer>
<samlp:RequestedAuthnContext comparison="exact" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc: SAML :2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:federation:authentication:windows</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
Gesucht in der AuthnRequest
AssertionConsumerServiceURL
AssertionConsumerServiceURL="https://console.twistlock.com/api/v1/authenticate"
Dies ist der Endpunkt, den der IdP verwendet, um den Browser des Benutzers zurück zu Twistlock umzuleiten. Dieser Wert kann in den Einstellungen SAML "> Authentifizierung verwalten > > URL "Konsole" gesteuert werden. Es ist üblich, diesen Wert festzulegen, wenn sich die Twistlock-Konsole hinter einem Proxy wie einem externen OpenShift-Router oder einem Istio Ingress Controllerbefindet. Der Twistlock-Code fügt dem Wert, den Sie in das Feld eingeben, "/api/v1/authenticate" hinzu. Wenn dieser Wert nicht festgelegt ist, generiert der Twistlock-Code diesen Wert automatisch. Dieser Wert muss mit dem Twistlock-Konfigurationsaussteller des IdP übereinstimmen. SP
<saml:Issuer>Konsole-Twistlock</saml:Issuer>
Der Bezeichner der Twistlock-Konsole. Jeder SAML IdP muss über einen eindeutigen Bezeichner für alle SPs verfügen. Standardmäßig sendet Twistlock den Twistlock-Emittenten. Sie können diesen Wert im Audience-Wert in den Einstellungen der Twistlock-Konsole SAML ändern.
AuthnContextClassRef
<samlp:RequestedAuthnContext comparison="exact" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc: SAML :2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:federation:authentication:windows</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc: SAML :2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:federation:authentication:windows</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
Fordert an, dass die Authentifizierungsmethoden beim IdP auftreten. urn:federation:authentication:windows ist für ADFS IdPs, die die integrierte Windows-Authentifizierung unterstützen. Einige Binnenvertriebene wissen nicht, wie diese Werte verarbeitet werden sollen. SiteMinder wird z. B. CA mit einer SAML Antwort von:
<StatusMessage>Die AuthnRequest mit AuthnContexts wird nicht unterstützt!</StatusMessage>
In diesem Fall müssen Sie den SiteMinder-IdP so konfigurieren, dass die AuthnContextClassRef-Werte ignoriert werden.
Beispiel SAML Antwort von ADFS IdP auf Twistlock
<samlp:Response Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified"
Destination="https://console.lab.twistlock.com/api/v1/authenticate"
ID ="_3ac05c43-11b8-4fac-9063-0b0a5f83707f" InResponseTo="_56f9f278-c1b1-ed6d-ecc8-c3ce057b2a09"
IssueInstant="2019-04-15T20:21:59.095Z" Version="2.0"
xmlns:samlp="urn:oasis:names:tc: SAML :2.0:protocol">
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://console.lab.twistlock.com/adfs/services/trust</Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI ="#_3ac05c43-11b8-4fac-9063-0b0a5f83707f">
<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>ppj1biegltD2D701NL9Of+xDctgdChV166ja9E2DqtQ=</ds:DigestValue>
</ds:SignedInfo>
<ds:SignatureValue>Mh9dAnyo2CY0kz+cah8KVwwu7ZSWXO6ubyPOBk7CjD6CVHPfR2OFJ2S3fM695/usCWYud2CwQsdd1DVCDsnnAqifkGZiabHH38bBa9Jdv3YdWs3hoz4nqQbFesdQGV5QjL54Ip19FxFWUAxt4bKpundfP2h8OikRjkoi24QLVzSIcvuH/vkvz/DP7vF6e+YCbzu6BJDPWXf3TzvO6Og1mx4URDw2kycy83CHsB0mMJm3cfvb39DSLlnE6EvR+msUqoTWuLw==</ds:SignatureValue>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate></ds:X509Certificate>
</ds:X509Data>
</KeyInfo>
</ds:Signature>
<samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status>
<Assertion ID ="_d6029da5-a589" IssueInstant="2019-04-15T20:21:59.095Z"
Version="2.0" xmlns="urn:oasis:names:tc: SAML :2.0:assertion">
<Issuer>http://saml-adfs.ad.lab.twistlock.com/adfs/services/trust</Issuer>
<Subject>
<NameID>pfox</NameID>
<SubjectConfirmation method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <SubjectConfirmationData InResponseTo="_56f9f278-c1b1-ed6d-ecc8-c3ce057b2a09"
NotOnOrAfter="2019-04-15T20:26:59.095Z"
Recipient="https://console.lab.twistlock.com/api/v1/authenticate"/></SubjectConfirmation>
</Subject>
<Conditions notbefore="2019-04-15T20:21:59.095Z" notonorafter="2019-04-15T21:21:59.095Z">
<AudienceRestriction>
<Audience>console-twistlock</Audience>
</AudienceRestriction>
</Conditions>
<AttributeStatement>
<Attribute name="groups">
<AttributeValue>Domain Admins</AttributeValue>
<AttributeValue>Domain Users</AttributeValue>
<AttributeValue>TLAdmins</AttributeValue>
</Attribute>
</AttributeStatement>
<AuthnStatement AuthnInstant="2019-04-15T20:21:59.032Z"
SessionIndex="_d6029da5-a589-4559-beaf-b734f45fd452">
<AuthnContext>
<AuthnContextClassRef>urn:oasis:names:tc: SAML :2.0:ac:classes: PasswordProtectedTransport</AuthnContextClassRef>
</AuthnContext>
Destination="https://console.lab.twistlock.com/api/v1/authenticate"
ID ="_3ac05c43-11b8-4fac-9063-0b0a5f83707f" InResponseTo="_56f9f278-c1b1-ed6d-ecc8-c3ce057b2a09"
IssueInstant="2019-04-15T20:21:59.095Z" Version="2.0"
xmlns:samlp="urn:oasis:names:tc: SAML :2.0:protocol">
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://console.lab.twistlock.com/adfs/services/trust</Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI ="#_3ac05c43-11b8-4fac-9063-0b0a5f83707f">
<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>ppj1biegltD2D701NL9Of+xDctgdChV166ja9E2DqtQ=</ds:DigestValue>
</ds:SignedInfo>
<ds:SignatureValue>Mh9dAnyo2CY0kz+cah8KVwwu7ZSWXO6ubyPOBk7CjD6CVHPfR2OFJ2S3fM695/usCWYud2CwQsdd1DVCDsnnAqifkGZiabHH38bBa9Jdv3YdWs3hoz4nqQbFesdQGV5QjL54Ip19FxFWUAxt4bKpundfP2h8OikRjkoi24QLVzSIcvuH/vkvz/DP7vF6e+YCbzu6BJDPWXf3TzvO6Og1mx4URDw2kycy83CHsB0mMJm3cfvb39DSLlnE6EvR+msUqoTWuLw==</ds:SignatureValue>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate></ds:X509Certificate>
</ds:X509Data>
</KeyInfo>
</ds:Signature>
<samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status>
<Assertion ID ="_d6029da5-a589" IssueInstant="2019-04-15T20:21:59.095Z"
Version="2.0" xmlns="urn:oasis:names:tc: SAML :2.0:assertion">
<Issuer>http://saml-adfs.ad.lab.twistlock.com/adfs/services/trust</Issuer>
<Subject>
<NameID>pfox</NameID>
<SubjectConfirmation method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <SubjectConfirmationData InResponseTo="_56f9f278-c1b1-ed6d-ecc8-c3ce057b2a09"
NotOnOrAfter="2019-04-15T20:26:59.095Z"
Recipient="https://console.lab.twistlock.com/api/v1/authenticate"/></SubjectConfirmation>
</Subject>
<Conditions notbefore="2019-04-15T20:21:59.095Z" notonorafter="2019-04-15T21:21:59.095Z">
<AudienceRestriction>
<Audience>console-twistlock</Audience>
</AudienceRestriction>
</Conditions>
<AttributeStatement>
<Attribute name="groups">
<AttributeValue>Domain Admins</AttributeValue>
<AttributeValue>Domain Users</AttributeValue>
<AttributeValue>TLAdmins</AttributeValue>
</Attribute>
</AttributeStatement>
<AuthnStatement AuthnInstant="2019-04-15T20:21:59.032Z"
SessionIndex="_d6029da5-a589-4559-beaf-b734f45fd452">
<AuthnContext>
<AuthnContextClassRef>urn:oasis:names:tc: SAML :2.0:ac:classes: PasswordProtectedTransport</AuthnContextClassRef>
</AuthnContext>
Dinge, die Sie im Response Issuer suchen
sollten
<Issuer>http://saml-adfs.ad.lab.twistlock.com/adfs/services/trust</Issuer>
Der Ausstellerwert des Antworttokens stimmt mit dem Identitätsanbieter-Ausstellerwert in den SAML Einstellungen für den ADFS IdP
ds:Signature
das Antworttoken überein, SAML das Antworttoken muss entweder signierte Antwort oder signierte Antwort + Assertion sein Das Signaturzertifikat des IdP muss im Feld X.509 Certificate im Base64-Format in die Twistlock-Einstellungen für den IdP geladen werden.
Gruppen
<AttributeStatement>
<Attribute name="groups">
<AttributeValue>Domänen-Admins</AttributeValue>
<AttributeValue>Domänenbenutzer</AttributeValue>
<AttributeValue>TLAdmins</AttributeValue>
</Attribute>
</AttributeStatement>
<Attribute name="groups">
<AttributeValue>Domänen-Admins</AttributeValue>
<AttributeValue>Domänenbenutzer</AttributeValue>
<AttributeValue>TLAdmins</AttributeValue>
</Attribute>
</AttributeStatement>
Die Gruppenzuordnung erfordert, dass das SAML Token den Gruppenanspruch enthalten muss. Dies kann ein Array von Gruppennamen enthalten und werden mit den SAML in > verwalten > Gruppendefinierten Gruppen verglichen. Dies erfordert möglicherweise einen benutzerdefinierten Anspruch.
NameID
<Subject>
<NameID>pfox</NameID>
<SubjectConfirmation method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <SubjectConfirmationData InResponseTo="_56f9f278-c1b1-ed6d"
NotonorAfter="2019-04-15T20:26:59.095Z"
Recipient="https://console.lab.twistlock.com/api/v1/authenticate"/></SubjectConfirmation>
</Subject>
<NameID>pfox</NameID>
<SubjectConfirmation method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <SubjectConfirmationData InResponseTo="_56f9f278-c1b1-ed6d"
NotonorAfter="2019-04-15T20:26:59.095Z"
Recipient="https://console.lab.twistlock.com/api/v1/authenticate"/></SubjectConfirmation>
</Subject>
Das nameid-Attribut muss vorhanden sein und mit einem Twistlock-Benutzernamen SAML übereinstimmen, wenn keine Gruppenzuordnung verwendet wird.