Updated for snmpv3: 01/14/2020
Updated for snmpv3: 06/01/2020
Updated for snmpv1,2: 08/10/2020
Scenario –
You or your customer would like to link SNMP to the Netwitness for system monitoring purposes (Solarwinds, Nagios, etc.).
If you are planning on using snmpv3 and have already configured the iptables - please go the the version 3
Why SNMP?
SNMP is an “agentless” method of monitoring network devices and servers, which can be viable alternative to the problems, hassle, and maintenance associated with agents.
The process:
- Preparation
- How many hosts
- Host locations and subnets
- ssh access
- Documents
- https://community.rsa.com/docs/DOC-93651
- https://community.rsa.com/docs/DOC-45725
- Obtain the snmp script for netwitness (there may be other versions available)
- nwsnmpconfig-2015.09.10.sh
- Considerations
- Change requests?
- Schedules
- Implementation
- Manual configuration or script
- Backout process
- Expectations from the other stake holders
- Backup
- Netwitness.json (/etc/netwitness/config-management/environments/netwitness.json)
- Iptables-config (/etc/sysconfig/iptables-config)
- Iptables (/etc/sysconfig/iptables)
- SNMP (/etc/snmp/snmpd.conf)
- Implementation – Short version
- Each host will need the netwitness services stopped before the system is configured for SNMP.
- If netwitness is already deployed and the firewall rules during the install were not set to custom the netwitness.json file will need to be modified so that future updates and upgrades do not change the firewall rules.
- Modify the iptables-config (configuration for firewall rules)
- Modify the iptables files (firewall rules)
- SNMP default port 161
- Optional – it is also a good time to add icmp if desired.
- Run the nwsnmpconfig-2015.09.10.sh script
- Modify the snmp.conf file
- Restart the firewall service
- Restart the snmp service
- Restart the netwitness services
- Testing
- Snmpwalk command is the best way to test.
- First, run the snmpwalk on the current host
- Second, use the snmpwalk from a different host
Sounds pretty easy, right? There is a lot going on with this process, so here is the detailed break down.
- Backup
- Netwitness.json (/etc/netwitness/config-management/environments/netwitness.json)
- Iptables-config (/etc/sysconfig/iptables-config)
- Iptables (/etc/sysconfig/iptables)
- SNMP (/etc/snmp/snmpd.conf - if exists)
- Stop all the services for netwitness (choose one of these host types - Network only - the basics). Possible host types: Archiver, Broker, Concentrator, Decoder, EndpointHybrid, EndpointLogHybrid, ESAPrimary, ESASecondary, LogCollector, LogDecoder, LogHybrid, Malware, NetworkHybrid, UEBA. Please reference the community docs for additional appliances.
- SA Server
- systemctl stop jetty.service
- systemctl stop nwappliance.service
- systemctl stop nwbroker.service
- systemctl stop rsa-nw-admin-server.service
- systemctl stop rsa-nw-config-server.service
- systemctl stop rsa-nw-content-server.service
- systemctl stop rsa-nw-integration-server.service
- systemctl stop rsa-nw-investigate-server.service
- systemctl stop rsa-nw-orchestration-server.service
- systemctl stop rsa-nw-respond-server.service
- systemctl stop rsa-nw-security-server.service
- systemctl stop rsa-nw-source-server.service
- Broker
- systemctl stop nwappliance.service
- systemctl is-active nwbroker.service
- Decoder
- systemctl stop nwappliance.service
- systemctl stop nwdecoder.service
- Concentrator
- systemctl stop nwappliance.service
- systemctl stop nwconcentrator.service
- ESA Primary
- systemctl stop rsa-nw-contexthub-server.service
- systemctl stop rsa-nw-esa-analytics-server.service
- systemctl stop rsa-nw-esa-server.service
- ESA Secondary
- systemctl stop rsa-nw-esa-analytics-server.service
- systemctl stop rsa-nw-esa-server.service
- Update the files
- Netwitness.json - CAUTION if put on any host other than the SA Server - upgrade will be halted because the hosts do not know what to do with it.
- "global" : {
"customer-firewall" : true,
"mongo" : {
- Iptables-config
- IPTABLES_SAVE_ON_STOP="no" to IPTABLES_SAVE_ON_STOP="yes"
- IPTABLES_SAVE_ON_RESTART="no" to IPTABLES_SAVE_ON_RESTART="yes"
- Iptables (make sure the rules are put at the top and not the bottom)
- OPEN the SNMP default port 161
- A INPUT -p udp -m udp --dport 161 -j ACCEPT
- Optional – Open icmp if the environment relies on ping for management purposes
- -A INPUT -p icmp -j ACCEPT
- Set up SNMP
- chkconfig snmpd on
- Run the following script or later version
- nwsnmpconfig-2015.09.10.sh
- Don’t forget to change the permissions
- Snmpd.conf
- Uncomment and/or modify
- (uncomment) # master agentx to master agentx
- rocommunity netwitness
- (uncomment and add <ip.addr>) # agentaddress 192.x.x.x
- this is typically the ip address associated eth0 (bonded) or em1 on netwitness hosts
- trapcommunity netwitness
- this is normally the trap community the designation you obtain from an administrator – ex.ABC#$%123
- Restart all the services
- systemctl restart snmpd.service
- systemctl restart iptables.service
- Restart the appliance Netwitness services
- Testing
- Run the snmpwalk locally
- snmpwalk -v2c -Of -c netwitness -m "/usr/share/snmp/mibs/NETWITNESS-MIB.txt" 127.0.0.1 .1.3.6.1.4.1.36807
- snmpwalk -v 2c -c "communityName" x.x.x.x
- Run the snmpwalk from a different server.
- snmpwalk -v2c -Of -c netwitness -m "/usr/share/snmp/mibs/NETWITNESS-MIB.txt" <ip address of the queried nw host> .1.3.6.1.4.1.36807
- Have the administrator snmpwalk test
i. snmpwalk -v 2c -c "communityName" x.x.x.x
SNMPv3 - authPriv (authentication + encryption)
- Two files to be concerned with
- /etc/snmp/snmpd.conf
- /var/lib/net-snmp/snmpd.conf (Do not modify - just look at it)
- Disable SNMPv1 and 2
- /etc/snmp/snmpd.conf
- service snmpd stop
- Run the following command and put in your info.
- For fips we must use SHA and AES
- I tried md5 + DES and it did not work.
net-snmp-create-v3-user -A "authPassphrase" -X "privacyPassphrase" -a SHA -x AES snmpUser
- for secure snmp - authPriv you need two passphrases
- Make sure file has been created and check the permissions on the file
- /var/lib/net-snmp/snmpd.conf
- No need to modify this file. Just make sure the net-snmp-create-v3-user command modified the file.
- service snmpd start
- Test it with the following command. (Recommend testing from a different computer that is able to reach the host on port 161
- snmpwalk -v 3 -l authPriv -a SHA -A authPassphrase -x AES -X privacyPassphrase -u snmpUser 10.x.x.x
If you are doing a larger deployment, I would highly recommend scripting the process and as a best practice do your development in a test environment.
How did I do this in my most recent deployment?
Customer was on 11.2.0.1 with network only. 32 Hosts.
I started by referencing the documents above and the web for the script outline. I then scripted out the process, loaded the scripts on the SA head (MyScript and nwsnmpconfig-2015.09.10.sh). I pushed them out with the salt-cp '*' file.copy command to all the hosts. I then changed the scripts permissions with the salt '*' cmd.run 'chmod...'. At this point, I had put the files on all 32 hosts and ready to be run. Because I wanted to ensure there were no problems, I ssh'd into all the hosts and ran the scripts manually. Lastly, I would advise being careful with the salt '*' command because that updates all the hosts at once. Alternately, the salt command can be used targeting one host by using the salt minion id. Ex. salt '32b78ed8-a0dc-4f4c-915f-ec14aeacf6hf' cmd.run 'enter your command here'
Moving forward as we add additional hosts, I will simply WinSCP the scripts on to the new host, change the permissions, and run the scripts.
Let me know your thoughts - Tom J
nwsnmpconfig-2015.09.10.zip