cyberark-aws-auto-onboarding
cyberark-aws-auto-onboarding copied to clipboard
Elasticity Lambda fails to onboard Windows EC2 instances on a secondary AWS account.
Summary
Windows instances created on a second AWS account (using execution/assume roles) fails to be onboarded.
The function instance_processing::get_instance_password_data
is unable to use the assume role provided because of a typo error.
The key in acct_b['Credentials']
should be SessionToken
, not session_token
:
https://github.com/cyberark/cyberark-aws-auto-onboarding/blob/674908ca4304f9ead5451fec078fbc93189a3910/src/shared_libraries/instance_processing.py#L57
Steps to Reproduce
Steps to reproduce the behavior:
- Create a Windows EC2 instance on account B
- Wait for the instance to be running
- Check the ElasticityLambda logs on CloudWatch on account A
Expected Results
The Administrator account of the EC2 instance appears in the PVWA.
Actual Results (including error logs, if applicable)
You should see the following error in the Elasticity Lambda's logs:
[ERROR] {<class 'KeyError'>}
[ERROR] Error on getting token from account XXXXXXXXXXXX : 'session_token'
Reproducible
- [x] Always
- [ ] Sometimes
- [ ] Non-Reproducible
Version/Tag number
cyberark/cyberark-aws-auto-onboarding:master
Environment setup
- Elasticity Lambda in an AWS account A.
- Windows EC2 instance created in an AWS account B.