Skip to contentSkip to conversation

package/netsnmp: add option for a read-only agent

PATCH Applied Joachim Wiberg 2 participants 2 messages Sep 24 – Oct 19

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/netsnmp: add option for a read-only agent

net-snmp can be built with --enable-read-only, which removes all SET support from the agent. For a device that is only ever polled this is a stronger guarantee than withholding write access through VACM, since a mistake in the access control configuration can no longer result in a writable agent.

The client applications are unaffected. Default off, so existing configurations build as before.

---
 package/netsnmp/Config.in  | 12 ++++++++++++
 package/netsnmp/netsnmp.mk |  4 ++++
 2 files changed, 16 insertions(+)
package/netsnmp/Config.in +12 -0
index dff0f18bee..9a740c2db2 100644
@@ -43,6 +43,18 @@ config BR2_PACKAGE_NETSNMP_WITHOUT_MIB_MODULES
 	help
 	  Specify which MIB modules to exclude.
 
+config BR2_PACKAGE_NETSNMP_ENABLE_READ_ONLY
+	bool "Read-only agent"
+	depends on BR2_PACKAGE_NETSNMP_SERVER
+	help
+	  Remove all SET support from the agent, so it can be queried
+	  but never written to. Access control still needs to be
+	  configured, but a mistake there can no longer result in a
+	  writable agent.
+
+	  The client applications are unaffected, snmpset is still
+	  built when clients are enabled.
+
 config BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING
 	bool "Enable debugging code"
 	help
package/netsnmp/netsnmp.mk +4 -0
index 55e5997734..18b5ac36e1 100644
@@ -96,6 +96,10 @@ NETSNMP_CONF_OPTS += --disable-mib-loading
 NETSNMP_CONF_OPTS += --disable-mibs
 endif
 
+ifeq ($(BR2_PACKAGE_NETSNMP_ENABLE_READ_ONLY),y)
+NETSNMP_CONF_OPTS += --enable-read-only
+endif
+
 ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
 NETSNMP_CONF_OPTS += --disable-debugging
 endif
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · Joachim Wiberg

net-snmp can be built with --enable-read-only, which removes all SET support from the agent. For a device that is only ever polled this is a stronger guarantee than withholding write access through VACM, since a mistake in the access control configuration can no longer result in a writable agent.

The client applications are unaffected. Default off, so existing configurations build as before.

Applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot