Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not showing permissions for most roles #225

Open
jonnieb007 opened this issue Jul 4, 2019 · 9 comments
Open

Not showing permissions for most roles #225

jonnieb007 opened this issue Jul 4, 2019 · 9 comments

Comments

@jonnieb007
Copy link

When I do

repokid display_role_cache 1234567890

I have several roles but most are showing 0 permissions including AardvarkRepokid (two roles show some permissions one has 5 and another OrganizationAccountAccessRole has 5110)

When I do

repokid find_roles_with_permissions "sts:assumerole" --output=myroles.json
Loaded config from /srv/dev/repokid-master/config.json
2019-07-04 08:34:24,931 INFO: ARN arn:aws:iam::01234567890:role/OrganizationAccountAccessRole has ['sts:assumerole'] [in /srv/dev/repokid-master/repokid/cli/repokid_cli.py:518]
INFO:repokid:ARN arn:aws:iam::01234567890:role/OrganizationAccountAccessRole has ['sts:assumerole']

It only shows one role OrganizationAccountAccessRole with sts:assumerole

When I do
curl localhost:5000/api/1/advisors?phrase=AardvarkRepokid

It returns

{"lastAuthenticated":1562226360000,"lastAuthenticatedEntity":"arn:aws:iam::01234567890:role/AardvarkRepokid","lastUpdated":"Thu, 04 Jul 2019 08:31:17 GMT","serviceName":"AWS Security Token Service","serviceNamespace":"sts","totalAuthenticatedEntities":1}],"arn:aws:iam::01234567890:role/AardvarkRepokid":

And when I do it via AWS Access Advisor API

aws iam generate-service-last-accessed-details --arn arn:aws:iam::1234567890:role/AardvarkRepoKid

aws iam get-service-last-accessed-details --job-id 20b5dded-9aaa-0a64-038b-8f35b330fdf6 >> Aardvark.json

{
"LastAuthenticated": "2019-07-03T07:21:00Z",
"LastAuthenticatedEntity": "arn:aws:iam::01234567890:role/AardvarkRepokid",
"ServiceNamespace": "sts",
"ServiceName": "AWS Security Token Service",
"TotalAuthenticatedEntities": 1
}

Why is repokid not processing the information correctly from aardvark?

@jonnieb007
Copy link
Author

Found the issue is that it only does in-line policies which AWS don't recommend - found another ticket that relates #33

@jonnieb007
Copy link
Author

Found the issue is that it only does in-line policies which AWS don't recommend - found another ticket that relates #33, it would be useful to have this clear in the documentation

@curtis-turner
Copy link

curtis-turner commented Jul 7, 2019

@jonnieb007 I had this same revelation the other day when working with Repokid/Aadvark but I believe it does state that it only works on inline policies at the very top of the Readme.

Repokid uses Access Advisor provided by Aardvark to remove permissions granting access to unused services from the inline policies of IAM roles in an AWS account. - from the README

@mcpeak
Copy link
Contributor

mcpeak commented Aug 15, 2019

@jonnieb007 why does AWS not recommend inline policies? I believe managed policies are typically for cases where you want to attach the same policy to multiple principals in the same account.

@jonnieb007
Copy link
Author

See https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#choosing-managed-or-inline "we recommend that you use managed policies instead of inline policies." We have moved to managed, could Repokid support managed polices?

@jonnieb007 jonnieb007 reopened this Aug 19, 2019
@mcpeak
Copy link
Contributor

mcpeak commented Aug 19, 2019

Yes, I believe many others are interested in supporting managed policies for Repokid right now. This is not technically difficult with Repokid's architecture. If you are interested in picking this up I'm happy to help.

@curtis-turner
Copy link

I’d be willing to work on this but wouldn’t mind a hand and getting started.

@premature-optimization
Copy link

@curtis-turner You can also see #33, I'm trying to troubleshoot this atm. Looks like there's just one of the functions that drops all managed policy info, even though it's included in the program. Check the other ticket for my contact details if you'd like to reach out as well

@jonnieb007
Copy link
Author

I can help with testing but much of a programer

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

No branches or pull requests

4 participants