Concatenating SRX-specific options in aclcheck.py #216
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.
When running
aclcheck_cmdline.py
, I ran into an issue when looking at an example SRX Filter:Looking at the
aclcheck.py
code I saw this statement:filtername = header.target[0].options[0]
Now for the most common filters, this would work fine, as most of them are only a single word and easily-split, as shown below:
However, on the SRX it uses multiple words to express the source and destination zone an ACL should apply to:
So what this does is attempt check to see target inside of the header is SRX, and if it is, concatenate all the words together with a space . By doing this, the test behaves much better:
I'm not much of a programmer, so I'm completely open to different ideas. Perhaps this could become the default for all filters, as Junos does require a unique filter for both
family inet
andfamily inet6
?Anyways, let me know what you think and if you have any further questions. Thanks!