logstash-integration-snmp 4.0.6-java → 4.0.7-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87e91726f2da35d5c128693fe731cabd216590807964ffc0181160eb8a19b216
4
- data.tar.gz: 6174140288b22f07ca266fe3a9d929ee4a0777e7b90f6fa2c8c10c41942ced34
3
+ metadata.gz: f5e701d04ad501b4d2dd73fe4c4ff37ddd64211012889ac138cd7b9a72308cd3
4
+ data.tar.gz: 2e2d4749b6ea158edd89b24919b85a1dcdc31043ee7493d0d06b00e73af9c907
5
5
  SHA512:
6
- metadata.gz: cf3f6eb1b7b4588a3516387c5d2a26f4234d4697a3384653c150e2a91cfb12551f9ce3e8f2a7370bcc4f68ac54a897e0533e5e1da6feb6082559eeff65d34c69
7
- data.tar.gz: aaaead569d07cb2b4622740cc8fe9bcc0ae97101fb699133650e8e759f60bcb101f4f3ee22f7e232a26e16d67cb3915034077d896258764d4da71701d3947c71
6
+ metadata.gz: d4ca76a297d01d22ab35c0288e571aaee48693e112fea175bf79f6a95d4868f53896ef9c8f28468bd2362bfe9f338eef8ff80115dff218f902512ccd0ce3690b
7
+ data.tar.gz: 2d44682187f14ebaee40af56288c37a517e07e0b4adf03fbf7a63db81b8aef6332285a9f3a265af20aa5b988758ad26dd4e554e2d13bb41af6795c732627434e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.0.7
2
+ - FIX: The `snmptrap` input now correctly enforces the user security level set by `security_level` config, and drops received events that do not match the configured value [#75](https://github.com/logstash-plugins/logstash-integration-snmp/pull/75)
3
+
1
4
  ## 4.0.6
2
5
  - [DOC] Fix typo in snmptrap migration section [#74](https://github.com/logstash-plugins/logstash-integration-snmp/pull/74)
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.6
1
+ 4.0.7
@@ -350,8 +350,11 @@ The `priv_protocol` option specifies the SNMPv3 privacy/encryption protocol.
350
350
  [id="plugins-{type}s-{plugin}-security_level"]
351
351
  ===== `security_level`
352
352
 
353
- * Value can be any of: `noAuthNoPriv`, `authNoPriv`, `authPriv`
354
- * There is no default value for this setting
353
+ * Value can be any of:
354
+ - `noAuthNoPriv`: allows receiving traps messages without authentication or encryption.
355
+ - `authNoPriv`: trap messages must be authenticated according to <<plugins-{type}s-{plugin}-security_name>>/<<plugins-{type}s-{plugin}-auth_protocol>>/<<plugins-{type}s-{plugin}-auth_pass>>. Encrypted messages are allowed but not required.
356
+ - `authPriv`: trap messages must be both authenticated according to <<plugins-{type}s-{plugin}-security_name>>/<<plugins-{type}s-{plugin}-auth_protocol>>/<<plugins-{type}s-{plugin}-auth_pass>> and encrypted according to <<plugins-{type}s-{plugin}-priv_protocol>>/<<plugins-{type}s-{plugin}-priv_pass>>.
357
+ * The default value is `noAuthNoPriv`.
355
358
 
356
359
  The `security_level` option specifies the SNMPv3 security level between
357
360
  Authentication, No Privacy; Authentication, Privacy; or no Authentication, no Privacy.
@@ -118,7 +118,7 @@ module LogStash
118
118
  validate_usm_user! if validate_usm_user
119
119
 
120
120
  unless @security_name.nil?
121
- client_builder.addUsmUser(@security_name, @auth_protocol, @auth_pass&.value, @priv_protocol, @priv_pass&.value)
121
+ client_builder.addUsmUser(@security_name, @auth_protocol, @auth_pass&.value, @priv_protocol, @priv_pass&.value, @security_level || 'noAuthNoPriv')
122
122
  end
123
123
 
124
124
  client_builder.setMapOidVariableValues(@oid_map_field_values)
@@ -2,5 +2,6 @@
2
2
 
3
3
  require 'jar_dependencies'
4
4
  require_jar('org.snmp4j', 'snmp4j', '3.8.0')
5
+ require_jar('org.snmp4j', 'snmp4j-log4j', '2.8.11')
5
6
  require_jar('org.snakeyaml', 'snakeyaml-engine', '2.7')
6
- require_jar('org.logstash.integrations', 'plugin', '4.0.6')
7
+ require_jar('org.logstash.integrations', 'plugin', '4.0.7')
@@ -185,6 +185,27 @@ describe LogStash::Inputs::Snmptrap, :integration => true do
185
185
  expect(queue.size).to eq(0)
186
186
  end
187
187
  end
188
+
189
+ context 'when receiving a request with invalid security level' do
190
+ it 'should not process the message' do
191
+ queue = run_plugin_and_get_queue(plugin, timeout: 3) do
192
+ @trap_sender.send_trap_v3(target_address, security_name, auth_protocol, auth_pass, priv_protocol, priv_pass, 'noAuthNoPriv', {'1.1' => 'foo'})
193
+ end
194
+
195
+ expect(queue.size).to eq(0)
196
+ end
197
+ end
198
+
199
+ context 'when receiving a request with higher security level' do
200
+ let(:security_level) { 'authNoPriv' }
201
+ it 'should process the message' do
202
+ queue = run_plugin_and_get_queue(plugin, timeout: 3) do
203
+ @trap_sender.send_trap_v3(target_address, security_name, auth_protocol, auth_pass, priv_protocol, priv_pass, 'authPriv', {'1.1' => 'foo'})
204
+ end
205
+
206
+ expect(queue.size).to eq(1)
207
+ end
208
+ end
188
209
  end
189
210
 
190
211
  context 'with supported_versions' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-integration-snmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.6
4
+ version: 4.0.7
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-23 00:00:00.000000000 Z
11
+ date: 2025-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -469,8 +469,9 @@ files:
469
469
  - spec/unit/inputs/common_spec.rb
470
470
  - spec/unit/inputs/snmp_spec.rb
471
471
  - spec/unit/inputs/snmptrap_spec.rb
472
- - vendor/jar-dependencies/org/logstash/integrations/plugin/4.0.6/plugin-4.0.6.jar
472
+ - vendor/jar-dependencies/org/logstash/integrations/plugin/4.0.7/plugin-4.0.7.jar
473
473
  - vendor/jar-dependencies/org/snakeyaml/snakeyaml-engine/2.7/snakeyaml-engine-2.7.jar
474
+ - vendor/jar-dependencies/org/snmp4j/snmp4j-log4j/2.8.11/snmp4j-log4j-2.8.11.jar
474
475
  - vendor/jar-dependencies/org/snmp4j/snmp4j/3.8.0/snmp4j-3.8.0.jar
475
476
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
476
477
  licenses: