-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[akamai] add api emulator for realistic testing (#9042)
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
1 parent
4555126
commit c048a13
Showing
7 changed files
with
39 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-emulator@80b18780e7 | ||
|
||
CMD akamai-siem-emulator -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-emulator | ||
- -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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
packages/akamai/data_stream/siem/_dev/test/system/test-default-config.yml
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
packages/akamai/data_stream/siem/_dev/test/system/test-emulator-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters