punk-security / dnsReaper

dnsReaper - subdomain takeover tool for attackers, bug bounty hunters and the blue team!
GNU Affero General Public License v3.0
1.99k stars 166 forks source link

Add support for alternate AWS auth options (#77) #87

Closed imnotbrandon closed 2 years ago

imnotbrandon commented 2 years ago

Resolves #77.

If --aws-access-key-id and --aws-access-key-secret are not provided on the command-line, it allows boto3 to source the credentials itself.

This also enhances the argument parsing by allowing providers to decide whether options are required or not. Options are required by default, but can be made non-required by giving them a default value in the function signature:

def fetch_domains(aws_access_key_id=None, aws_access_key_secret=None, **args):
SimonGurney commented 2 years ago

Thanks for doing the proper fix here, rather than a temp solution.

I think we need to validate in the provider that either both are none, or both are provided. A condition with just one is problematic.

imnotbrandon commented 2 years ago

Thanks for doing the proper fix here, rather than a temp solution.

I think we need to validate in the provider that either both are none, or both are provided. A condition with just one is problematic.

Surprisingly it was the path of least resistance! Agreed... having a validation framework is useful in general (eg. ensuring params are in the correct format)

SimonGurney commented 2 years ago

I think we should also have an indicator on the help as to whether the parameter is mandatory or not. In this case they would be optional, and other providers they would be mandatory.

This then paves the way for us to add params for selecting a single zone id in aws or cloudflare.

imnotbrandon commented 2 years ago

I've put in some basic validation for now. I think that implementing full-blown validation framework is out of the scope of this feature request as other providers will need to be modified.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication