Identity
When something happens in your cloud environment (a resource is created, a policy is changed, a login occurs), Guardrails maps that event back to a specific actor. This mapping is what Guardrails calls identity resolution, and it's fundamental to accountability and audit.
Core Concepts
Identity
An Identity is the Guardrails entity responsible for an action. It can be:
- A Guardrails Profile, a user who can sign in to Guardrails.
- A cloud resource, for example, an AWS Account (for root-level activities) or an EC2 Instance.
- Turbot, the Guardrails system itself, when it performs automated actions.
- Unidentified, when Guardrails can't map the event to a known entity.
Persona
A Persona is a physical representation of an identity in a specific scope. A single identity (one person) may have multiple personas across different cloud providers. For example, John might have an AWS IAM User, an Azure AD user, and a GCP user, three personas, one identity.
Alternate Persona
When the security principal in an event can't be found in the Guardrails CMDB, the Alternate Persona provides a string representation of the actor in the native format from the event source. This ensures some identifying information is always available, even when full identity resolution fails.
[!IMPORTANT] Events are mapped at the time they're received. If Guardrails can't resolve the identity at that moment (because the user hasn't been mapped yet, or the resource hasn't been discovered), the event remains unidentified. Events are never retroactively updated with actor information. However, the alternate persona always contains identifying information from the original event.
AWS Identity Resolution
For AWS, identity information comes from CloudTrail's userIdentity element. Guardrails resolves six AWS identity types:
Root
Events from the AWS account's root credentials. The identity maps to the AWS Account resource itself. If the account has an alias, it appears as the userName.
IAM User
Events from an IAM user's credentials. Guardrails performs a reverse lookup of the userName against the AWS > IAM > Login User Names policy to find the matching Guardrails Profile. The persona is the AWS IAM User resource.
Assumed Role
Events from temporary credentials obtained via STS AssumeRole. Guardrails handles these differently depending on who assumed the role:
- Guardrails service roles (AWS/Superuser, AWS/Admin, etc.) encode a token in the session name containing the Guardrails Profile ID. This token is encrypted with a secret and valid for 1 hour, allowing reliable identity resolution.
- Non-Guardrails roles are mapped via reverse lookup of the role session ID against the
AWS > IAM > Login User Namespolicy. This is less secure because anyone who can assume the role can set the session name.
Federated User
Events from temporary credentials obtained via STS GetFederationToken. The identity is resolved through a reverse lookup of the session issuer's userName.
AWS Account
Events from cross-account role assumption, where another AWS account switches into a role. The identity maps to the originating AWS Account resource.
AWS Service
Events from AWS service accounts assuming roles (e.g., CloudFormation, Lambda). The identity is the invoking service. Since these are automated, the identity typically maps to the service name string.
Identity Mapping Summary
| AWS Type | Identity | Persona | Alt Persona |
|---|---|---|---|
| Root | AWS Account resource | N/A | ARN |
| IAM User | Guardrails Profile (via login name lookup) | AWS IAM User resource | userName |
| Assumed Role | Guardrails Profile (via token or login name) | Resource matching ARN | Role session info |
| Federated User | Guardrails Profile (via session issuer lookup) | Resource matching ARN | Session issuer userName |
| AWS Account | AWS Account resource | Resource matching role ARN | Recipient account ID |
| AWS Service | N/A | N/A | Invoking service |
Login Name Policies
The identity resolution process depends on Login Name policies that map Guardrails profiles to their cloud provider identities. Each provider has its own policy:
AWS > IAM > Login User NamesAzure > IAM > Login NamesGCP > IAM > Login Names
These policies use calculated policies with GraphQL input queries and Nunjucks templates to dynamically map profile emails to cloud-specific identifiers. For example, mapping a Google profile email [email protected] to an Azure UPN [email protected].
[!NOTE] The cloud provider audit trail should always be considered the authoritative data of record. Guardrails identity mapping is a best-effort correlation that depends on correct Login Name policy configuration and timely event processing.
Common Use Cases
-
When auditing user activity -- Check the Activity tab on any account or resource to see who made changes. Events with resolved identities show the Guardrails profile name; unresolved events show the alternate persona string.
-
When setting up identity mapping -- Configure the appropriate Login Name policies with calculated policies that map your Guardrails profiles to their cloud provider identities. This ensures events from those identities are correctly attributed.
-
When investigating unidentified events -- Check the alternate persona field for the native identity string, then verify that the corresponding Login Name policy correctly maps that identity to a Guardrails profile.
Next Steps
- Permissions: Understand the permission model that controls what identified users can do.
- Directories: Configure authentication sources that create the profiles used in identity mapping.
- Advanced IAM: Enterprise strategies including API auditing and identity tracking.