Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/netsnmp: add option for a read-only agent
@ 2026-09-24  9:56 Joachim Wiberg
  2026-10-19 17:47 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Joachim Wiberg @ 2026-09-24  9:56 UTC (permalink / raw)
  To: buildroot; +Cc: 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.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
 package/netsnmp/Config.in  | 12 ++++++++++++
 package/netsnmp/netsnmp.mk |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
index dff0f18bee..9a740c2db2 100644
--- a/package/netsnmp/Config.in
+++ b/package/netsnmp/Config.in
@@ -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
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 55e5997734..18b5ac36e1 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -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
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/netsnmp: add option for a read-only agent
  2026-09-24  9:56 [Buildroot] [PATCH 1/1] package/netsnmp: add option for a read-only agent Joachim Wiberg
@ 2026-10-19 17:47 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-19 17:47 UTC (permalink / raw)
  To: Joachim Wiberg; +Cc: buildroot

On Thu, Sep 24, 2026 at 11:56:34AM +0200, Joachim Wiberg wrote:
> 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.
> 
> Signed-off-by: Joachim Wiberg <troglobit@gmail.com>

Applied to master, thanks!

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-19 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24  9:56 [Buildroot] [PATCH 1/1] package/netsnmp: add option for a read-only agent Joachim Wiberg
2026-10-19 17:47 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox