-
Notifications
You must be signed in to change notification settings - Fork 64
[NTC-4957] Fixed parsing Palo banners that start on the same line #794
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
Conversation
|
Can you add a |
tests/unit/mock/config/parser/base/paloalto_panos/paloalto_banner_same_line_received.py
Show resolved
Hide resolved
|
just checking, @joewesch does everything work with a very short 1 line banner? I'd assume above is a valid banner and want to make sure the parsing isn't dependent on multilines. |
Ah, good call. It does not. Let me add a test for that and then fix it. |
|
I moved this back to draft for now. I determined that the current parsing logic does not account for single line banners so I'm going to need to create many more tests and verify they are all parsed correctly. |
|
After discovering that single line banners were not being properly parsed, I have refactored the config parsing to instead key off of As mentioned in the comments in the code, this includes 2x points that could cause false positives:
These should be considered edge cases and are easy to fix by simply adjusting the wording in the banner. |
| @@ -0,0 +1 @@ | |||
| Added `--pattern` and `--label` options to the `invoke pytest` task. No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yea baby!!
Closes: #780
This PR changes the logic a bit when dealing with Palo Alto banners that start on the same line as
login-banner. The existing test only tests if they start with an empty line:But a banner isn't required to have a blank line on the first line.