Safeguard
Security Guides•

How do you see what your CI role did in CloudTrail?

Trace a CI pipeline in AWS CloudTrail: find the web identity role assumption, follow the session name and review the actions. Includes what is not logged.

Safeguard Security Team
4 min read

Start with the AssumeRoleWithWebIdentity event, which records the role your pipeline assumed. Then filter later events by the role session, which carries the name you set in the workflow. CloudTrail logs the calls, but some things, like PassRole, appear only indirectly.

What CloudTrail records for CI

AWS documents that CloudTrail logs all authenticated API requests to IAM and STS. It also logs the unauthenticated STS calls AssumeRoleWithSAML and AssumeRoleWithWebIdentity, including information provided by the identity provider. The web identity call is the one your OIDC based pipeline makes.

Without a trail, you can still view recent events in the CloudTrail console event history. For a lasting record, create a trail that delivers to a storage bucket. Plan for that before you need it, because investigations start from the log.

Steps to trace one pipeline run

  1. Note the time of the run and the role session name. Setting a clear role-session-name in the workflow, such as the run ID, makes this easy.
  2. In event history or your log search, find events with the event name AssumeRoleWithWebIdentity around that time.
  3. Open the event and read the role ARN, the provider, the audience and the subject from the web identity token.
  4. Note the assumed role session ARN in the response. It ends with your session name.
  5. Search for other events whose user identity is that assumed role session.
  6. Read them in order: what was listed, what was created, what was deleted.

AWS notes the logged information lets you map calls made by an OIDC federated principal with an assumed role back to the originating external caller. For a role used by an AWS user, the subsequent calls show the role identity only and not the person, so the session name carries more weight than you might expect.

Useful fields

FieldWhy you want it
eventNameWhat was called
userIdentity session issuerWhich role the session belongs to
roleSessionName in the requestYour pipeline run label
sourceIPAddressWhere the call came from
additionalEventDataFor web identity, how AWS verified the provider connection

What you will not see

Two limits come from AWS's documentation. CloudTrail does not log denied STS requests in the target account for cross account role assumptions. And some unauthenticated STS requests might not be logged if they are not valid enough to be trusted as a legitimate request. So a failing trust policy may leave less evidence than you expect, and you may need to look at the calling side for the failure.

PassRole is also not an API call, so no event exists for it. Read the event that created or changed the resource instead.

For object level storage activity, such as reads and writes of individual files, you need data events enabled on the trail. AWS's S3 guidance describes data events as records of operations performed on or within a resource, and notes they are opt in when you create a trail.

Make it routine

Write down two or three queries your team reuses: new roles created by the CI role, deletions of storage objects, and policy changes. Review them after a pipeline change and after any incident. Keep logs in a separate account if you can, so a compromised workload account cannot erase them.

Try it yourself

Audit trails are also compliance evidence. The framework mapping demo shows how a control and its supporting evidence line up.

Click through it at your own pace, or open it full screen.

Quick check

Which CloudTrail event shows a CI role assumption via OIDC?

AssumeRoleWithWebIdentity. AWS says CloudTrail logs it along with information from the identity provider.

Do I need a trail, or is event history enough?

Event history shows recent events. A trail gives a lasting record delivered to a bucket, which you want for investigations and evidence.

Safeguard does not manage your cloud accounts. It scans your code and dependencies, applies pull request policies and gates, and automates compliance evidence. Free scan: gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.