-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2697 from lunkwill42/tools/snmpv3-daemon
Add an snmpd service container for SNMPv3 comms
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM polinux/snmpd | ||
COPY snmpd.conf /etc/snmpd/snmpd.conf | ||
EXPOSE 161:161/udp | ||
CMD ["-c", "/etc/snmpd/snmpd.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SNMPv3 enabled SNMP daemon for SNMPv3 testing | ||
|
||
This directory defines a simple docker image for a NET-SNMP-based SNMP daemon | ||
that is enabled for responding to SNMPv3 requests. | ||
|
||
## Building the image | ||
|
||
```sh | ||
docker build -t snmpd . | ||
``` | ||
|
||
## Running a container to respond to SNMP locally | ||
|
||
```sh | ||
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 | ||
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`. | ||
|
||
## Local testing | ||
|
||
The entirety of the daemon's mib view can be queried using SNMPv3 by running | ||
the following `snmpwalk` command: | ||
|
||
```sh | ||
snmpwalk -v3 -l authPriv -u myv3user -a SHA -A "my_authpass" -x AES -X "my_privpass" localhost | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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 | ||
|
||
createUser myv3user SHA "my_authpass" AES "my_privpass" | ||
rouser myv3user | ||
|
||
syslocation Milliways | ||
syscontact NAV Developer <[email protected]> | ||
dontLogTCPWrappersConnects yes |