access: limit OIDs exposed over SNMP
Define a custom SNMP group with read access only to fields we need. For D-Link switches, modifying the group must be handled the same as user, i.e. the group (and user) must be removed and readded. Untested for FS S5800.
This commit is contained in:
		
							parent
							
								
									2c93cab682
								
							
						
					
					
						commit
						7a2223ea71
					
				
					 5 changed files with 61 additions and 16 deletions
				
			
		|  | @ -112,7 +112,11 @@ snmp-server name {{ inventory_hostname }} | |||
| snmp-server location {{ rack }} | ||||
| {# SNMP engine ID must be exactly 24 hex digits #} | ||||
| snmp-server engineID local {{ snmp_engine_id }} | ||||
| snmp-server group public v3  priv read CommunityView | ||||
| {# limit MIBs exposed over SNMP #} | ||||
| snmp-server view public 1.3.6.1.2.1.1 included {# system +#} | ||||
| snmp-server view public 1.3.6.1.2.1.2 included {# interfaces +#} | ||||
| snmp-server view public 1.3.6.1.2.1.17.7 included {# qBridgeMIB +#} | ||||
| snmp-server view public 1.3.6.1.2.1.31 included {# ifMIB +#} | ||||
| 
 | ||||
| sntp enable | ||||
| {% for address in ntp %} | ||||
|  |  | |||
|  | @ -17,7 +17,11 @@ vlan database | |||
| snmp-server enable | ||||
| snmp-server system-location {{ rack }} | ||||
| snmp-server engineID {{ snmp_engine_id }} | ||||
| snmp-server access public security-model usm priv read _all_ | ||||
| snmp-server view public included 1.3.6.1.2.1.1 {# system +#} | ||||
| snmp-server view public included 1.3.6.1.2.1.2 {# interfaces +#} | ||||
| snmp-server view public included 1.3.6.1.2.1.17.7 {# qBridgeMIB +#} | ||||
| snmp-server view public included 1.3.6.1.2.1.31 {# ifMIB +#} | ||||
| snmp-server access public security-model usm priv read public | ||||
| 
 | ||||
| {# sort to ensure LAG interfaces are added last #} | ||||
| {% for iface in interfaces | sort(attribute="type.value") | sort(attribute="mgmt_only") %} | ||||
|  |  | |||
|  | @ -58,4 +58,9 @@ interface {{ iface.name }} | |||
| 
 | ||||
| enable service snmp-agent | ||||
| snmp-server location {{ rack }} | ||||
| snmp-server group public v3 priv read default | ||||
| {# limit MIBs exposed over SNMP #} | ||||
| snmp-server view public 1.3.6.1.2.1.1 include {# system +#} | ||||
| snmp-server view public 1.3.6.1.2.1.2 include {# interfaces +#} | ||||
| snmp-server view public 1.3.6.1.2.1.17.7 include {# qBridgeMIB +#} | ||||
| snmp-server view public 1.3.6.1.2.1.31 include {# ifMIB +#} | ||||
| snmp-server group public v3 priv read public | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue