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

CLI for expansion #38

Open
mwarkentin opened this issue Mar 26, 2020 · 7 comments
Open

CLI for expansion #38

mwarkentin opened this issue Mar 26, 2020 · 7 comments

Comments

@mwarkentin
Copy link

It would be nice if there was a small CLI tool available when you installed that would allow you to quickly expand wildcards without having to hop into a python shell. Imagining something like:

policyuniverse expand --action 'swf:res*'
"Action": [
              "swf:respondactivitytaskcanceled",
              "swf:respondactivitytaskcompleted",
              "swf:respondactivitytaskfailed",
              "swf:responddecisiontaskcompleted"
            ]

Alternatively if you wanted to output the full policy:

policyuniverse expand --action 'swf:res*' --resource '*' --effect 'Allow'
{
        "Statement": [{
            "Action": [
              "swf:respondactivitytaskcanceled",
              "swf:respondactivitytaskcompleted",
              "swf:respondactivitytaskfailed",
              "swf:responddecisiontaskcompleted"
            ],
            "Resource": "*",
            "Effect": "Allow"
          }]
      }
@TryTryAgain
Copy link

I was hoping the same, but for minification ;)

@getsec
Copy link

getsec commented Jun 24, 2021

@TryTryAgain Same. I'd like given a policy, make it smaller

@kmcquade
Copy link

@mwarkentin - Cloudsplaining does have an expand-policy subcommand. It would be pretty straightforward to also have a minimize-policy subcommand as well

image

@patricksanders
Copy link
Collaborator

This does sound neat, but since policyuniverse is more of a library than a CLI tool, I'm thinking @kmcquade's plug sounds pretty good. 😉

That being said, I'm more than happy to review a PR (or a proposal) for a CLI.

@jtyers
Copy link

jtyers commented Jun 22, 2022

Shameless plug, but check out my project aws-policy-generator. It uses policyuniverse under the hood to do all the heavy lifting.

@patricksanders
Copy link
Collaborator

Neat, thanks for sharing @jtyers!

@scriptsrc
Copy link
Contributor

scriptsrc commented Jun 22, 2022 via email

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

7 participants