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

Make get-api-key name and output less ambiguous #35

Open
3 tasks
dav3r opened this issue Jan 25, 2022 · 0 comments
Open
3 tasks

Make get-api-key name and output less ambiguous #35

dav3r opened this issue Jan 25, 2022 · 0 comments
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use

Comments

@dav3r
Copy link
Member

dav3r commented Jan 25, 2022

💡 Summary

Currently, the get-api-key script will output one API key for every user in the Gophish database. At minimum, this script should be modified so that its name is changed to get-api-keys and documented appropriately to make it clear that multiple keys may be returned.

Two other solutions have been discussed:

  • Make the script accept an optional username as an input and output the API key of that user if it exists. If no username is supplied, the username of the default Gophish user (e.g. admin) would be used.
  • Have the script simply return the API key of the default Gophish user.

If either of those solutions are implemented, it's important to conspicuously document the fact that this script will not work as intended if the default Gophish user is ever deleted.

Motivation and context

This was originally noted by @mcdonnnj in cisagov/pca-gophish-composition-packer#70 (review). That PR added a band-aid solution in response to the issues noted above.

Implementation notes

See options discussed in "Summary" section above.

Acceptance criteria

  • The name of the get-api-key accurately reflects the full range of potential outputs (i.e. zero or more API keys).
  • The code and README are updated to reflect the changes made.
  • Optional: The script accepts a username as input and outputs the corresponding API key. The username here may be optional and default to a particular Gophish user.
@dav3r dav3r added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
None yet
Development

No branches or pull requests

1 participant