MitchDrage opened a new pull request, #14884:
URL: https://github.com/apache/cloudstack/pull/14884

   ### Description
   
   Router diagnostics collect no FRR files today, so a BGP problem on a virtual 
router needs a shell on the router to investigate. This PR adds the FRR log and 
a copy of `frr.conf` with the peer passwords masked to the default router file 
list.
   
   - `CsBgpPeers` writes `/var/cache/cloud/frr.conf.masked` each time it 
renders `frr.conf`. Every neighbour password in the copy reads `****`. The 
plain `frr.conf` stays on the router.
   - The rendered `frr.conf` now has `log syslog informational`, so the 
router's own FRR daemons write to `frr.log`. Before this, only watchfrr wrote 
there.
   - `diagnostics.data.router.defaults` gains `/var/log/frr/frr.log` and 
`/var/cache/cloud/frr.conf.masked`. The upgrade appends both to the existing 
value.
   
   This was split from #14841, where the review of which FRR files to collect 
took place. It touches `CsBgpPeers.py`, as do #14841 and #14869, so it will 
need a rebase after those merge.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   ### Screenshots (if appropriate):
   
   N/A
   
   ### How Has This Been Tested?
   
   - New unit tests in `TestCsBgpPeers` and `DiagnosticsFilesListFactoryTest`, 
and a smoke test, `test_14_diagnostics_frr_files` in `test_ipv4_routing.py`, 
which checks the zip from `getDiagnosticsData`.
   - Ran the upgrade statement on MariaDB 10.11 and MySQL 8.0. It turns the old 
default into the new one, appends both paths after an operator's own entries 
and leaves NULL as it is.
   - Tested in a lab environment: CloudStack 4.22.1.1 with KVM hosts, systemvm 
template 4.22.0, a ROUTED VPC with Dynamic routing, and this change on the 
management server and the router.
     - With a peer that has a password, the masked copy held no part of the 
password and otherwise matched `frr.conf`.
     - `frr.log` received the router's own bgpd and zebra lines.
     - `getDiagnosticsData` with the default file list returned a zip holding 
`frr.log` and `frr.conf.masked`, with no password in either.
   
   #### How did you try to break this feature and the system with this change?
   
   - Used peer passwords with a line break, with spaces and with special 
characters: the masked copy hides all of each.
   - Checked the default list: it never names the plain `/etc/frr/frr.conf`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] virtual router: Collect ... MitchDrage (via GitHub) via commits

Reply via email to