Created
April 21, 2015 11:49
-
-
Save berdario/cc65c04a4a1890df0882 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from operator import or_ | |
| from functools import reduce | |
| import inquirer | |
| types = {'web': {'directory brute force', 'httrack', 'drupal scans', 'web app'}, | |
| 'ssl': {'ssl audit', 'web app', 'drupal scans'}, | |
| 'infra': {'nmap common', 'nmap all tcp', 'udp', 'windows audit'}} | |
| def assessments(answers): | |
| choices = answers['types'] | |
| return sorted(reduce(or_, (types[c] for c in choices))) | |
| questions = [inquirer.Checkbox('types', | |
| message='Choose assessment type(s)', | |
| choices=sorted(types), | |
| validate=lambda _, choice: bool(choice)), | |
| inquirer.Checkbox('assessments', | |
| message='Choose assessment(s)', | |
| choices=assessments) | |
| ] | |
| choices = inquirer.prompt(questions) | |
| if 'web app' in choices['assessments']: | |
| extra_questions = [inquirer.Confirm('parallel', message='Should the web app test be run in parallel?', default=True), | |
| inquirer.Confirm('http-only', message='Should the tests skip TLS endpoints?')] | |
| choices.update(inquirer.prompt(extra_questions)) | |
| print(choices) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment