ztgrace / changeme

A default credential scanner.
GNU General Public License v3.0
1.44k stars 248 forks source link

Ability to specify multiple resources to run instead of a category #51

Closed anshumanbh closed 6 years ago

anshumanbh commented 6 years ago

Hi,

This is more of a feature request. Right now, if we want to run multiple YMLs for, lets say, a particular resource Apache Tomcat - apache_tomcat_manager.yml (Name - Apache Tomcat Manager) and apache_tomcat_host_manager.yml (Name - Apache Tomcat Host Manager), there is no easy way to do it. I am having to mention -c web so that it automatically runs both of them along with all others.

Can we modify the flag -n to take in multiple names instead of just one? How easy/difficult would this be? I can try issuing a PR if you can direct me exactly where I need to change this in the code.

Cheers!

ztgrace commented 6 years ago

Right now the code that matches a cred to the --name option is at https://github.com/ztgrace/changeme/blob/master/changeme/core.py#L334. For your example, you can use -n "Apache Tomcat" or simply -n Tomcat and it would match both.

If this were to be implemented the format should be similar to the --protocols format of comma separated strings: --name "Apache Tomcat","jboss" Then you could use split(',') to parse the multiple names.

Feel free to give it a shot and make a pull request to the development branch.

Thanks, Zach

anshumanbh commented 6 years ago

Okay, I didn't know that giving -n Tomcat will pick both up. That's good for specific matching resources however for completely different resources, I guess it won't work. So, I will try to work on this asap I can. Thanks for the reply :)