You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/integrating-hpe-greenlake-webhooks-with-splunk.md
+26-25Lines changed: 26 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,33 +15,33 @@ li {
15
15
max-width: none;
16
16
}
17
17
</style>
18
-
# Overview
18
+
##Overview
19
19
20
20
This guide shows you how to connect HPE GreenLake webhooks with [Splunk](https://www.splunk.com/). Splunk is a data platform that collects, indexes, and analyzes machine-generated data to provide insights for various purposes, including security monitoring, IT operations, and business analytics. When the two are connected, you will be able to see your HPE GreenLake events through Splunk for improved data monitoring and analysis.
21
21
22
-
# What you’ll learn
22
+
##What you’ll learn
23
23
24
24
* How to set up Splunk to receive data from HPE GreenLake
25
25
* How to handle HPE GreenLake's security requirements
26
26
* How to build a helper app that makes everything work together
27
27
* How to test and monitor your setup
28
28
29
-
# Overview of Splunk HTTP Event Collector (HEC)
29
+
##Overview of Splunk HTTP Event Collector (HEC)
30
30
31
31
The [HTTP Event Collector (HEC)](https://dev.splunk.com/enterprise/docs/devtools/httpeventcollector/) is a Splunk feature that lets you send data and application events to a Splunk deployment over the HTTP and Secure HTTP (HTTPS) protocols. HEC uses a token-based authentication model. You can generate a token and then configure a logging library or HTTP client with the token to send data to HEC in a specific format.
32
32
33
-
## Key features of HEC
33
+
###Key features of HEC
34
34
35
35
* Token-based authentication: Each token has a unique value, which is a 128-bit number that is represented as a 32-character globally unique identifier (GUID)
36
36
* Secure communication: Supports both HTTP and HTTPS protocols for data transmission
37
37
* API key support: Provides secure authentication mechanisms that align perfectly with HPE GreenLake's security requirements
38
38
* Flexible data formats: Accepts both JSON-formatted events and raw text data
39
39
40
-
# Overview of HPE GreenLake webhooks
40
+
##Overview of HPE GreenLake webhooks
41
41
42
42
[HPE GreenLake webhooks](https://developer.greenlake.hpe.com/docs/greenlake/services/event/public/webhooks/) facilitate automated, real-time communication between HPE GreenLake cloud services and an external service of your choosing. For example, a webhook could notify your IT Operation Management platform when a new audit log is created, or when subscriptions are about to expire. A getting started guide to HPE GreenLake webhooks is available [here](https://developer.hpe.com/blog/getting-started-with-the-hpe-greenlake-cloud-eventing-framework/).
43
43
44
-
## HPE GreenLake webhook security features:
44
+
###HPE GreenLake webhook security features:
45
45
46
46
HPE GreenLake implements robust security measures to ensure webhook authenticity:
47
47
@@ -65,15 +65,15 @@ Challenge Request Example:
65
65
}
66
66
```
67
67
68
-
# Challenges and solutions
68
+
##Challenges and solutions
69
69
70
70
The primary challenge in integrating HPE GreenLake webhooks with Splunk HEC lies in the webhook verification process. The destination must read the value from the challengeRequest field and create an HMAC SHA-256 hash, using the webhook secret as salt and the challengeRequest value as a string to hash. When successful, the destination responds with a JSON object with the format {"verification": "CREATED_HASH"} and a HTTP 200 OK status.
71
71
72
-
## A challenge
72
+
###A challenge
73
73
74
74
Splunk's HEC endpoint is designed for data ingestion and doesn't natively support the challenge-response mechanism required by HPE GreenLake webhooks. HEC expects to receive event data directly and cannot handle the initial verification handshake.
75
75
76
-
## The solution
76
+
###The solution
77
77
78
78
This is where [Splunk's custom REST endpoints](https://dev.splunk.com/enterprise/docs/devtools/customrestendpoints/) capability becomes invaluable. A custom REST endpoint is a developer-defined endpoint and associated handler that lets you build out the Splunk REST API to meet your specific needs. We can create a custom endpoint handler that:
79
79
@@ -82,7 +82,7 @@ This is where [Splunk's custom REST endpoints](https://dev.splunk.com/enterprise
82
82
3. Responds appropriately to complete the verification
83
83
4. Forwards validated event data to HEC for ingestion
84
84
85
-
# Custom REST endpoints in Splunk
85
+
##Custom REST endpoints in Splunk
86
86
87
87
Splunk's custom REST endpoints provide powerful extensibility for scenarios exactly like ours. You use a custom endpoint to add a special feature that Splunk doesn't have built-in, like, in our case, handling the unique secret handshake from HPE GreenLake.
88
88
@@ -92,24 +92,25 @@ Key benefits of our integration:
* Centralized management: Provides a single endpoint for webhook management
94
94
95
-
# Where to configure the endpoint handler: Splunk Enterprise vs Splunk Cloud
95
+
##Where to configure the endpoint handler: Splunk Enterprise vs Splunk Cloud
96
96
97
97
Splunk Enterprise is the self-hosted version that an organization deploys and manages on its own infrastructure, either on-premises (on-prem) or in a private cloud.
98
98
99
99
Splunk Cloud Platform is the Software as a Service (SaaS) offering, where the Splunk platform is hosted, managed, and maintained by Splunk.
100
100
101
-
## For Splunk Enterprise
101
+
###For Splunk Enterprise
102
102
103
103
You can install and configure the endpoint handler directly on your Splunk Enterprise instance by placing it in the etc/apps/ directory and following the steps in this guide. Splunk Enterprise supports custom REST endpoints out of the box.
104
104
105
-
For Splunk Cloud\
105
+
### For Splunk Cloud
106
+
106
107
[Splunk Cloud has extra security controls](https://docs.splunk.com/Documentation/SplunkCloud/latest/RESTTUT/RESTandCloud), so you might need to take additional steps to allow your helper to communicate with the Splunk REST API.
107
108
108
-
# Sample Python app for validation
109
+
##Sample Python handler
109
110
110
111
Let's create a custom REST endpoint handler in Python to handle the HPE GreenLake webhook validation and forwards events to Splunk HEC, once validated.
111
112
112
-
## Directory structure
113
+
###Directory structure
113
114
114
115
`splunk_hpe_webhook_app/
115
116
├── bin/
@@ -120,7 +121,7 @@ Let's create a custom REST endpoint handler in Python to handle the HPE GreenLak
120
121
└── metadata/
121
122
└── default.meta`
122
123
123
-
## Python handler (bin/hpe_webhook_handler.py)
124
+
###Python handler (bin/hpe_webhook_handler.py)
124
125
125
126
```python
126
127
import os
@@ -231,9 +232,9 @@ class HPEWebhookHandler(BaseRestHandler):
@@ -246,20 +247,20 @@ class HPEWebhookHandler(BaseRestHandler):
246
247
`passHttpHeaders = true`
247
248
`passHttpCookies = false`
248
249
249
-
### default/web.conf
250
+
####default/web.conf
250
251
251
252
`[expose:hpe_webhook_handler]
252
253
pattern = hpe/webhook
253
254
methods = POST`
254
255
255
-
### metadata/default.meta
256
+
####metadata/default.meta
256
257
257
258
`[restmap/hpe_webhook_handler]
258
259
export = system
259
260
[views]
260
261
export = system`
261
262
262
-
# Configuring Splunk HTTP Event Collector (HEC)
263
+
##Configuring Splunk HTTP Event Collector (HEC)
263
264
264
265
You need to create an API token to use HEC via its API. You can do this from:
265
266
@@ -283,7 +284,7 @@ This allows you to get your HEC endpoint, which is used in the Python handler to
283
284
284
285
Don’t forget to modify the Python handler (shown above) line 7 accordingly.
285
286
286
-
# Final integration flow
287
+
##Final integration flow
287
288
288
289
The complete integration flow works as follows:
289
290
@@ -310,7 +311,7 @@ The complete integration flow works as follows:
310
311
`Events Challenge Verify Ingest Analyze`
311
312
` Response Signature Data Visualize`
312
313
313
-
# Benefits of this architecture
314
+
##Benefits of this architecture
314
315
315
316
Security: The custom endpoint handler ensures only validated, authentic events reach your Splunk environment.
316
317
@@ -320,7 +321,7 @@ Scalability: The solution can handle multiple webhook types and route them to di
320
321
321
322
Monitoring: All webhook interactions are logged within Splunk for troubleshooting and monitoring.
322
323
323
-
# Testing and deployment
324
+
##Testing and deployment
324
325
325
326
Testing the integration
326
327
@@ -334,7 +335,7 @@ Testing the integration
334
335
3. Challenge validation: Monitor Splunk logs to ensure the challenge request is handled correctly.
335
336
4. Event flow testing: Trigger test events from HPE GreenLake and verify they appear in your Splunk index.
336
337
337
-
# Conclusion
338
+
##Conclusion
338
339
339
340
Integrating HPE GreenLake webhooks with Splunk via HTTP Event Collector presents unique challenges due to the webhook verification requirements, but Splunk's custom REST endpoints capabilities provide an elegant solution. Such integration offers several key benefits:
0 commit comments