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

Validate the aws account number which is worked on #8

Open
pandian912 opened this issue Oct 11, 2019 · 8 comments
Open

Validate the aws account number which is worked on #8

pandian912 opened this issue Oct 11, 2019 · 8 comments
Labels
enhancement New feature or request hacktoberfest hactoberfest identity tag

Comments

@pandian912
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Ppl often work with multiple aws accounts and often run scenarios or api calls inadvertently on the wrong aws account.

Describe the solution you'd like

Take acc no in the config and validate before performing any operations

Describe alternatives you've considered

This is usefull for a generic scanario where the names of ELB/ec2/tags are same across accounts

@pandian912 pandian912 added enhancement New feature or request hacktoberfest hactoberfest identity tag labels Oct 11, 2019
@macdude357
Copy link

I can't take a shot at this one. By "validate" do you mean prompt the user to acknowledge that the account number in the config is the desired one?

@pandian912
Copy link
Collaborator Author

Store account number in config... Get account number with aws api call and verify if they match

@macdude357
Copy link

The way I'm thinking about implementing this is to have the user add a property to src/test/resources/config.properties named "aws.targetAccount". In looking at how I would insert the logic to validate the account, I was thinking about creating a base class for the Delegator classes and put the logic in that base class. Ideally, I could refactor a lot of the boilerplate code from the Delegators into that base class. Does that work?

@pandian912
Copy link
Collaborator Author

Validating the account number on aws credential initialization would be better i believe.

@zeeshanSD
Copy link
Contributor

Are we limiting this for config driven accounts? What about credentials that are stored in environment variables or aws config files? Not sure the value of account number here? Perhaps "Who am I?" api call to see which account it is?

@pandian912
Copy link
Collaborator Author

  1. we can get account number from env variable
  2. also handle case where account number is not present.. In such a case we disable acc number validation altogether.

@macdude357
Copy link

So my understanding is that you want the user to indicate what account he is targeting via an env var. The code should then validate that the credentials that are being used are actually for that "target" account number. If the env var does not exist, then no validation takes place.

@pandian912
Copy link
Collaborator Author

Added comments here - https://github.com/intuit/CloudRaider/pull/13/files

So the check priority will be like as follows:

  • account number from env variable (doucment the variable name in readme)
  • account number in config file
  • no account number found in above scenarios, so don't do account number verification (log the same)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest hactoberfest identity tag
Projects
None yet
Development

No branches or pull requests

3 participants