Skip to content

eos: hide secret in snmp-server host lines - #3885

Merged
robertcheramy merged 2 commits into
ytti:masterfrom
FusionBrah:3882-eos-snmp-server-host-secret
Aug 15, 2026
Merged

eos: hide secret in snmp-server host lines#3885
robertcheramy merged 2 commits into
ytti:masterfrom
FusionBrah:3882-eos-snmp-server-host-secret

Conversation

@FusionBrah

Copy link
Copy Markdown
Contributor

Fixes #3882.

The eos secret filter only handled snmp-server community, so snmp-server host lines kept their community string (v1/v2c) or user (v3) in cleartext:

snmp-server host 10.1.2.3 version 1 string123

This adds a filter modeled on the ios model:

snmp-server host 10.1.2.3 version 1 <secret hidden>

Handles optional vrf, traps/informs and version 1|2c|3 noauth|auth|priv variants.

The model had no simulation data, so this adds a minimal hand-made simulation (based on the reporter's DCS-7050SX3-48YC8 / EOS 4.29.2F, synthetic values) plus output and secret test data. The secret test fails against the old filter and passes with the fix. rake test and rubocop clean.

The secret filter only handled "snmp-server community", so the
community string (v1/v2c) or user (v3) in "snmp-server host" lines was
written to backups in cleartext. Add a filter modeled on ios.rb that
masks the trailing credential token.

Add minimal simulation, output and secret test data for a
DCS-7050SX3-48YC8 on EOS 4.29.2F.

Fixes ytti#3882
@robertcheramy
robertcheramy merged commit 687ed42 into ytti:master Aug 15, 2026
8 checks passed
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.

Arista (eos) misses a secret when "remove_secret" is enabled

2 participants