Skip to content

Commit 42d4936

Browse files
committed
Update Blog “integrating-hpe-greenlake-webhooks-with-splunk”
1 parent 54e6c6d commit 42d4936

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

content/blog/integrating-hpe-greenlake-webhooks-with-splunk.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@ li {
1515
max-width: none;
1616
}
1717
</style>
18-
# Overview
18+
## Overview
1919

2020
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.
2121

22-
# What you’ll learn
22+
## What you’ll learn
2323

2424
* How to set up Splunk to receive data from HPE GreenLake
2525
* How to handle HPE GreenLake's security requirements
2626
* How to build a helper app that makes everything work together
2727
* How to test and monitor your setup
2828

29-
# Overview of Splunk HTTP Event Collector (HEC)
29+
## Overview of Splunk HTTP Event Collector (HEC)
3030

3131
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.
3232

33-
## Key features of HEC
33+
### Key features of HEC
3434

3535
* 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)
3636
* Secure communication: Supports both HTTP and HTTPS protocols for data transmission
3737
* API key support: Provides secure authentication mechanisms that align perfectly with HPE GreenLake's security requirements
3838
* Flexible data formats: Accepts both JSON-formatted events and raw text data
3939

40-
# Overview of HPE GreenLake webhooks
40+
## Overview of HPE GreenLake webhooks
4141

4242
[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/).
4343

44-
## HPE GreenLake webhook security features:
44+
### HPE GreenLake webhook security features:
4545

4646
HPE GreenLake implements robust security measures to ensure webhook authenticity:
4747

@@ -65,15 +65,15 @@ Challenge Request Example:
6565
}
6666
```
6767

68-
# Challenges and solutions
68+
## Challenges and solutions
6969

7070
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.
7171

72-
## A challenge
72+
### A challenge
7373

7474
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.
7575

76-
## The solution
76+
### The solution
7777

7878
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:
7979

@@ -82,7 +82,7 @@ This is where [Splunk's custom REST endpoints](https://dev.splunk.com/enterprise
8282
3. Responds appropriately to complete the verification
8383
4. Forwards validated event data to HEC for ingestion
8484

85-
# Custom REST endpoints in Splunk
85+
## Custom REST endpoints in Splunk
8686

8787
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.
8888

@@ -92,24 +92,25 @@ Key benefits of our integration:
9292
* Custom logic implementation: Handler code implements HPE GreenLake's specific validation requirements
9393
* Centralized management: Provides a single endpoint for webhook management
9494

95-
# Where to configure the endpoint handler: Splunk Enterprise vs Splunk Cloud
95+
## Where to configure the endpoint handler: Splunk Enterprise vs Splunk Cloud
9696

9797
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.
9898

9999
Splunk Cloud Platform is the Software as a Service (SaaS) offering, where the Splunk platform is hosted, managed, and maintained by Splunk.
100100

101-
## For Splunk Enterprise
101+
### For Splunk Enterprise
102102

103103
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.
104104

105-
For Splunk Cloud\
105+
### For Splunk Cloud
106+
106107
[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.
107108

108-
# Sample Python app for validation
109+
## Sample Python handler
109110

110111
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.
111112

112-
## Directory structure
113+
### Directory structure
113114

114115
`splunk_hpe_webhook_app/
115116
├── bin/
@@ -120,7 +121,7 @@ Let's create a custom REST endpoint handler in Python to handle the HPE GreenLak
120121
└── metadata/
121122
└── default.meta`
122123

123-
## Python handler (bin/hpe_webhook_handler.py)
124+
### Python handler (bin/hpe_webhook_handler.py)
124125

125126
```python
126127
import os
@@ -231,9 +232,9 @@ class HPEWebhookHandler(BaseRestHandler):
231232
self.response.write(json.dumps({"error": message}))
232233
```
233234

234-
## Configuration files
235+
### Configuration files
235236

236-
### default/restmap.conf
237+
#### default/restmap.conf
237238

238239
`[script:hpe_webhook_handler]`
239240
`match = /hpe/webhook`
@@ -246,20 +247,20 @@ class HPEWebhookHandler(BaseRestHandler):
246247
`passHttpHeaders = true`
247248
`passHttpCookies = false`
248249

249-
### default/web.conf
250+
#### default/web.conf
250251

251252
`[expose:hpe_webhook_handler]
252253
pattern = hpe/webhook
253254
methods = POST`
254255

255-
### metadata/default.meta
256+
#### metadata/default.meta
256257

257258
`[restmap/hpe_webhook_handler]
258259
export = system
259260
[views]
260261
export = system`
261262

262-
# Configuring Splunk HTTP Event Collector (HEC)
263+
## Configuring Splunk HTTP Event Collector (HEC)
263264

264265
You need to create an API token to use HEC via its API. You can do this from:
265266

@@ -283,7 +284,7 @@ This allows you to get your HEC endpoint, which is used in the Python handler to
283284

284285
 Don’t forget to modify the Python handler (shown above) line 7 accordingly.
285286

286-
# Final integration flow
287+
## Final integration flow
287288

288289
The complete integration flow works as follows:
289290

@@ -310,7 +311,7 @@ The complete integration flow works as follows:
310311
`Events     Challenge       Verify   Ingest   Analyze`
311312
` Response       Signature   Data Visualize`
312313

313-
# Benefits of this architecture
314+
## Benefits of this architecture
314315

315316
Security: The custom endpoint handler ensures only validated, authentic events reach your Splunk environment.
316317

@@ -320,7 +321,7 @@ Scalability: The solution can handle multiple webhook types and route them to di
320321

321322
Monitoring: All webhook interactions are logged within Splunk for troubleshooting and monitoring.
322323

323-
# Testing and deployment
324+
## Testing and deployment
324325

325326
Testing the integration
326327

@@ -334,7 +335,7 @@ Testing the integration
334335
3. Challenge validation: Monitor Splunk logs to ensure the challenge request is handled correctly.
335336
4. Event flow testing: Trigger test events from HPE GreenLake and verify they appear in your Splunk index.
336337

337-
# Conclusion
338+
## Conclusion
338339

339340
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:
340341

0 commit comments

Comments
 (0)