# Okta + AWS - Cloudtrail

**URL:** <https://devforum.okta.com/t/okta-aws-cloudtrail/22248>\
**Category:** Questions\
**Created:** [October 25, 2022, 3:24pm UTC](https://devforum.okta.com/t/okta-aws-cloudtrail/22248 "2022-10-25T15:24:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agusvdino](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@agusvdino](https://devforum.okta.com/u/agusvdino)\
**Post date:** [October 25, 2022, 3:24pm UTC](https://devforum.okta.com/t/okta-aws-cloudtrail/22248/1 "2022-10-25T15:24:15Z")

</div>

Hey everyone! I need to set up some way to enable logging in cloudtrail for Okta users. Basically some way that an okta user can assume an aws role transparently.  
To clarify with a use case:

> Jane Doe logs in to Okta dashboard and chooses XApp that was programmed by me. This app is a simple React SPA. Jane then gets redirected to [xapp.xdomain.com](http://xapp.xdomain.com) where she can upload txt files that go to a lambda and then get deposited on an s3 bucket. This triggers another lambda that processes the first files and creates csv files with results, which get deposited on a second s3 bucket that gets listed on XApp.

Right now this gets done thanks to a user created for our serverless backend, but we want a way to log everything an Okta user does without having to put a bunch of `console.log("user X did Y")` everywhere. We’ve been racking our heads a lot and trying different stuff until we stumbled across [this link](https://saml-doc.okta.com/SAML_Docs/How-to-Configure-SAML-2.0-for-Amazon-Web-Service.html) which looked promising but couldn’t make it work. We don’t even know if this is what we need.  
What we need (or we think we need) is a way to assume a role into an AWS account from an okta user so that every action gets logged into cloudtrail without needing any “manual” logging.  
Is there a way to do this?  
We think that [AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) can be the answer but we haven’t found information on how to achieve it.  
Thanks everyone for any information you can provide 🙂

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 10:15pm UTC](https://devforum.okta.com/t/okta-aws-cloudtrail/22248/2 "2024-02-12T22:15:23Z")

</div>


