-
Notifications
You must be signed in to change notification settings - Fork 35
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
Refactor scenarios #20
Open
mdorn
wants to merge
88
commits into
PaloAltoNetworks:main
Choose a base branch
from
mdorn:refactor-scenarios
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Update scen-3 destroy
Scenario 4 Updates
Fix ascii cobra
Update scenario 4
… refactor-scenarios
hkoushik
force-pushed
the
main
branch
3 times, most recently
from
September 13, 2024 10:13
fdce6eb
to
79bd258
Compare
Following up a conversation with @hkoushik and @anandtiwarics , the main things that should be added to this PR before it gets merged are:
The following items from the issue tracker should likely get their own branches/PRs after the merge of this PR:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a significant refactoring which should make it far easier for contributors to add scenarios and to reason about the code generally. Some highlights:
scenarios/
directory rather than using hardcoded scenario details.scenarios/scenario_X
directory without having to touch any code anywhere else. Pulumi infrastructure works exactly the same as before, but the user will need to place deployment of additional infra into anextra.py
module, and the attack logic into anattack
function in anattack.py
module. The newScenario
class (see below) expects that these functions exist.Scenario
class in thescenario.py
module is responsible for executing the scenarios using the Pulumi automation API (rather than simply subprocessing the pulumi CLI) and generating a report from a single HTML template./files/var
).Remaining work:
scenario_0
) using a public S3 bucket and an "attack" that gets an object from it. I also refactoredscenario_2
to use the new approach. This was actually quite easy to do by just moving some of the existing scenario code around to new locations.scenario_0
example helps.To test:
NOTE: The PR should not be merged until the remaining work of moving the rest of the scenarios is complete.