Paloalto generator should provide more informational/warning logs
- Dominant language
- Python
- Stars
- 857
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
Whenever a term is being rendered in the generator, there should be sufficient logging to help debug the translation of .pol to vendor syntax ACLs. This is because Capirca drops incorrect terms, and may process terms in various ways - group terms, or break single terms into multiple terms in order to generate correct vendor syntax.
1. **Informational logs** should be present whenever some term being rendered could have clarifying information about why the flow is being rendered in that manner. While Informational logs are used for confirming that things are working as expected, we don't expect these logs to be everywhere, but only when something unexpected or convoluted is occurring.
2. **Warning level logs** must be present whenever a term is not being rendered completely. Even if a single protocol in a term with multiple protocols is being skipped, this is considered as a term not being rendered completely, and thus a warning log should be present when this condition is triggered.
Some spots in the current paloalto generator where Warning level logs must be present -
1. https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L483-L485
2. All 3 conditions in https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L527-L534
3. https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L555-L556
4. https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L574-L576
5. https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L577-L579
6. https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L274
Some spots where informational level logs could be added -
1. https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L481-L482 can indicate that a src_any and dst_any flow was created.
2. All conditions in https://github.com/google/capirca/blob/master/capirca/lib/paloaltofw.py#L486-L495 can have informational logs indicating the flows created.
This list is only semi-exhaustive since I may have missed conditions where a warning log may be necessary.
Contributor guide
Assessment
This issue has not been assessed yet.