SAML 2.0 中的可审计性

Auditability in SAML 2.0

SAML 2.0 是否能够存储所有访问我的 API-REST 的用户,这样我就可以跟踪进入我的 API 的人? 例如,如果我想知道昨天谁访问了我的 Api。

SAML 只是您的用户信息到达的格式。例如使用 the examples,以下是用户在 SAML 中的表示方式:

<saml:AttributeStatement>
      <saml:Attribute Name="uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">test</saml:AttributeValue>
      </saml:Attribute>
      <saml:Attribute Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">test@example.com</saml:AttributeValue>
      </saml:Attribute>
      <saml:Attribute Name="eduPersonAffiliation" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml:AttributeValue xsi:type="xs:string">users</saml:AttributeValue>
        <saml:AttributeValue xsi:type="xs:string">examplerole1</saml:AttributeValue>
      </saml:Attribute>
    </saml:AttributeStatement>

uid 属性将是他们的用户名以及他们在 mail 属性中的电子邮件地址。 eduPersonAffiliation 说明他们与组织的关系。在这种情况下,他们是在自己的组织中具有 examplerole1 角色的用户。

SAML 除了将其发送给您的 API 外,不会记录此内容。您可以提取这些属性并从中创建您自己的审计系统。

很多 SAML 身份提供者 (IdP) 发布 eduPerson 属性。最新架构是 here.