Skip to content

virtual router: Collect the FRR log and a masked frr.conf in router diagnostics - #14884

Open
MitchDrage wants to merge 2 commits into
apache:mainfrom
MitchDrage:frr-diagnostics
Open

MitchDrage wants to merge 2 commits into
apache:mainfrom
MitchDrage:frr-diagnostics

Conversation

@MitchDrage

Copy link
Copy Markdown
Contributor

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)
  • 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
  • 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.

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant