Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Last active February 20, 2020 22:10
Show Gist options
  • Save kmcquade/a809fff851371ffffe7bdb70bf5e1965 to your computer and use it in GitHub Desktop.
Save kmcquade/a809fff851371ffffe7bdb70bf5e1965 to your computer and use it in GitHub Desktop.
{
"UserDetailList": [
{
"Path": "/",
"UserName": "obama",
"UserId": "YAAAAASSQUEEEN",
"Arn": "arn:aws:iam::012345678901:user/obama",
"CreateDate": "2019-12-18 19:10:08+00:00",
"GroupList": [
"admin"
],
"AttachedManagedPolicies": [],
"Tags": []
}
],
"GroupDetailList": [
{
"Path": "/",
"GroupName": "admin",
"GroupId": "YAAAAASSQUEEEN",
"Arn": "arn:aws:iam::012345678901:group/admin",
"CreateDate": "2017-05-15 17:33:36+00:00",
"GroupPolicyList": [],
"AttachedManagedPolicies": [
{
"PolicyName": "AdministratorAccess",
"PolicyArn": "arn:aws:iam::aws:policy/AdministratorAccess"
}
]
}
],
"RoleDetailList": [
{
"Path": "/",
"RoleName": "MyRole",
"RoleId": "YAAAAASSQUEEEN",
"Arn": "arn:aws:iam::012345678901:role/MyRole",
"CreateDate": "2019-08-16 17:27:59+00:00",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ssm.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"InstanceProfileList": [],
"RolePolicyList": [
{
"PolicyName": "SsmOnboardingInlinePolicy",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:Put*",
"s3:Get*",
"s3:*MultipartUpload*"
],
"Resource": "*"
}
]
}
}
],
"AttachedManagedPolicies": [],
"Tags": [],
"RoleLastUsed": {}
},
{
"Path": "/",
"RoleName": "MyOtherRole",
"RoleId": "YAAAAASSQUEEEN",
"Arn": "arn:aws:iam::012345678901:role/MyOtherRole",
"CreateDate": "2019-08-16 17:27:59+00:00",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ssm.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"InstanceProfileList": [],
"RolePolicyList": [
{
"PolicyName": "SupYo",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:Put*",
"s3:Get*",
"s3:*MultipartUpload*"
],
"Resource": "*"
}
]
}
}
],
"AttachedManagedPolicies": [],
"Tags": [],
"RoleLastUsed": {}
}
],
"Policies": [
{
"PolicyName": "NotYourPolicy",
"PolicyId": "YAAAAASSQUEEEN",
"Arn": "arn:aws:iam::012345678901:policy/NotYourPolicy",
"Path": "/",
"DefaultVersionId": "v9",
"AttachmentCount": 1,
"PermissionsBoundaryUsageCount": 0,
"IsAttachable": true,
"CreateDate": "2020-01-29 21:24:20+00:00",
"UpdateDate": "2020-01-29 23:23:12+00:00",
"PolicyVersionList": [
{
"Document": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:Put*",
"s3:Get*",
"s3:*MultipartUpload*"
],
"Resource": [
"arn:aws:s3:::mybucket/*",
"arn:aws:s3:::mybucket"
]
}
]
},
"VersionId": "v9",
"IsDefaultVersion": true,
"CreateDate": "2020-01-29 23:23:12+00:00"
}
]
}
]
}
@kmcquade
Copy link
Author

kmcquade commented Feb 20, 2020

Command:

parliament --auth-details-file example-get-account-authorization-details.json

Response:

Traceback (most recent call last):
  File "/Users/kmcquade/Library/Python/3.7/bin/parliament", line 8, in <module>
    sys.exit(main())
  File "/Users/kmcquade/Library/Python/3.7/lib/python/site-packages/parliament/cli.py", line 180, in main
    json.dumps(version["Document"]), role["Arn"], private_auditors_custom_path=args.private_auditors
UnboundLocalError: local variable 'version' referenced before assignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment