code for article pfeilbr/iamlive-playground
learn iann0036/iamlive - cli tool to Generate an IAM policy from AWS calls using client-side monitoring (CSM) or embedded proxy
Demo
CSM Mode (Client-side monitoring mode) Example with AWS CLI
# run in CSM mode example and generate policy from aws cli
# can add `--output-file iamlive-policy-output.json` to save generated policy in file
iamlive --set-ini
# run the following in another shell
aws s3 ls s3://com.brianpfeil.scratch01
Proxy Mode Example with AWS CLI
# run in proxy mode example and generate policy from aws cli
iamlive --set-ini --mode proxy
# run the following in another shell
export AWS_CA_BUNDLE=~/.iamlive/ca.pem
export HTTP_PROXY=http://127.0.0.1:10080
export HTTPS_PROXY=http://127.0.0.1:10080
CSM Mode (Client-side monitoring mode) Example with AWS SDK for JavaScript v2
see index.js
# run in CSM mode example and generate policy from aws cli
iamlive --set-ini
# run the following in another shell
# install node deps
npm install
# run nodejs script that uses `aws-sdk`
node index.js
Twitter • Reddit