Skip to content
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

Customize logging of various SNMP traps just as Zino 1 does #320

Merged
merged 11 commits into from
Aug 20, 2024

Conversation

lunkwill42
Copy link
Member

@lunkwill42 lunkwill42 commented Jul 18, 2024

Scope and purpose

Fixes #319

This pull request

  • adds multiple trap observers to the logged_traps module, one for each MIB mentioned in Add custom trap logging #319
  • Adds multiple MIBs to the zino.mibdumps package, in order to be able to resolve trap names and variables.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Zino can be found in the
README.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with black, ruff and isort, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done

Also adds dumps of all MIB depdencies that weren't already included in
Zino.
Logs `ciscoPimInvalidRegister` and `ciscoPimInvalidJoinPrune` just like
Zino 1 does.
Including MIB dependencies.
As in Zino 1, this just logs the values of all included varbinds whose
named start with the string `ospf`
Remove trap log details from non-implemented features list.
@lunkwill42 lunkwill42 self-assigned this Jul 18, 2024
Copy link

github-actions bot commented Jul 18, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 2 0 0.59s
✅ PYTHON isort 2 0 0.27s
✅ PYTHON ruff 2 0 0.01s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

github-actions bot commented Jul 18, 2024

Test results

    3 files      3 suites   1m 25s ⏱️
  571 tests   571 ✅ 0 💤 0 ❌
1 665 runs  1 663 ✅ 2 💤 0 ❌

Results for commit 1c628bf.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.49%. Comparing base (5fb634d) to head (1c628bf).
Report is 68 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
+ Coverage   97.31%   98.49%   +1.18%     
==========================================
  Files          64       77      +13     
  Lines        7888     9686    +1798     
==========================================
+ Hits         7676     9540    +1864     
+ Misses        212      146      -66     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Jul 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@lunkwill42 lunkwill42 requested a review from a team July 18, 2024 11:58
@lunkwill42 lunkwill42 marked this pull request as ready for review July 18, 2024 11:59
src/zino/trapobservers/logged_traps.py Outdated Show resolved Hide resolved
tests/trapobservers/logged_traps_test.py Outdated Show resolved Hide resolved
tests/trapobservers/logged_traps_test.py Show resolved Hide resolved
As suggested in code review.

Co-authored-by: Johanna England <[email protected]>
Copy link

sonarcloud bot commented Aug 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@lunkwill42 lunkwill42 merged commit dcfb549 into master Aug 20, 2024
11 checks passed
@lunkwill42 lunkwill42 deleted the feature/log-more-snmp-traps branch August 20, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add custom trap logging
2 participants