Skip to content

Commit

Permalink
akamai - add api emulator for realistic testing
Browse files Browse the repository at this point in the history
This simulates the Akamai SIEM API. It provides realistic validation of
request signatures. It emulates the time and offset based queries by
simulating a world in which a new event happens every 5 minutes. The
offset cursor is simply the unix time in sec of the last returned event.

This is a reproducer for the issues described in #9038. Those issues
only occur on Elastic Agent < 8.11.0.
  • Loading branch information
andrewkroh committed Feb 2, 2024
1 parent 24edad8 commit 6342440
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
5 changes: 5 additions & 0 deletions packages/akamai/_dev/deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM golang:1.21

RUN go install github.com/andrewkroh/go-examples/akamai-siem-simulator@4e9a10a

CMD akamai-siem-simulator -h
21 changes: 11 additions & 10 deletions packages/akamai/_dev/deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
version: '2.3'
services:
akamai:
image: docker.elastic.co/observability/stream:v0.6.1
akamai-siem-emulator:
hostname: akamai-siem-emulator
build:
context: .
dockerfile: Dockerfile
ports:
- 8080
volumes:
- ./files:/files:ro
environment:
PORT: 8080
- 9903
command:
- http-server
- --addr=:8080
- --config=/files/config.yml
- akamai-siem-simulator
- -http=:9903
- -access-token=at-6b8c7217-8748-490d-b0f5-bfeb72b2e7cd
- -client-secret=cs-0d15cfd9-764a-48e6-a822-22756180ddb8
- -client-token=ct-f625f0b8-9c8f-44ce-8250-eaf17bc93051

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
input: httpjson
service: akamai-siem-emulator
vars: ~
data_stream:
vars:
preserve_original_event: true
api_host: "http://akamai-siem-emulator:9903"
client_token: ct-f625f0b8-9c8f-44ce-8250-eaf17bc93051
client_secret: cs-0d15cfd9-764a-48e6-a822-22756180ddb8
access_token: at-6b8c7217-8748-490d-b0f5-bfeb72b2e7cd
config_ids: 123456
event_limit: 20
enable_request_tracer: true
assert:
# 24 hours at 5 minutes between events.
hit_count: 288 # = 24 * 60/5

0 comments on commit 6342440

Please sign in to comment.