Skip to content

Commit 3dff9cd

Browse files
fix: traps add engine contextId (#1230)
* fix: add decode method security engine ID * chore: add missing import * fix: unit tests * fix: run pre-commit * fix: update docker env file, docs and changelog * fix: update method description --------- Co-authored-by: ajasnosz <[email protected]>
1 parent c89dd17 commit 3dff9cd

File tree

20 files changed

+223
-63
lines changed

20 files changed

+223
-63
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- introduce `splunkMetricNameHyphenToUnderscore` parameter to make metric names follow Splunk schema
99
- change default walk to get only SNMPv2-MIB
1010
- add `disableMongoDebugLogging` parameter to disable extensive pymnogo logs while `logLevel` is set to `DEBUG`
11+
- add `includeSecurityContextId` parameter to control whether to add the `context_engine_id` field to v3 trap events
1112

1213
### Fixed
1314
- fix text SNMP values with numbers and 'E' being interpreted as scientific notation

charts/splunk-connect-for-snmp/templates/traps/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ spec:
7979
{{- end}}
8080
- name: SPLUNK_HEC_INSECURESSL
8181
value: {{ .Values.splunk.insecureSSL | default "false" | quote }}
82+
- name: INCLUDE_SECURITY_CONTEXT_ID
83+
value: {{ .Values.traps.includeSecurityContextId | default "false" | quote }}
8284
- name: SNMP_V3_SECURITY_ENGINE_ID
8385
value: {{ join "," .Values.traps.securityEngineId }}
8486
- name: SPLUNK_HEC_TOKEN

charts/splunk-connect-for-snmp/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,9 @@
746746
"aggregateTrapsEvents": {
747747
"type": ["string", "boolean"]
748748
},
749+
"includeSecurityContextId": {
750+
"type": ["string", "boolean"]
751+
},
749752
"communities": {
750753
"type": "object"
751754
},

charts/splunk-connect-for-snmp/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ traps:
438438
- "80003a8c04"
439439
# aggregateTrapsEvents flag set to true makes traps events collected as one event inside splunk
440440
aggregateTrapsEvents: "false"
441+
# controls whether to add the context_engine_id field to v3 trap events
442+
includeSecurityContextId: "false"
441443

442444
# communities define a version of SNMP protocol and SNMP community string, which should be used
443445
communities: {}

docker_compose/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ SNMP_V3_SECURITY_ENGINE_ID=80003a8c04
9494
TRAPS_PORT=162
9595
TRAP_LOG_LEVEL=INFO
9696
TRAP_DISABLE_MONGO_DEBUG_LOGGING=true
97+
INCLUDE_SECURITY_CONTEXT_ID=false
9798

9899
# Scheduler configuration
99100
SCHEDULER_LOG_LEVEL=INFO

docs/dockercompose/6-env-file-configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ Inside the directory with the docker compose files, there is a `.env`. Variables
125125
| Variable | Description |
126126
|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
127127
| `SNMP_V3_SECURITY_ENGINE_ID` | SNMPv3 TRAPs require the configuration SNMP Engine ID of the TRAP sending application for the USM users table of the TRAP receiving application for each USM user, for example: SNMP_V3_SECURITY_ENGINE_ID=80003a8c04,aab123456 |
128+
| `INCLUDE_SECURITY_CONTEXT_ID` | Controls whether to add the context_engine_id field to v3 trap events |
128129
| `TRAPS_PORT` | External port exposed for traps server |
129130
## Scheduler
130131

docs/microk8s/configuration/trap-configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ traps:
2424
logLevel: "WARN"
2525
# disableMongoDebugLogging is used to disable extensive debug logging for MongoDB+pymongo while logLevel is set to DEBUG.
2626
disableMongoDebugLogging: true
27+
# controls whether to add the context_engine_id field to v3 trap events
28+
includeSecurityContextId: false
2729
# replicas: Number of replicas for trap container should be 2x number of nodes
2830
replicas: 2
2931
#loadBalancerIP: The IP address in the metallb pool

docs/microk8s/configuration/values-params-description.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ Detailed documentation about configuring traps can be found in [Traps](trap-conf
164164
| `usernameSecrets` | Defines SNMPv3 secrets for trap messages sent by SNMP device | |
165165
| `securityEngineId` | SNMP Engine ID of the TRAP sending application | `80003a8c04` |
166166
| `aggregateTrapsEvents` | Enables collecting traps events as one event inside Splunk | `false` |
167+
| `includeSecurityContextId` | Controls whether to add the context_engine_id field to v3 trap events | `false` |
167168
| `communities` | Defines a version of SNMP protocol and SNMP community string | |
168169
| `service.annotations` | Annotations to append under traps service | |
169170
| `service.usemetallb` | Enables using metallb | `true` |

rendered/manifests/tests/splunk-connect-for-snmp/templates/traps/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ spec:
6868
value: "8088"
6969
- name: SPLUNK_HEC_INSECURESSL
7070
value: "true"
71+
- name: INCLUDE_SECURITY_CONTEXT_ID
72+
value: "false"
7173
- name: SNMP_V3_SECURITY_ENGINE_ID
7274
value: 80003a8c04
7375
- name: SPLUNK_HEC_TOKEN

rendered/manifests/tests_autoscaling_enabled/splunk-connect-for-snmp/templates/traps/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ spec:
6767
value: "8088"
6868
- name: SPLUNK_HEC_INSECURESSL
6969
value: "true"
70+
- name: INCLUDE_SECURITY_CONTEXT_ID
71+
value: "false"
7072
- name: SNMP_V3_SECURITY_ENGINE_ID
7173
value: 80003a8c04
7274
- name: SPLUNK_HEC_TOKEN

0 commit comments

Comments
 (0)