diff --git a/tools/snmpdv3/Dockerfile b/tools/snmpdv3/Dockerfile index 30073820c0..810ae865c5 100644 --- a/tools/snmpdv3/Dockerfile +++ b/tools/snmpdv3/Dockerfile @@ -1,4 +1,4 @@ FROM polinux/snmpd -COPY snmpd.conf /etc/snmpd/snmpd.conf +COPY snmpd.conf /etc/snmp/snmpd.conf EXPOSE 161:161/udp -CMD ["-c", "/etc/snmpd/snmpd.conf"] +CMD ["-c", "/etc/snmp/snmpd.conf"] diff --git a/tools/snmpdv3/README.md b/tools/snmpdv3/README.md index 990c4b9f65..255001d410 100644 --- a/tools/snmpdv3/README.md +++ b/tools/snmpdv3/README.md @@ -17,12 +17,12 @@ docker run --name snmpd -p 161:161/udp snmpd ## Authentication and privacy -Using the SNMPv3 user security model (USM), this image sets up a read-only user +Using the SNMPv3 user security model (USM), this image sets up a read&write user named `myv3user`, with an authentication password of `my_authpass`, using AES encryption for security with a privacy password of `my_privpass`. For SNMP v1 or v2c communication, it sets up a default read-only community of -`notpublic`. +`public` and a read-write community of `private`. ## Local testing diff --git a/tools/snmpdv3/snmpd.conf b/tools/snmpdv3/snmpd.conf index 64ffec3cc3..4eb66fc17a 100644 --- a/tools/snmpdv3/snmpd.conf +++ b/tools/snmpdv3/snmpd.conf @@ -1,13 +1,27 @@ -com2sec notConfigUser default notpublic -group notConfigGroup v1 notConfigUser -group notConfigGroup v2c notConfigUser -view systemview included .1.3.6.1.2.1.1 -view systemview included .1.3.6.1.2.1.25.1.1 -access notConfigGroup "" any noauth exact systemview none none +# sec.name source community +com2sec read default public +com2sec readwrite default private + +# groupName securityModel securityName +group readGroup v1 read +group readGroup v2c read +group readwriteGroup v1 readwrite +group readwriteGroup v2c readwrite +group readwriteGroup usm readwrite + +# group context sec.model sec.level prefix read write notif +view allview included .1 +view publicview included .1.3.6.1.2.1.1 + +# group context sec.model sec.level prefix read write notif +access readGroup "" any noauth exact publicview none none +access readwriteGroup "" any noauth exact allview allview none createUser myv3user SHA "my_authpass" AES "my_privpass" -rouser myv3user +rwuser myv3user -syslocation Milliways -syscontact NAV Developer +# Setting these here will make them read-only, unfortunately. +# NAV/SeedDB needs them to be writeable to test for write-access +#syslocation Milliways +#syscontact NAV Developer dontLogTCPWrappersConnects yes