Title: Specify multiple 'end' criteria in compliance reporting configs? · Issue #6 · NetBrainAPI/NetBrain_Automation_Customization · GitHub
Open Graph Title: Specify multiple 'end' criteria in compliance reporting configs? · Issue #6 · NetBrainAPI/NetBrain_Automation_Customization
X Title: Specify multiple 'end' criteria in compliance reporting configs? · Issue #6 · NetBrainAPI/NetBrain_Automation_Customization
Description: In one of the examples configuration examples (https://github.com/NetBrainAPI/NetBrain_Automation_Customization/tree/release_to_public/compliance/audit and compliance reporting) , when viewing line vty configs, the compliance check...
Open Graph Description: In one of the examples configuration examples (https://github.com/NetBrainAPI/NetBrain_Automation_Customization/tree/release_to_public/compliance/audit and compliance reporting) , when viewin...
X Description: In one of the examples configuration examples (https://github.com/NetBrainAPI/NetBrain_Automation_Customization/tree/release_to_public/compliance/audit and compliance reporting) , when viewin...
Opengraph URL: https://github.com/NetBrainAPI/NetBrain_Automation_Customization/issues/6
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Specify multiple 'end' criteria in compliance reporting configs?","articleBody":"In one of the examples configuration examples (https://github.com/NetBrainAPI/NetBrain_Automation_Customization/tree/release_to_public/compliance/audit%20and%20compliance%20reporting) , when viewing `line vty` configs, the compliance check config is set to start at `line vty`s and ends at `!`\r\n\r\nThis is somewhat ambiguous for some common use cases which can occur when there are multiple `start`s before the `end` delimiter. Take the following configuration for instance:\r\n\r\n```\r\nline vty 0 4\r\n login local\r\n transport input ssh\r\nline vty 5 10\r\n login local\r\n transport input telnet ssh\r\nline vty 11 15\r\n login local\r\n transport input ssh\r\n!\r\n```\r\nAnd take the following rule from the README:\r\n```\r\n login authentication vty telnet:\r\n match:\r\n - 'transport input ssh$'\r\n start: '^line vty \\d+.+'\r\n end: '!'\r\n description: 'Make sure telnet is not allowed into the device for management'\r\n repeated: True\r\n```\r\n\r\nWith the sample rule provided I think we would end up with the following outcome:\r\n\r\n```\r\nlogin authentication line vty 0 4 | PASS\r\nlogin authentication line vty 5 10 | PASS\r\nlogin authentication line vty 11 15 | PASS\r\n```\r\n\r\nThe first one passes because `line vty 0 4` to the end delimiter `!` - i.e. the whole line vty config block - contains the `transport input ssh$` string.\r\n\r\nThe second one passes because from \r\n`line vty 5 10` through `!` there is also the `transport input ssh` line in `line vty 11 15`\r\n\r\nThe 3rd one passes because it is only the last stanza (the vty 11 15) which has the match we want to see.\r\n\r\nThe second line - `line vty 5 10` should fail but doesn't. Is there a way around this? One way would be to have the end be EITHER `!` or `^line vty`. This way the last one is caught and the first and second one are treated individually.\r\n","author":{"url":"https://github.com/theabraxas","@type":"Person","name":"theabraxas"},"datePublished":"2020-12-29T18:30:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/6/NetBrain_Automation_Customization/issues/6"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:df217da3-429e-9134-856c-24a1bf2be880 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93C6:D2C96:E6CF73:125B477:697F069A |
| html-safe-nonce | eb928b9b19960dda15cd2839febd06c1f25e5aea9ed545e2724f200d321a8374 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0M2OkQyQzk2OkU2Q0Y3MzoxMjVCNDc3OjY5N0YwNjlBIiwidmlzaXRvcl9pZCI6IjgxOTM2NTg0MzExODIxNDUxNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 48fa67f289c3d0b411b38aa427dfe7d4952dc2b8b4f3247993d3884f39fcc862 |
| hovercard-subject-tag | issue:776031229 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NetBrainAPI/NetBrain_Automation_Customization/6/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b82dc2a96e5066705496d3cdfd43040e523ae257341ab6852a5c32e06494b910/NetBrainAPI/NetBrain_Automation_Customization/issues/6 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b82dc2a96e5066705496d3cdfd43040e523ae257341ab6852a5c32e06494b910/NetBrainAPI/NetBrain_Automation_Customization/issues/6 |
| og:image:alt | In one of the examples configuration examples (https://github.com/NetBrainAPI/NetBrain_Automation_Customization/tree/release_to_public/compliance/audit and compliance reporting) , when viewin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theabraxas |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/NetBrainAPI/NetBrain_Automation_Customization git https://github.com/NetBrainAPI/NetBrain_Automation_Customization.git |
| octolytics-dimension-user_id | 48696389 |
| octolytics-dimension-user_login | NetBrainAPI |
| octolytics-dimension-repository_id | 262336315 |
| octolytics-dimension-repository_nwo | NetBrainAPI/NetBrain_Automation_Customization |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 262336315 |
| octolytics-dimension-repository_network_root_nwo | NetBrainAPI/NetBrain_Automation_Customization |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width