diff --git a/packages/akamai/_dev/build/build.yml b/packages/akamai/_dev/build/build.yml new file mode 100644 index 000000000000..08d85edcf9a4 --- /dev/null +++ b/packages/akamai/_dev/build/build.yml @@ -0,0 +1,3 @@ +dependencies: + ecs: + reference: git@1.12 diff --git a/packages/akamai/_dev/build/docs/README.md b/packages/akamai/_dev/build/docs/README.md new file mode 100644 index 000000000000..9a52dac1e1ef --- /dev/null +++ b/packages/akamai/_dev/build/docs/README.md @@ -0,0 +1,17 @@ +# Akamai Integration + +The Akamai integration collects events from the Akamai API, specifically reading from the [Akamai SIEM API](https://techdocs.akamai.com/siem-integration/reference/api). + +## Logs + +### SIEM + +The Security Information and Event Management API allows you to capture security events generated on the ​Akamai​ platform in your SIEM application. + +Use this API to get security event data generated on the ​Akamai​ platform and correlate it with data from other sources in your SIEM solution. Capture security event data incrementally, or replay missed security events from the past 12 hours. You can store, query, and analyze the data delivered through this API on your end, then go back and adjust your Akamai security settings. If you’re coding your own SIEM connector, it needs to adhere to these specifications in order to pull in security events from Akamai Security Events Collector (ASEC) and process them properly. + +See https://techdocs.akamai.com/siem-integration/reference/api-get-started to setup your Akamai account and obtain your credentials + +{{fields "siem"}} + +{{event "siem"}} \ No newline at end of file diff --git a/packages/akamai/_dev/deploy/docker/docker-compose.yml b/packages/akamai/_dev/deploy/docker/docker-compose.yml new file mode 100644 index 000000000000..6f0dc33289aa --- /dev/null +++ b/packages/akamai/_dev/deploy/docker/docker-compose.yml @@ -0,0 +1,14 @@ +version: '2.3' +services: + akamai: + image: docker.elastic.co/observability/stream:v0.6.1 + ports: + - 8080 + volumes: + - ./files:/files:ro + environment: + PORT: 8080 + command: + - http-server + - --addr=:8080 + - --config=/files/config.yml diff --git a/packages/akamai/_dev/deploy/docker/files/config.yml b/packages/akamai/_dev/deploy/docker/files/config.yml new file mode 100644 index 000000000000..c9e173a28d62 --- /dev/null +++ b/packages/akamai/_dev/deploy/docker/files/config.yml @@ -0,0 +1,25 @@ +rules: + - path: /siem/v1/configs/aaaa + methods: ["GET"] + request_headers: + authorization: ["EG1-HMAC-SHA256 client_token=qwerasdf;access_token=abcd;timestamp=\\d{8}T(\\d{2}:){2}\\d{2}\\+0000;nonce=[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12};signature=.*"] + query_params: + offset: "abcd" + responses: + - status_code: 200 + body: |- + {"format":"json","type":"akamai_siem","version":"1.0","attackData":{"clientIP":"52.91.36.10","configId":"14227","policyId":"qik1_26545","ruleActions":"YWxlcnQ%3d%3bYWxlcnQ%3d%3bZGVueQ%3d%3d","ruleData":"dGVsbmV0LmV4ZQ%3d%3d%3bdGVsbmV0LmV4ZQ%3d%3d%3bVmVjdG9yIFNjb3JlOiAxMCwgREVOWSB0aHJlc2hvbGQ6IDksIEFsZX ","ruleMessages":"U3lzdGVtIENvbW1hbmQgQWNjZXNz%3bU3lzdGVtIENvbW1hbmQgSW5qZWN0aW9u%3bQW5vbWFseSBTY29yZSBFeGNlZWRlZCBmb3 ","ruleSelectors":"QVJHUzpvcHRpb24%3d%3bQVJHUzpvcHRpb24%3d%3b","ruleTags":"T1dBU1BfQ1JTL1dFQl9BVFRBQ0svRklMRV9JTkpFQ1RJT04%3d%3bT1dBU1BfQ1JTL1dFQl9BVFRBQ0svQ09NTUFORF9JTkpFQ1R ","ruleVersions":"NA%3d%3d%3bNA%3d%3d%3bMQ%3d%3d","rules":"OTUwMDAy%3bOTUwMDA2%3bQ01ELUlOSkVDVElPTi1BTk9NQUxZ"},"geo":{"asn":"14618","city":"ASHBURN","continent":"288","country":"US","regionCode":"VA"},"httpMessage":{"bytes":"266","host":"www.hmapi.com","method":"GET","path":"/","port":"80","protocol":"HTTP/1.1","query":"option=com_jce%20telnet.exe","requestHeaders":"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml","requestId":"1158db1758e37bfe67b7c091","responseHeaders":"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml%0d%0aContent-Length%3a%20150","start":"1491303422","status":"200"},"userRiskData":{"uuid":"964d54b7-0821-413a-a4d6-8131770ec8d5","status":"0","score":"75","risk":"udfp:1325gdg4g4343g/M|unp:74256/H","trust":"ugp:US","general":"duc_1h:10|duc_1d:30","allow":"0"},"clientData":{"appBundleId":"com.mydomain.myapp","appVersion":"1.23","sdkVersion":"4.7.1","telemetryType":"2"},"botData":{"botScore":"100","responseSegment":"3"}} + {"format":"json","type":"akamai_siem","version":"1.0","attackData":{"clientIP":"52.91.36.10","configId":"6724","policyId":"scoe_5426","ruleActions":"QUxFUlQ;REVOWQ==","ruleData":"YWxlcnQo;Y3VybA==","ruleMessages":"Q3Jvc3Mtc2l0ZSBTY3 JpcHRpbmcgKFhTUykgQXR0YWNr; UmVxdWVzdCBJbmRpY2F0ZXMgYW4 gYXV0b21hdGVkIHByb2 dyYW0gZXhwbG9yZWQgdGhlIHNpdGU=","ruleSelectors":"QVJHUzph;UkVRVUVTVF9IRU FERVJTOlVzZXItQWdlbnQ=","ruleTags":"V0VCX0FUVEFDSy9YU1M=;QV VUT01BVElPTi9NSVND","ruleVersions":";","rules":"OTUwMDA0;OTkwMDEx"},"geo":{"asn":"12271","city":"NEWYORK","continent":"NA","country":"US","regionCode":"NY"},"httpMessage":{"bytes":"34523","host":"www.example.com","method":"POST","path":"/examples/1/","port":"80","protocol":"http/2","query":"a%3D..%2F..%2F..%2Fetc%2Fpasswd","requestHeaders":"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml","requestId":"2ab418ac8515f331","responseHeaders":"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml","start":"1470923133.026","status":"301","tls": "TLSv1.2"},"userRiskData":{"uuid":"964d54b7-0821-413a-a4d6-8131770ec8d5","status":"0","score":"75","risk":"udfp:1325gdg4g4343g/M|unp:74256/H","trust":"ugp:US","general":"duc_1h:10|duc_1d:30","allow":"0"},"clientData":{"appBundleId":"com.mydomain.myapp","appVersion":"1.23","sdkVersion":"4.7.1","telemetryType":"2"},"botData":{"botScore":"100","responseSegment":"3"}} + - path: /siem/v1/configs/aaaa + methods: ["GET"] + request_headers: + authorization: ["EG1-HMAC-SHA256 client_token=qwerasdf;access_token=abcd;timestamp=\\d{8}T(\\d{2}:){2}\\d{2}\\+0000;nonce=[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12};signature=.*"] + query_params: + to: "{to:.*}" + from: "{from:.*}" + responses: + - status_code: 200 + body: |- + {"format":"json","type":"akamai_siem","version":"1.0","attackData":{"clientIP":"52.91.36.10","configId":"14227","policyId":"qik1_26545","ruleActions":"YWxlcnQ%3d%3bYWxlcnQ%3d%3bZGVueQ%3d%3d","ruleData":"dGVsbmV0LmV4ZQ%3d%3d%3bdGVsbmV0LmV4ZQ%3d%3d%3bVmVjdG9yIFNjb3JlOiAxMCwgREVOWSB0aHJlc2hvbGQ6IDksIEFsZX ","ruleMessages":"U3lzdGVtIENvbW1hbmQgQWNjZXNz%3bU3lzdGVtIENvbW1hbmQgSW5qZWN0aW9u%3bQW5vbWFseSBTY29yZSBFeGNlZWRlZCBmb3 ","ruleSelectors":"QVJHUzpvcHRpb24%3d%3bQVJHUzpvcHRpb24%3d%3b","ruleTags":"T1dBU1BfQ1JTL1dFQl9BVFRBQ0svRklMRV9JTkpFQ1RJT04%3d%3bT1dBU1BfQ1JTL1dFQl9BVFRBQ0svQ09NTUFORF9JTkpFQ1R ","ruleVersions":"NA%3d%3d%3bNA%3d%3d%3bMQ%3d%3d","rules":"OTUwMDAy%3bOTUwMDA2%3bQ01ELUlOSkVDVElPTi1BTk9NQUxZ"},"geo":{"asn":"14618","city":"ASHBURN","continent":"288","country":"US","regionCode":"VA"},"httpMessage":{"bytes":"266","host":"www.hmapi.com","method":"GET","path":"/","port":"80","protocol":"HTTP/1.1","query":"option=com_jce%20telnet.exe","requestHeaders":"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml","requestId":"1158db1758e37bfe67b7c09","responseHeaders":"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml%0d%0aContent-Length%3a%20150","start":"1491303422","status":"200"},"userRiskData":{"uuid":"964d54b7-0821-413a-a4d6-8131770ec8d5","status":"0","score":"75","risk":"udfp:1325gdg4g4343g/M|unp:74256/H","trust":"ugp:US","general":"duc_1h:10|duc_1d:30","allow":"0"},"clientData":{"appBundleId":"com.mydomain.myapp","appVersion":"1.23","sdkVersion":"4.7.1","telemetryType":"2"},"botData":{"botScore":"100","responseSegment":"3"}} + {"format":"json","type":"akamai_siem","version":"1.0","attackData":{"clientIP":"52.91.36.10","configId":"6724","policyId":"scoe_5426","ruleActions":"QUxFUlQ;REVOWQ==","ruleData":"YWxlcnQo;Y3VybA==","ruleMessages":"Q3Jvc3Mtc2l0ZSBTY3 JpcHRpbmcgKFhTUykgQXR0YWNr; UmVxdWVzdCBJbmRpY2F0ZXMgYW4 gYXV0b21hdGVkIHByb2 dyYW0gZXhwbG9yZWQgdGhlIHNpdGU=","ruleSelectors":"QVJHUzph;UkVRVUVTVF9IRU FERVJTOlVzZXItQWdlbnQ=","ruleTags":"V0VCX0FUVEFDSy9YU1M=;QV VUT01BVElPTi9NSVND","ruleVersions":";","rules":"OTUwMDA0;OTkwMDEx"},"geo":{"asn":"12271","city":"NEWYORK","continent":"NA","country":"US","regionCode":"NY"},"httpMessage":{"bytes":"34523","host":"www.example.com","method":"POST","path":"/examples/1/","port":"80","protocol":"http/2","query":"a%3D..%2F..%2F..%2Fetc%2Fpasswd","requestHeaders":"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml","requestId":"2ab418ac8515f33","responseHeaders":"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml","start":"1470923133.026","status":"301","tls": "TLSv1.2"},"userRiskData":{"uuid":"964d54b7-0821-413a-a4d6-8131770ec8d5","status":"0","score":"75","risk":"udfp:1325gdg4g4343g/M|unp:74256/H","trust":"ugp:US","general":"duc_1h:10|duc_1d:30","allow":"0"},"clientData":{"appBundleId":"com.mydomain.myapp","appVersion":"1.23","sdkVersion":"4.7.1","telemetryType":"2"},"botData":{"botScore":"100","responseSegment":"3"}} + {"total":3,"offset":"abcd","limit":3} diff --git a/packages/akamai/changelog.yml b/packages/akamai/changelog.yml new file mode 100644 index 000000000000..479af17e740b --- /dev/null +++ b/packages/akamai/changelog.yml @@ -0,0 +1,6 @@ +# newer versions go on top +- version: "0.1.0" + changes: + - description: initial release + type: enhancement # can be one of: enhancement, bugfix, breaking-change + link: https://github.com/elastic/integrations/pull/1643 diff --git a/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log b/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log new file mode 100644 index 000000000000..116fc6180a18 --- /dev/null +++ b/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log @@ -0,0 +1,3 @@ +{"format":"json","type":"akamai_siem","version":"1.0","attackData":{"clientIP":"52.91.36.10","configId":"14227","policyId":"qik1_26545","ruleActions":"YWxlcnQ%3d%3bYWxlcnQ%3d%3bZGVueQ%3d%3d","ruleData":"dGVsbmV0LmV4ZQ%3d%3d%3bdGVsbmV0LmV4ZQ%3d%3d%3bVmVjdG9yIFNjb3JlOiAxMCwgREVOWSB0aHJlc2hvbGQ6IDksIEFsZX ","ruleMessages":"U3lzdGVtIENvbW1hbmQgQWNjZXNz%3bU3lzdGVtIENvbW1hbmQgSW5qZWN0aW9u%3bQW5vbWFseSBTY29yZSBFeGNlZWRlZCBmb3 ","ruleSelectors":"QVJHUzpvcHRpb24%3d%3bQVJHUzpvcHRpb24%3d%3b","ruleTags":"T1dBU1BfQ1JTL1dFQl9BVFRBQ0svRklMRV9JTkpFQ1RJT04%3d%3bT1dBU1BfQ1JTL1dFQl9BVFRBQ0svQ09NTUFORF9JTkpFQ1R ","ruleVersions":"NA%3d%3d%3bNA%3d%3d%3bMQ%3d%3d","rules":"OTUwMDAy%3bOTUwMDA2%3bQ01ELUlOSkVDVElPTi1BTk9NQUxZ"},"geo":{"asn":"14618","city":"ASHBURN","continent":"288","country":"US","regionCode":"VA"},"httpMessage":{"bytes":"266","host":"www.hmapi.com","method":"GET","path":"/","port":"80","protocol":"HTTP/1.1","query":"option=com_jce%20telnet.exe","requestHeaders":"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml","requestId":"1158db1758e37bfe67b7c09","responseHeaders":"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml%0d%0aContent-Length%3a%20150","start":"1491303422","status":"200"},"userRiskData":{"uuid":"964d54b7-0821-413a-a4d6-8131770ec8d5","status":"0","score":"75","risk":"udfp:1325gdg4g4343g/M|unp:74256/H","trust":"ugp:US","general":"duc_1h:10|duc_1d:30","allow":"0"},"clientData":{"appBundleId":"com.mydomain.myapp","appVersion":"1.23","sdkVersion":"4.7.1","telemetryType":"2"},"botData":{"botScore":"100","responseSegment":"3"}} +{"format":"json","type":"akamai_siem","version":"1.0","attackData":{"clientIP":"52.91.36.10","configId":"6724","policyId":"scoe_5426","ruleActions":"QUxFUlQ;REVOWQ==","ruleData":"YWxlcnQo;Y3VybA==","ruleMessages":"Q3Jvc3Mtc2l0ZSBTY3 JpcHRpbmcgKFhTUykgQXR0YWNr; UmVxdWVzdCBJbmRpY2F0ZXMgYW4 gYXV0b21hdGVkIHByb2 dyYW0gZXhwbG9yZWQgdGhlIHNpdGU=","ruleSelectors":"QVJHUzph;UkVRVUVTVF9IRU FERVJTOlVzZXItQWdlbnQ=","ruleTags":"V0VCX0FUVEFDSy9YU1M=;QV VUT01BVElPTi9NSVND","ruleVersions":";","rules":"OTUwMDA0;OTkwMDEx"},"geo":{"asn":"12271","city":"NEWYORK","continent":"NA","country":"US","regionCode":"NY"},"httpMessage":{"bytes":"34523","host":"www.example.com","method":"POST","path":"/examples/1/","port":"80","protocol":"http/2","query":"a%3D..%2F..%2F..%2Fetc%2Fpasswd","requestHeaders":"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml","requestId":"2ab418ac8515f33","responseHeaders":"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml","start":"1470923133.026","status":"301","tls": "TLSv1.2"},"userRiskData":{"uuid":"964d54b7-0821-413a-a4d6-8131770ec8d5","status":"0","score":"75","risk":"udfp:1325gdg4g4343g/M|unp:74256/H","trust":"ugp:US","general":"duc_1h:10|duc_1d:30","allow":"0"},"clientData":{"appBundleId":"com.mydomain.myapp","appVersion":"1.23","sdkVersion":"4.7.1","telemetryType":"2"},"botData":{"botScore":"100","responseSegment":"3"}} +{"total":10000,"offset":"71cca;3phZmEdPj6YEqml0rvbdWDZGW3mCiJIwjyhkJfsLFM2gVYPgE8-N_0CiLI9gwH0_4OJ87xDQ3b-gIsx_kEBdf7aaC_AvDpG9fMxypeaCma10FKrY9VKE","limit":10000} \ No newline at end of file diff --git a/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log-config.yml b/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log-config.yml new file mode 100644 index 000000000000..a09fe07263c9 --- /dev/null +++ b/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log-config.yml @@ -0,0 +1,5 @@ +fields: + tags: + - preserve_original_event +dynamic_fields: + event.ingested: "^.*$" diff --git a/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log-expected.json b/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log-expected.json new file mode 100644 index 000000000000..62a0e30999df --- /dev/null +++ b/packages/akamai/data_stream/siem/_dev/test/pipeline/test-http-json.log-expected.json @@ -0,0 +1,331 @@ +{ + "expected": [ + { + "akamai": { + "siem": { + "client_data": { + "sdk_version": "4.7.1", + "app_version": "1.23", + "telemetry_type": 2, + "app_bundle_id": "com.mydomain.myapp" + }, + "request": { + "headers": { + "Accept": "text/html,application/xhtml xml", + "User-Agent": "BOT/0.1 (BOT for JCE)" + } + }, + "policy_id": "qik1_26545", + "config_id": "14227", + "response": { + "headers": { + "Server": "AkamaiGHost", + "Mime-Version": "1.0", + "Content-Length": "150", + "Content-Type": "text/html" + } + }, + "bot": { + "score": 100, + "response_segment": 3 + }, + "user_risk": { + "allow": 0, + "trust": { + "ugp": "US" + }, + "score": 75, + "general": { + "duc_1d": "30", + "duc_1h": "10" + }, + "risk": { + "unp": "74256/H", + "udfp": "1325gdg4g4343g/M" + }, + "uuid": "964d54b7-0821-413a-a4d6-8131770ec8d5", + "status": 0 + }, + "rules": [ + { + "ruleSelectors": "ARGS:option", + "ruleVersions": "4", + "ruleMessages": "System Command Access", + "ruleTags": "OWASP_CRS/WEB_ATTACK/FILE_INJECTION", + "ruleActions": "alert", + "rules": "950002", + "ruleData": "telnet.exe" + }, + { + "ruleSelectors": "ARGS:option", + "ruleVersions": "4", + "ruleMessages": "System Command Injection", + "ruleTags": "OWASP_CRS/WEB_ATTACK/COMMAND_INJECT", + "ruleActions": "alert", + "rules": "950006", + "ruleData": "telnet.exe" + }, + { + "ruleVersions": "1", + "rules": "CMD-INJECTION-ANOMALY", + "ruleMessages": "Anomaly Score Exceeded fo", + "ruleData": "Vector Score: 10, DENY threshold: 9, Ale", + "ruleActions": "deny" + } + ] + } + }, + "source": { + "geo": { + "continent_name": "North America", + "region_iso_code": "US-VA", + "city_name": "Ashburn", + "country_iso_code": "US", + "country_name": "United States", + "region_name": "Virginia", + "location": { + "lon": -77.4728, + "lat": 39.0481 + } + }, + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "address": "52.91.36.10", + "ip": "52.91.36.10" + }, + "url": { + "path": "/", + "port": 80, + "domain": "www.hmapi.com", + "query": "option=com_jce telnet.exe", + "full": "www.hmapi.com/?option=com_jce%20telnet.exe" + }, + "tags": [ + "preserve_original_event" + ], + "network": { + "protocol": "http", + "transport": "tcp" + }, + "observer": { + "type": "proxy", + "vendor": "akamai" + }, + "@timestamp": "2017-04-04T10:57:02.000Z", + "ecs": { + "version": "1.12.0" + }, + "related": { + "ip": [ + "52.91.36.10" + ] + }, + "http": { + "request": { + "method": "GET", + "id": "1158db1758e37bfe67b7c09" + }, + "version": "1.1", + "response": { + "bytes": 266, + "status_code": 200 + } + }, + "client": { + "geo": { + "continent_name": "North America", + "region_iso_code": "US-VA", + "city_name": "Ashburn", + "country_iso_code": "US", + "country_name": "United States", + "region_name": "Virginia", + "location": { + "lon": -77.4728, + "lat": 39.0481 + } + }, + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "address": "52.91.36.10", + "ip": "52.91.36.10" + }, + "event": { + "start": "2017-04-04T10:57:02.000Z", + "ingested": "2021-12-08T14:29:59.364478822Z", + "original": "{\"format\":\"json\",\"type\":\"akamai_siem\",\"version\":\"1.0\",\"attackData\":{\"clientIP\":\"52.91.36.10\",\"configId\":\"14227\",\"policyId\":\"qik1_26545\",\"ruleActions\":\"YWxlcnQ%3d%3bYWxlcnQ%3d%3bZGVueQ%3d%3d\",\"ruleData\":\"dGVsbmV0LmV4ZQ%3d%3d%3bdGVsbmV0LmV4ZQ%3d%3d%3bVmVjdG9yIFNjb3JlOiAxMCwgREVOWSB0aHJlc2hvbGQ6IDksIEFsZX \",\"ruleMessages\":\"U3lzdGVtIENvbW1hbmQgQWNjZXNz%3bU3lzdGVtIENvbW1hbmQgSW5qZWN0aW9u%3bQW5vbWFseSBTY29yZSBFeGNlZWRlZCBmb3 \",\"ruleSelectors\":\"QVJHUzpvcHRpb24%3d%3bQVJHUzpvcHRpb24%3d%3b\",\"ruleTags\":\"T1dBU1BfQ1JTL1dFQl9BVFRBQ0svRklMRV9JTkpFQ1RJT04%3d%3bT1dBU1BfQ1JTL1dFQl9BVFRBQ0svQ09NTUFORF9JTkpFQ1R \",\"ruleVersions\":\"NA%3d%3d%3bNA%3d%3d%3bMQ%3d%3d\",\"rules\":\"OTUwMDAy%3bOTUwMDA2%3bQ01ELUlOSkVDVElPTi1BTk9NQUxZ\"},\"geo\":{\"asn\":\"14618\",\"city\":\"ASHBURN\",\"continent\":\"288\",\"country\":\"US\",\"regionCode\":\"VA\"},\"httpMessage\":{\"bytes\":\"266\",\"host\":\"www.hmapi.com\",\"method\":\"GET\",\"path\":\"/\",\"port\":\"80\",\"protocol\":\"HTTP/1.1\",\"query\":\"option=com_jce%20telnet.exe\",\"requestHeaders\":\"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml\",\"requestId\":\"1158db1758e37bfe67b7c09\",\"responseHeaders\":\"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml%0d%0aContent-Length%3a%20150\",\"start\":\"1491303422\",\"status\":\"200\"},\"userRiskData\":{\"uuid\":\"964d54b7-0821-413a-a4d6-8131770ec8d5\",\"status\":\"0\",\"score\":\"75\",\"risk\":\"udfp:1325gdg4g4343g/M|unp:74256/H\",\"trust\":\"ugp:US\",\"general\":\"duc_1h:10|duc_1d:30\",\"allow\":\"0\"},\"clientData\":{\"appBundleId\":\"com.mydomain.myapp\",\"appVersion\":\"1.23\",\"sdkVersion\":\"4.7.1\",\"telemetryType\":\"2\"},\"botData\":{\"botScore\":\"100\",\"responseSegment\":\"3\"}}", + "id": "1158db1758e37bfe67b7c09", + "category": "network", + "kind": "event" + } + }, + { + "akamai": { + "siem": { + "client_data": { + "sdk_version": "4.7.1", + "app_version": "1.23", + "telemetry_type": 2, + "app_bundle_id": "com.mydomain.myapp" + }, + "request": { + "headers": { + "Accept": "text/html,application/xhtml xml", + "User-Agent": "BOT/0.1 (BOT for JCE)" + } + }, + "policy_id": "scoe_5426", + "config_id": "6724", + "response": { + "headers": { + "Server": "AkamaiGHost", + "Mime-Version": "1.0", + "Content-Type": "text/html" + } + }, + "bot": { + "score": 100, + "response_segment": 3 + }, + "user_risk": { + "allow": 0, + "trust": { + "ugp": "US" + }, + "score": 75, + "general": { + "duc_1d": "30", + "duc_1h": "10" + }, + "risk": { + "unp": "74256/H", + "udfp": "1325gdg4g4343g/M" + }, + "uuid": "964d54b7-0821-413a-a4d6-8131770ec8d5", + "status": 0 + }, + "rules": [ + { + "ruleSelectors": "ARGS:a", + "rules": "950004", + "ruleMessages": "Cross-site Scripting (XSS) Attack", + "ruleTags": "WEB_ATTACK/XSS", + "ruleData": "alert(", + "ruleActions": "ALERT" + }, + { + "ruleSelectors": "REQUEST_HEADERS:User-Agent", + "rules": "990011", + "ruleMessages": "Request Indicates an automated program explored the site", + "ruleTags": "AUTOMATION/MISC", + "ruleData": "curl", + "ruleActions": "DENY" + } + ] + } + }, + "source": { + "geo": { + "continent_name": "North America", + "region_iso_code": "US-VA", + "city_name": "Ashburn", + "country_iso_code": "US", + "country_name": "United States", + "region_name": "Virginia", + "location": { + "lon": -77.4728, + "lat": 39.0481 + } + }, + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "address": "52.91.36.10", + "ip": "52.91.36.10" + }, + "url": { + "path": "/examples/1/", + "port": 80, + "domain": "www.example.com", + "query": "a=../../../etc/passwd", + "full": "www.example.com/examples/1/?a%3D..%2F..%2F..%2Fetc%2Fpasswd" + }, + "tags": [ + "preserve_original_event" + ], + "network": { + "protocol": "http", + "transport": "tcp" + }, + "observer": { + "type": "proxy", + "vendor": "akamai" + }, + "@timestamp": "2016-08-11T13:45:33.026Z", + "ecs": { + "version": "1.12.0" + }, + "related": { + "ip": [ + "52.91.36.10" + ] + }, + "http": { + "request": { + "method": "POST", + "id": "2ab418ac8515f33" + }, + "version": "2", + "response": { + "bytes": 34523, + "status_code": 301 + } + }, + "client": { + "geo": { + "continent_name": "North America", + "region_iso_code": "US-VA", + "city_name": "Ashburn", + "country_iso_code": "US", + "country_name": "United States", + "region_name": "Virginia", + "location": { + "lon": -77.4728, + "lat": 39.0481 + } + }, + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "address": "52.91.36.10", + "ip": "52.91.36.10" + }, + "tls": { + "version": "1.2", + "version_protocol": "tls" + }, + "event": { + "start": "2016-08-11T13:45:33.026Z", + "ingested": "2021-12-08T14:29:59.364485040Z", + "original": "{\"format\":\"json\",\"type\":\"akamai_siem\",\"version\":\"1.0\",\"attackData\":{\"clientIP\":\"52.91.36.10\",\"configId\":\"6724\",\"policyId\":\"scoe_5426\",\"ruleActions\":\"QUxFUlQ;REVOWQ==\",\"ruleData\":\"YWxlcnQo;Y3VybA==\",\"ruleMessages\":\"Q3Jvc3Mtc2l0ZSBTY3 JpcHRpbmcgKFhTUykgQXR0YWNr; UmVxdWVzdCBJbmRpY2F0ZXMgYW4 gYXV0b21hdGVkIHByb2 dyYW0gZXhwbG9yZWQgdGhlIHNpdGU=\",\"ruleSelectors\":\"QVJHUzph;UkVRVUVTVF9IRU FERVJTOlVzZXItQWdlbnQ=\",\"ruleTags\":\"V0VCX0FUVEFDSy9YU1M=;QV VUT01BVElPTi9NSVND\",\"ruleVersions\":\";\",\"rules\":\"OTUwMDA0;OTkwMDEx\"},\"geo\":{\"asn\":\"12271\",\"city\":\"NEWYORK\",\"continent\":\"NA\",\"country\":\"US\",\"regionCode\":\"NY\"},\"httpMessage\":{\"bytes\":\"34523\",\"host\":\"www.example.com\",\"method\":\"POST\",\"path\":\"/examples/1/\",\"port\":\"80\",\"protocol\":\"http/2\",\"query\":\"a%3D..%2F..%2F..%2Fetc%2Fpasswd\",\"requestHeaders\":\"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml\",\"requestId\":\"2ab418ac8515f33\",\"responseHeaders\":\"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml\",\"start\":\"1470923133.026\",\"status\":\"301\",\"tls\": \"TLSv1.2\"},\"userRiskData\":{\"uuid\":\"964d54b7-0821-413a-a4d6-8131770ec8d5\",\"status\":\"0\",\"score\":\"75\",\"risk\":\"udfp:1325gdg4g4343g/M|unp:74256/H\",\"trust\":\"ugp:US\",\"general\":\"duc_1h:10|duc_1d:30\",\"allow\":\"0\"},\"clientData\":{\"appBundleId\":\"com.mydomain.myapp\",\"appVersion\":\"1.23\",\"sdkVersion\":\"4.7.1\",\"telemetryType\":\"2\"},\"botData\":{\"botScore\":\"100\",\"responseSegment\":\"3\"}}", + "id": "2ab418ac8515f33", + "category": "network", + "kind": "event" + } + }, + null + ] +} \ No newline at end of file diff --git a/packages/akamai/data_stream/siem/_dev/test/system/test-default-config.yml b/packages/akamai/data_stream/siem/_dev/test/system/test-default-config.yml new file mode 100644 index 000000000000..3b7b1e67cb12 --- /dev/null +++ b/packages/akamai/data_stream/siem/_dev/test/system/test-default-config.yml @@ -0,0 +1,12 @@ +input: httpjson +service: akamai +vars: ~ +data_stream: + vars: + preserve_original_event: true + api_host: "http://{{Hostname}}:{{Port}}" + client_token: qwerasdf + client_secret: qazwsx + access_token: abcd + config_ids: aaaa + ssl.verification_mode: none diff --git a/packages/akamai/data_stream/siem/agent/stream/httpjson.yml.hbs b/packages/akamai/data_stream/siem/agent/stream/httpjson.yml.hbs new file mode 100644 index 000000000000..402f977aef6c --- /dev/null +++ b/packages/akamai/data_stream/siem/agent/stream/httpjson.yml.hbs @@ -0,0 +1,80 @@ +config_version: "2" +interval: {{interval}} +request.method: "GET" +request.url: "{{api_host}}/siem/v1/configs/{{config_ids}}" +{{#if ssl}} +request.ssl: {{ssl}} +{{/if}} +{{#if http_client_timeout}} +request.timeout: {{http_client_timeout}} +{{/if}} +{{#if proxy_url }} +request.proxy_url: {{proxy_url}} +{{/if}} +request.transforms: + - set: + target: url.params.from + value: "[[.cursor.last_execution_datetime]]" + default: '[[ (now (parseDuration "-{{initial_interval}}")).Unix ]]' + - set: + target: url.params.to + value: '[[ (now (parseDuration "-1m")).Unix ]]' + - set: + target: header.XTimestamp + value: '[[ formatDate (now) "20060102T15:04:05-0700" ]]' + - set: + target: header.XSignatureBase + value: '[[ sprintf "EG1-HMAC-SHA256 client_token=%s;access_token=%s;timestamp=%s;nonce=%s;" "{{client_token}}" "{{access_token}}" (.header.Get "XTimestamp") uuid ]]' + - set: + target: header.XSignatureKey + value: '[[ hmacBase64 "sha256" "{{client_secret}}" (.header.Get "XTimestamp") ]]' + - set: + target: header.XSignature + value: '[[ hmacBase64 "sha256" (.header.Get "XSignatureKey") "GET\t" .url.Scheme "\t" .url.Host "\t" .url.Path "?" .url.RawQuery "\t\t\t" (.header.Get "XSignatureBase") ]]' + - set: + target: header.Authorization + value: '[[ sprintf "%ssignature=%s" (.header.Get "XSignatureBase") (.header.Get "XSignature") ]]' + - delete: + target: header.XSignature + - delete: + target: header.XSignatureKey + - delete: + target: header.XSignatureBase + - delete: + target: header.XTimestamp + +response.decode_as: application/x-ndjson + +response.pagination: + - set: + target: url.params.offset + value: '[[ .last_event.offset ]]' + fail_on_template_error: true + - delete: + target: url.params.from + - delete: + target: url.params.to + +cursor: + last_execution_datetime: + value: '[[ (now (parseDuration "-1m")).Unix ]]' + +{{#if tags.length}} +tags: +{{else if preserve_original_event}} +tags: +{{/if}} +{{#each tags as |tag i|}} + - {{tag}} +{{/each}} +{{#if preserve_original_event}} + - preserve_original_event +{{/if}} +{{#contains tags "forwarded"}} +publisher_pipeline.disable_host: true +{{/contains}} + +{{#if processors}} +processors: +{{processors}} +{{/if}} \ No newline at end of file diff --git a/packages/akamai/data_stream/siem/elasticsearch/ingest_pipeline/default.yml b/packages/akamai/data_stream/siem/elasticsearch/ingest_pipeline/default.yml new file mode 100644 index 000000000000..0c74350444f0 --- /dev/null +++ b/packages/akamai/data_stream/siem/elasticsearch/ingest_pipeline/default.yml @@ -0,0 +1,426 @@ +--- +description: Pipeline for parsing Akamai logs +processors: +- set: + field: event.ingested + value: '{{_ingest.timestamp}}' +- set: + field: ecs.version + value: '1.12.0' +- rename: + field: message + target_field: event.original +- json: + field: event.original + target_field: json +- drop: + if: 'ctx?.json?.offset != null' +- set: + field: observer.vendor + value: akamai +- set: + field: observer.type + value: proxy +- date: + field: json.httpMessage.start + formats: + - UNIX + timezone: UTC + target_field: "@timestamp" +- set: + field: "event.start" + copy_from: "@timestamp" +- rename: + field: json.httpMessage.status + target_field: http.response.status_code + ignore_missing: true +- convert: + field: http.response.status_code + type: long + ignore_missing: true +- rename: + field: json.httpMessage.bytes + target_field: http.response.bytes + ignore_missing: true +- convert: + field: http.response.bytes + type: long + ignore_missing: true +- rename: + field: json.httpMessage.requestId + target_field: http.request.id + ignore_missing: true +- set: + field: event.id + copy_from: http.request.id + ignore_empty_value: true +- fingerprint: + fields: + - http.request.id + target_field: "_id" + ignore_missing: true +- rename: + field: json.httpMessage.method + target_field: http.request.method + ignore_missing: true +- rename: + field: json.httpMessage.host + target_field: url.domain + ignore_missing: true +- urldecode: + field: json.httpMessage.path + target_field: url.path + ignore_missing: true +- urldecode: + field: json.httpMessage.query + target_field: url.query + ignore_missing: true +- rename: + field: json.httpMessage.port + target_field: url.port + ignore_missing: true +- convert: + field: url.port + type: long + ignore_missing: true +- urldecode: + field: json.httpMessage.responseHeaders + target_field: _tmp.response.headers + ignore_missing: true +- kv: + field: _tmp.response.headers + target_field: akamai.siem.response.headers + field_split: '\r\n' + value_split: ': ' + ignore_missing: true +- urldecode: + field: json.httpMessage.requestHeaders + target_field: _tmp.request.headers + ignore_missing: true +- kv: + field: _tmp.request.headers + target_field: akamai.siem.request.headers + field_split: '\r\n' + value_split: ': ' + ignore_missing: true +- script: + lang: painless + description: This script builds the `url.full` field out of the available `url.*` parts. + source: | + def full = ""; + if(ctx.url.scheme != null && ctx.url.scheme != "") { + full += ctx.url.scheme+"://"; + } + if(ctx.url.domain != null && ctx.url.domain != "") { + full += ctx.url.domain; + } + if(ctx.json.httpMessage.path != null && ctx.json.httpMessage.path != "") { + full += ctx.json.httpMessage.path; + } + if(ctx.json.httpMessage.query != null && ctx.json.httpMessage.query != "") { + full += "?"+ctx.json.httpMessage.query; + } + if(full != "") { + ctx.url.full = full + } +- dissect: + field: json.httpMessage.protocol + pattern: "%{network.protocol}/%{http.version}" + ignore_failure: true +- lowercase: + field: network.protocol + ignore_missing: true +- set: + field: network.transport + value: tcp + if: ctx?.network?.protocol != null && ctx?.network?.protocol == 'http' +- dissect: + field: json.httpMessage.tls + pattern: "%{tls.version_protocol}v%{tls.version}" + ignore_failure: true + ignore_missing: true +- lowercase: + field: tls.version_protocol + ignore_missing: true +- rename: + field: json.attackData.clientIP + target_field: source.address + ignore_missing: true +- convert: + field: source.address + target_field: source.ip + type: ip + ignore_missing: true + ignore_failure: true +- geoip: + field: source.ip + target_field: source.geo + ignore_missing: true +- rename: + field: json.geo.country + target_field: source.geo.country_iso_code + ignore_missing: true + if: ctx?.source?.geo?.country_iso_code == null +- set: + field: source.geo.region_iso_code + value: "{{json.geo.country}}-{{json.geo.regionCode}}" + ignore_empty_value: true + if: ctx?.source?.geo?.region_iso_code == null +- rename: + field: json.geo.city + target_field: source.geo.city_name + ignore_missing: true + if: ctx?.source?.geo?.city_name == null +- geoip: + database_file: GeoLite2-ASN.mmdb + field: source.ip + target_field: source.as + properties: + - asn + - organization_name + ignore_missing: true +- rename: + field: source.as.asn + target_field: source.as.number + ignore_missing: true +- convert: + field: json.geo.asn + target_field: source.as.number + type: long + ignore_missing: true + if: ctx?.source?.as?.number == null +- rename: + field: source.as.organization_name + target_field: source.as.organization.name + ignore_missing: true +## Attack Data +- urldecode: + field: json.attackData.ruleActions + target_field: json.attackData.ruleActions + ignore_missing: true +- split: + field: json.attackData.ruleActions + target_field: json.attackData.ruleActions + separator: ';' + preserve_trailing: true +- urldecode: + field: json.attackData.ruleData + target_field: json.attackData.ruleData + ignore_missing: true +- split: + field: json.attackData.ruleData + target_field: json.attackData.ruleData + separator: ';' + preserve_trailing: true +- urldecode: + field: json.attackData.ruleMessages + target_field: json.attackData.ruleMessages + ignore_missing: true +- split: + field: json.attackData.ruleMessages + target_field: json.attackData.ruleMessages + separator: ';' + preserve_trailing: true +- urldecode: + field: json.attackData.ruleSelectors + target_field: json.attackData.ruleSelectors + ignore_missing: true +- split: + field: json.attackData.ruleSelectors + target_field: json.attackData.ruleSelectors + separator: ';' + preserve_trailing: true +- urldecode: + field: json.attackData.ruleTags + target_field: json.attackData.ruleTags + ignore_missing: true +- split: + field: json.attackData.ruleTags + target_field: json.attackData.ruleTags + separator: ';' + preserve_trailing: true +- urldecode: + field: json.attackData.ruleVersions + target_field: json.attackData.ruleVersions + ignore_missing: true +- split: + field: json.attackData.ruleVersions + target_field: json.attackData.ruleVersions + separator: ';' + preserve_trailing: true +- urldecode: + field: json.attackData.rules + target_field: json.attackData.rules + ignore_missing: true +- split: + field: json.attackData.rules + target_field: json.attackData.rules + separator: ';' + preserve_trailing: true +- script: + lang: painless + description: Base64 Decode the json.attackData.rule* fields + source: | + ArrayList items = new ArrayList(["rules", "ruleActions", "ruleData", "ruleMessages", "ruleTags", "ruleSelectors", "ruleVersions"]); + ArrayList rules_array = new ArrayList(); + for (def i = 0; i < ctx.json.attackData.rules.length; i++) { + HashMap map = new HashMap(); + for (def j = 0; j < items.length; j++) { + String key = items[j]; + if (i < ctx.json.attackData[key].length ) { + String value = ctx.json.attackData[key][i].replace(" ", "").decodeBase64(); + map.put(key, value); + } + } + rules_array.add(map); + } + ctx.akamai.siem.rules = rules_array; +- rename: + field: json.attackData.configId + target_field: akamai.siem.config_id + ignore_missing: true +- rename: + field: json.attackData.policyId + target_field: akamai.siem.policy_id + ignore_missing: true +- rename: + field: json.attackData.policyId + target_field: akamai.siem.policy_id + ignore_missing: true +- rename: + field: json.attackData.slowPostAction + target_field: akamai.siem.slow_post_action + ignore_missing: true +- convert: + field: json.attackData.slowPostRate + target_field: akamai.siem.slow_post_rate + type: long + ignore_missing: true +- rename: + field: json.attackData.clientReputation + target_field: akamai.siem.client_reputation + ignore_missing: true +- rename: + field: json.attackData.clientReputation + target_field: akamai.siem.client_reputation + ignore_missing: true +## Bot Data +- convert: + field: json.botData.botScore + target_field: akamai.siem.bot.score + type: long + ignore_missing: true +- convert: + field: json.botData.responseSegment + target_field: akamai.siem.bot.response_segment + type: long + ignore_missing: true +## Client Data +- rename: + field: json.clientData.appBundleId + target_field: akamai.siem.client_data.app_bundle_id + ignore_missing: true +- rename: + field: json.clientData.appVersion + target_field: akamai.siem.client_data.app_version + ignore_missing: true +- convert: + field: json.clientData.telemetryType + target_field: akamai.siem.client_data.telemetry_type + type: long + ignore_missing: true +- rename: + field: json.clientData.sdkVersion + target_field: akamai.siem.client_data.sdk_version + ignore_missing: true +## User Risk Data +- rename: + field: json.userRiskData.uuid + target_field: akamai.siem.user_risk.uuid + ignore_missing: true +- convert: + field: json.userRiskData.status + target_field: akamai.siem.user_risk.status + type: long + ignore_missing: true +- convert: + field: json.userRiskData.score + target_field: akamai.siem.user_risk.score + type: long + ignore_missing: true +- convert: + field: json.userRiskData.allow + target_field: akamai.siem.user_risk.allow + type: long + ignore_missing: true +- kv: + field: json.userRiskData.risk + target_field: akamai.siem.user_risk.risk + field_split: '\|' + value_split: ':' + ignore_missing: true +- kv: + field: json.userRiskData.trust + target_field: akamai.siem.user_risk.trust + field_split: '\|' + value_split: ':' + ignore_missing: true +- kv: + field: json.userRiskData.general + target_field: akamai.siem.user_risk.general + field_split: '\|' + value_split: ':' + ignore_missing: true +## +- append: + field: related.ip + value: "{{source.ip}}" + allow_duplicates: false +- set: + field: client + copy_from: source +- set: + field: event.category + value: network +- set: + field: event.kind + value: event +- remove: + field: + - json + - _tmp + ignore_missing: true +- remove: + field: event.original + if: "ctx?.tags == null || !(ctx.tags.contains('preserve_original_event'))" + ignore_failure: true + ignore_missing: true +- script: + lang: painless + description: This script processor iterates over the whole document to remove fields with null values. + source: | + void handleMap(Map map) { + for (def x : map.values()) { + if (x instanceof Map) { + handleMap(x); + } else if (x instanceof List) { + handleList(x); + } + } + map.values().removeIf(v -> v == null || v == '' || (v instanceof Map && v.size() == 0) || (v instanceof List && v.size() == 0)); + } + void handleList(List list) { + for (def x : list) { + if (x instanceof Map) { + handleMap(x); + } else if (x instanceof List) { + handleList(x); + } + } + list.removeIf(v -> v == null || v == '' || (v instanceof Map && v.size() == 0) || (v instanceof List && v.size() == 0)); + } + handleMap(ctx); +on_failure: +- set: + field: error.message + value: "{{ _ingest.on_failure_message }}" diff --git a/packages/akamai/data_stream/siem/fields/agent.yml b/packages/akamai/data_stream/siem/fields/agent.yml new file mode 100644 index 000000000000..4d9a6f7b362b --- /dev/null +++ b/packages/akamai/data_stream/siem/fields/agent.yml @@ -0,0 +1,114 @@ +- name: host + title: Host + group: 2 + description: 'A host is defined as a general computing instance. + + ECS host.* fields should be populated with details about the host on which the event happened, or from which the measurement was taken. Host types include hardware, virtual machines, Docker containers, and Kubernetes nodes.' + type: group + fields: + - name: architecture + level: core + type: keyword + ignore_above: 1024 + description: Operating system architecture. + example: x86_64 + - name: domain + level: extended + type: keyword + ignore_above: 1024 + description: 'Name of the domain of which the host is a member. + + For example, on Windows this could be the host''s Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host''s LDAP provider.' + example: CONTOSO + default_field: false + - name: hostname + level: core + type: keyword + ignore_above: 1024 + description: 'Hostname of the host. + + It normally contains what the `hostname` command returns on the host machine.' + - name: id + level: core + type: keyword + ignore_above: 1024 + description: 'Unique host id. + + As hostname is not always unique, use values that are meaningful in your environment. + + Example: The current usage of `beat.name`.' + - name: ip + level: core + type: ip + description: Host ip addresses. + - name: mac + level: core + type: keyword + ignore_above: 1024 + description: Host mac addresses. + - name: name + level: core + type: keyword + ignore_above: 1024 + description: 'Name of the host. + + It can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.' + - name: os.family + level: extended + type: keyword + ignore_above: 1024 + description: OS family (such as redhat, debian, freebsd, windows). + example: debian + - name: os.kernel + level: extended + type: keyword + ignore_above: 1024 + description: Operating system kernel version as a raw string. + example: 4.4.0-112-generic + - name: os.name + level: extended + type: keyword + ignore_above: 1024 + multi_fields: + - name: text + type: text + norms: false + default_field: false + description: Operating system name, without the version. + example: Mac OS X + - name: os.platform + level: extended + type: keyword + ignore_above: 1024 + description: Operating system platform (such centos, ubuntu, windows). + example: darwin + - name: os.version + level: extended + type: keyword + ignore_above: 1024 + description: Operating system version as a raw string. + example: 10.14.1 + - name: type + level: core + type: keyword + ignore_above: 1024 + description: 'Type of host. + + For Cloud providers this can be the machine type like `t2.medium`. If vm, this could be the container, for example, or other information meaningful in your environment.' + - name: containerized + type: boolean + description: > + If the host is a container. + + - name: os.build + type: keyword + example: "18D109" + description: > + OS build information. + + - name: os.codename + type: keyword + example: "stretch" + description: > + OS codename, if any. + diff --git a/packages/akamai/data_stream/siem/fields/base-fields.yml b/packages/akamai/data_stream/siem/fields/base-fields.yml new file mode 100644 index 000000000000..90bd5c675314 --- /dev/null +++ b/packages/akamai/data_stream/siem/fields/base-fields.yml @@ -0,0 +1,20 @@ +- name: data_stream.type + type: constant_keyword + description: Data stream type. +- name: data_stream.dataset + type: constant_keyword + description: Data stream dataset name. +- name: data_stream.namespace + type: constant_keyword + description: Data stream namespace. +- name: event.module + type: constant_keyword + description: Event module + value: akamai +- name: event.dataset + type: constant_keyword + description: Event dataset + value: akamai.siem +- name: "@timestamp" + type: date + description: Event timestamp. diff --git a/packages/akamai/data_stream/siem/fields/beats.yml b/packages/akamai/data_stream/siem/fields/beats.yml new file mode 100644 index 000000000000..cb44bb29442a --- /dev/null +++ b/packages/akamai/data_stream/siem/fields/beats.yml @@ -0,0 +1,12 @@ +- name: input.type + type: keyword + description: Type of Filebeat input. +- name: log.flags + type: keyword + description: Flags for the log file. +- name: log.offset + type: long + description: Offset of the entry in the log file. +- name: log.file.path + type: keyword + description: Path to the log file. diff --git a/packages/akamai/data_stream/siem/fields/ecs.yml b/packages/akamai/data_stream/siem/fields/ecs.yml new file mode 100644 index 000000000000..b25cb8a4063c --- /dev/null +++ b/packages/akamai/data_stream/siem/fields/ecs.yml @@ -0,0 +1,134 @@ +- name: client.as.number + external: ecs +- name: client.as.organization.name + external: ecs +- name: client.domain + external: ecs +- name: client.geo.city_name + external: ecs +- name: client.geo.country_name + external: ecs +- name: client.geo.country_iso_code + external: ecs +- name: client.geo.continent_name + external: ecs +- name: client.geo.country_iso_code + external: ecs +- name: client.geo.region_iso_code + external: ecs +- name: client.geo.location + description: Longitude and latitude. + example: '{ "lon": -73.614830, "lat": 45.505918 }' + type: geo_point +- name: client.geo.region_name + external: ecs +- name: client.ip + external: ecs +- name: client.address + external: ecs +- name: client.bytes + external: ecs +- name: client.port + external: ecs +- name: ecs.version + external: ecs +- name: error.message + external: ecs +- name: event.action + external: ecs +- name: event.category + external: ecs +- name: event.ingested + external: ecs +- name: event.created + external: ecs +- name: event.start + external: ecs +- name: event.kind + external: ecs +- name: event.original + external: ecs +- name: event.outcome + external: ecs +- name: event.type + external: ecs +- name: related.ip + external: ecs +- name: source.address + external: ecs +- name: source.as.number + external: ecs +- name: source.as.organization.name + external: ecs +- name: source.bytes + external: ecs +- name: source.domain + external: ecs +- name: source.geo.city_name + external: ecs +- name: source.geo.continent_name + external: ecs +- name: source.geo.country_iso_code + external: ecs +- name: source.geo.country_name + external: ecs +- name: source.geo.location + description: Longitude and latitude. + example: '{ "lon": -73.614830, "lat": 45.505918 }' + type: geo_point +- name: source.geo.name + external: ecs +- name: source.geo.region_iso_code + external: ecs +- name: source.geo.region_name + external: ecs +- name: source.ip + external: ecs +- name: source.port + external: ecs +- name: tags + external: ecs +- name: url.domain + external: ecs +- name: url.original + external: ecs +- name: url.password + external: ecs +- name: url.port + external: ecs +- name: url.username + external: ecs +- name: url.path + external: ecs +- name: url.query + external: ecs +- name: url.extension + external: ecs +- name: url.scheme + external: ecs +- name: url.full + external: ecs +- name: tls.cipher + external: ecs +- name: tls.version + external: ecs +- name: tls.version_protocol + external: ecs +- name: network.protocol + external: ecs +- name: network.transport + external: ecs +- name: http.response.status_code + external: ecs +- name: http.response.bytes + external: ecs +- name: http.request.method + external: ecs +- name: http.request.id + external: ecs +- name: http.version + external: ecs +- name: observer.type + external: ecs +- name: observer.vendor + external: ecs diff --git a/packages/akamai/data_stream/siem/fields/fields.yml b/packages/akamai/data_stream/siem/fields/fields.yml new file mode 100644 index 000000000000..faa4f435cbed --- /dev/null +++ b/packages/akamai/data_stream/siem/fields/fields.yml @@ -0,0 +1,110 @@ +- name: akamai.siem + type: group + release: beta + default_field: false + description: > + Fields for Akamai SIEM Logs + + fields: + - name: response.headers + type: flattened + description: > + HTTP response headers + + - name: request.headers + type: flattened + description: > + HTTP Request headers + + - name: rules + type: nested + description: > + Rules triggered by this request + + - name: config_id + type: keyword + description: > + ID of the Security Configuration applied to the request. + + - name: policy_id + type: keyword + description: > + ID of the Firewall policy applied to the request. + + - name: slow_post_action + type: keyword + description: > + Action taken if a Slow POST attack is detected: W for Warn or A for deny (abort). + + - name: slow_post_rate + type: long + description: > + Recorded rate of a detected Slow POST attack. + + - name: client_reputation + type: keyword + description: > + Client IP scores for Client Reputation. + + - name: bot.score + type: long + description: > + Score assigned to the request by Botman Manager. + + - name: bot.response_segment + type: long + description: > + Numeric response segment indicator. Segments are used to group and categorize bot scores. + + - name: client_data.app_bundle_id + type: keyword + description: > + Unique identifier of the app bundle. An app bundle contains both the software itself and the accompanying configuration information. + + - name: client_data.app_version + type: keyword + description: > + Version number of the app. + + - name: client_data.telemetry_type + type: long + description: > + Specifies the telemetry type in use. + + - name: client_data.sdk_version + type: keyword + description: > + SDK version + + - name: user_risk.uuid + type: keyword + description: > + Unique identifier of the user whose risk data is being provided. + + - name: user_risk.status + type: long + description: "Status code indicating any errors that might have occurred when calculating the risk score. \n" + - name: user_risk.score + type: long + description: > + Calculated risk scores. Scores range from 0 (no risk) to 100 (the highest possible risk). + + - name: user_risk.risk + type: flattened + description: > + Indicators that increased the calculated risk score. For example, the value udfp represents the risk of the device fingerprint based on the user's behavioral profile. + + - name: user_risk.trust + type: flattened + description: > + Indicators that were trusted. For example, the value ugp indicates that the user’s country or area is trusted. + + - name: user_risk.general + type: flattened + description: > + Indicators of general behavior observed for relevant attributes. For example, duc_1h represents the number of users recorded on a specific device in the past hour. + + - name: user_risk.allow + type: long + description: >- + Indicates whether the user is on the allow list. A 0 indicates that the user was not on the list; a 1 indicates that the user was on the list. diff --git a/packages/akamai/data_stream/siem/manifest.yml b/packages/akamai/data_stream/siem/manifest.yml new file mode 100644 index 000000000000..9d00eada89b4 --- /dev/null +++ b/packages/akamai/data_stream/siem/manifest.yml @@ -0,0 +1,105 @@ +type: logs +title: Akamai SIEM Logs +release: experimental +streams: + - input: httpjson + vars: + - name: api_host + type: text + title: API Host + description: API Hostname in the form of http(s)://akzz-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.luna.akamaiapis.net without path + multi: false + required: true + show_user: true + default: https://akzz-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.luna.akamaiapis.net + - name: client_token + type: text + title: Client Token + description: Client token provided by "Credentials" ui + multi: false + required: true + show_user: true + - name: client_secret + type: password + title: Client Secret + description: Client secret provided by "Credentials" ui + multi: false + required: true + show_user: true + - name: access_token + type: password + title: Access Token + description: Access token provided by "Authorizations" ui + multi: false + required: true + show_user: true + - name: config_ids + type: text + title: Zone ID + multi: false + required: true + show_user: true + description: Unique identifier for each security configuration. To report on more than one configuration, separate integer identifiers with semicolons. ex. 12892;29182;82912 + - name: http_client_timeout + type: text + title: HTTP Client Timeout + multi: false + required: false + show_user: true + default: 60s + - name: interval + type: text + title: Interval + multi: false + required: true + show_user: true + description: Interval at which the logs will be pulled. The value must be between 2m and 1h. + default: 1h + - name: initial_interval + type: text + title: Initial Interval + multi: false + required: true + show_user: true + default: 24h + description: Initial interval to poll for events. Default is 24 hours. + - name: proxy_url + type: text + title: Proxy URL + multi: false + required: false + show_user: false + description: URL to proxy connections in the form of http[s]://:@: + - name: ssl + type: yaml + title: SSL + multi: false + required: false + show_user: false + - name: tags + type: text + title: Tags + multi: true + required: true + show_user: true + default: + - akamai-siem + - forwarded + - name: preserve_original_event + required: true + show_user: true + title: Preserve original event + description: Preserves a raw copy of the original event, added to the field `event.original` + type: bool + multi: false + default: false + - name: processors + type: yaml + title: Processors + multi: false + required: false + show_user: false + description: "Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. \nThis executes in the agent before the logs are parsed. \nSee [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details.\n" + template_path: httpjson.yml.hbs + title: Akamai SIEM logs + description: Collect Akamai logs via the SIEM API diff --git a/packages/akamai/data_stream/siem/sample_event.json b/packages/akamai/data_stream/siem/sample_event.json new file mode 100644 index 000000000000..509feb14af89 --- /dev/null +++ b/packages/akamai/data_stream/siem/sample_event.json @@ -0,0 +1,189 @@ +{ + "@timestamp": "2016-08-11T13:45:33.026Z", + "agent": { + "ephemeral_id": "4c2c62fa-7687-4176-8caf-2cfbd88d02ac", + "hostname": "docker-fleet-agent", + "id": "8bf63e47-c038-4463-8608-aaaa12031474", + "name": "docker-fleet-agent", + "type": "filebeat", + "version": "7.16.0" + }, + "akamai": { + "siem": { + "bot": { + "response_segment": 3, + "score": 100 + }, + "client_data": { + "app_bundle_id": "com.mydomain.myapp", + "app_version": "1.23", + "sdk_version": "4.7.1", + "telemetry_type": 2 + }, + "config_id": "6724", + "policy_id": "scoe_5426", + "request": { + "headers": { + "Accept": "text/html,application/xhtml xml", + "User-Agent": "BOT/0.1 (BOT for JCE)" + } + }, + "response": { + "headers": { + "Content-Type": "text/html", + "Mime-Version": "1.0", + "Server": "AkamaiGHost" + } + }, + "rules": [ + { + "ruleActions": "ALERT", + "ruleData": "alert(", + "ruleMessages": "Cross-site Scripting (XSS) Attack", + "ruleSelectors": "ARGS:a", + "ruleTags": "WEB_ATTACK/XSS", + "rules": "950004" + }, + { + "ruleActions": "DENY", + "ruleData": "curl", + "ruleMessages": "Request Indicates an automated program explored the site", + "ruleSelectors": "REQUEST_HEADERS:User-Agent", + "ruleTags": "AUTOMATION/MISC", + "rules": "990011" + } + ], + "user_risk": { + "allow": 0, + "general": { + "duc_1d": "30", + "duc_1h": "10" + }, + "risk": { + "udfp": "1325gdg4g4343g/M", + "unp": "74256/H" + }, + "score": 75, + "status": 0, + "trust": { + "ugp": "US" + }, + "uuid": "964d54b7-0821-413a-a4d6-8131770ec8d5" + } + } + }, + "client": { + "address": "52.91.36.10", + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "geo": { + "city_name": "Ashburn", + "continent_name": "North America", + "country_iso_code": "US", + "country_name": "United States", + "location": { + "lat": 39.0481, + "lon": -77.4728 + }, + "region_iso_code": "US-VA", + "region_name": "Virginia" + }, + "ip": "52.91.36.10" + }, + "data_stream": { + "dataset": "akamai.siem", + "namespace": "ep", + "type": "logs" + }, + "ecs": { + "version": "1.12.0" + }, + "elastic_agent": { + "id": "8bf63e47-c038-4463-8608-aaaa12031474", + "snapshot": true, + "version": "7.16.0" + }, + "event": { + "agent_id_status": "verified", + "category": "network", + "created": "2021-12-08T14:30:39.871Z", + "dataset": "akamai.siem", + "id": "2ab418ac8515f33", + "ingested": "2021-12-08T14:30:40Z", + "kind": "event", + "original": "{\"attackData\":{\"clientIP\":\"52.91.36.10\",\"configId\":\"6724\",\"policyId\":\"scoe_5426\",\"ruleActions\":\"QUxFUlQ;REVOWQ==\",\"ruleData\":\"YWxlcnQo;Y3VybA==\",\"ruleMessages\":\"Q3Jvc3Mtc2l0ZSBTY3 JpcHRpbmcgKFhTUykgQXR0YWNr; UmVxdWVzdCBJbmRpY2F0ZXMgYW4 gYXV0b21hdGVkIHByb2 dyYW0gZXhwbG9yZWQgdGhlIHNpdGU=\",\"ruleSelectors\":\"QVJHUzph;UkVRVUVTVF9IRU FERVJTOlVzZXItQWdlbnQ=\",\"ruleTags\":\"V0VCX0FUVEFDSy9YU1M=;QV VUT01BVElPTi9NSVND\",\"ruleVersions\":\";\",\"rules\":\"OTUwMDA0;OTkwMDEx\"},\"botData\":{\"botScore\":\"100\",\"responseSegment\":\"3\"},\"clientData\":{\"appBundleId\":\"com.mydomain.myapp\",\"appVersion\":\"1.23\",\"sdkVersion\":\"4.7.1\",\"telemetryType\":\"2\"},\"format\":\"json\",\"geo\":{\"asn\":\"12271\",\"city\":\"NEWYORK\",\"continent\":\"NA\",\"country\":\"US\",\"regionCode\":\"NY\"},\"httpMessage\":{\"bytes\":\"34523\",\"host\":\"www.example.com\",\"method\":\"POST\",\"path\":\"/examples/1/\",\"port\":\"80\",\"protocol\":\"http/2\",\"query\":\"a%3D..%2F..%2F..%2Fetc%2Fpasswd\",\"requestHeaders\":\"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml\",\"requestId\":\"2ab418ac8515f33\",\"responseHeaders\":\"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml\",\"start\":\"1470923133.026\",\"status\":\"301\",\"tls\":\"TLSv1.2\"},\"type\":\"akamai_siem\",\"userRiskData\":{\"allow\":\"0\",\"general\":\"duc_1h:10|duc_1d:30\",\"risk\":\"udfp:1325gdg4g4343g/M|unp:74256/H\",\"score\":\"75\",\"status\":\"0\",\"trust\":\"ugp:US\",\"uuid\":\"964d54b7-0821-413a-a4d6-8131770ec8d5\"},\"version\":\"1.0\"}", + "start": "2016-08-11T13:45:33.026Z" + }, + "host": { + "name": "docker-fleet-agent" + }, + "http": { + "request": { + "id": "2ab418ac8515f33", + "method": "POST" + }, + "response": { + "bytes": 34523, + "status_code": 301 + }, + "version": "2" + }, + "input": { + "type": "httpjson" + }, + "network": { + "protocol": "http", + "transport": "tcp" + }, + "observer": { + "type": "proxy", + "vendor": "akamai" + }, + "related": { + "ip": [ + "52.91.36.10" + ] + }, + "source": { + "address": "52.91.36.10", + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "geo": { + "city_name": "Ashburn", + "continent_name": "North America", + "country_iso_code": "US", + "country_name": "United States", + "location": { + "lat": 39.0481, + "lon": -77.4728 + }, + "region_iso_code": "US-VA", + "region_name": "Virginia" + }, + "ip": "52.91.36.10" + }, + "tags": [ + "akamai-siem", + "forwarded", + "preserve_original_event" + ], + "tls": { + "version": "1.2", + "version_protocol": "tls" + }, + "url": { + "domain": "www.example.com", + "full": "www.example.com/examples/1/?a%3D..%2F..%2F..%2Fetc%2Fpasswd", + "path": "/examples/1/", + "port": 80, + "query": "a=../../../etc/passwd" + } +} \ No newline at end of file diff --git a/packages/akamai/docs/README.md b/packages/akamai/docs/README.md new file mode 100644 index 000000000000..96b76a5d16d3 --- /dev/null +++ b/packages/akamai/docs/README.md @@ -0,0 +1,324 @@ +# Akamai Integration + +The Akamai integration collects events from the Akamai API, specifically reading from the [Akamai SIEM API](https://techdocs.akamai.com/siem-integration/reference/api). + +## Logs + +### SIEM + +The Security Information and Event Management API allows you to capture security events generated on the ​Akamai​ platform in your SIEM application. + +Use this API to get security event data generated on the ​Akamai​ platform and correlate it with data from other sources in your SIEM solution. Capture security event data incrementally, or replay missed security events from the past 12 hours. You can store, query, and analyze the data delivered through this API on your end, then go back and adjust your Akamai security settings. If you’re coding your own SIEM connector, it needs to adhere to these specifications in order to pull in security events from Akamai Security Events Collector (ASEC) and process them properly. + +See https://techdocs.akamai.com/siem-integration/reference/api-get-started to setup your Akamai account and obtain your credentials + +**Exported fields** + +| Field | Description | Type | +|---|---|---| +| @timestamp | Event timestamp. | date | +| akamai.siem.bot.response_segment | Numeric response segment indicator. Segments are used to group and categorize bot scores. | long | +| akamai.siem.bot.score | Score assigned to the request by Botman Manager. | long | +| akamai.siem.client_data.app_bundle_id | Unique identifier of the app bundle. An app bundle contains both the software itself and the accompanying configuration information. | keyword | +| akamai.siem.client_data.app_version | Version number of the app. | keyword | +| akamai.siem.client_data.sdk_version | SDK version | keyword | +| akamai.siem.client_data.telemetry_type | Specifies the telemetry type in use. | long | +| akamai.siem.client_reputation | Client IP scores for Client Reputation. | keyword | +| akamai.siem.config_id | ID of the Security Configuration applied to the request. | keyword | +| akamai.siem.policy_id | ID of the Firewall policy applied to the request. | keyword | +| akamai.siem.request.headers | HTTP Request headers | flattened | +| akamai.siem.response.headers | HTTP response headers | flattened | +| akamai.siem.rules | Rules triggered by this request | nested | +| akamai.siem.slow_post_action | Action taken if a Slow POST attack is detected: W for Warn or A for deny (abort). | keyword | +| akamai.siem.slow_post_rate | Recorded rate of a detected Slow POST attack. | long | +| akamai.siem.user_risk.allow | Indicates whether the user is on the allow list. A 0 indicates that the user was not on the list; a 1 indicates that the user was on the list. | long | +| akamai.siem.user_risk.general | Indicators of general behavior observed for relevant attributes. For example, duc_1h represents the number of users recorded on a specific device in the past hour. | flattened | +| akamai.siem.user_risk.risk | Indicators that increased the calculated risk score. For example, the value udfp represents the risk of the device fingerprint based on the user's behavioral profile. | flattened | +| akamai.siem.user_risk.score | Calculated risk scores. Scores range from 0 (no risk) to 100 (the highest possible risk). | long | +| akamai.siem.user_risk.status | Status code indicating any errors that might have occurred when calculating the risk score. | long | +| akamai.siem.user_risk.trust | Indicators that were trusted. For example, the value ugp indicates that the user’s country or area is trusted. | flattened | +| akamai.siem.user_risk.uuid | Unique identifier of the user whose risk data is being provided. | keyword | +| client.address | Some event client addresses are defined ambiguously. The event will sometimes list an IP, a domain or a unix socket. You should always store the raw address in the `.address` field. Then it should be duplicated to `.ip` or `.domain`, depending on which one it is. | keyword | +| client.as.number | Unique number allocated to the autonomous system. The autonomous system number (ASN) uniquely identifies each network on the Internet. | long | +| client.as.organization.name | Organization name. | keyword | +| client.bytes | Bytes sent from the client to the server. | long | +| client.domain | Client domain. | keyword | +| client.geo.city_name | City name. | keyword | +| client.geo.continent_name | Name of the continent. | keyword | +| client.geo.country_iso_code | Country ISO code. | keyword | +| client.geo.country_name | Country name. | keyword | +| client.geo.location | Longitude and latitude. | geo_point | +| client.geo.region_iso_code | Region ISO code. | keyword | +| client.geo.region_name | Region name. | keyword | +| client.ip | IP address of the client (IPv4 or IPv6). | ip | +| client.port | Port of the client. | long | +| data_stream.dataset | Data stream dataset name. | constant_keyword | +| data_stream.namespace | Data stream namespace. | constant_keyword | +| data_stream.type | Data stream type. | constant_keyword | +| ecs.version | ECS version this event conforms to. `ecs.version` is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events. | keyword | +| error.message | Error message. | match_only_text | +| event.action | The action captured by the event. This describes the information in the event. It is more specific than `event.category`. Examples are `group-add`, `process-started`, `file-created`. The value is normally defined by the implementer. | keyword | +| event.category | This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy. `event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory. This field is an array. This will allow proper categorization of some events that fall in multiple categories. | keyword | +| event.created | event.created contains the date/time when the event was first read by an agent, or by your pipeline. This field is distinct from @timestamp in that @timestamp typically contain the time extracted from the original event. In most situations, these two timestamps will be slightly different. The difference can be used to calculate the delay between your source generating an event, and the time when your agent first processed it. This can be used to monitor your agent's or pipeline's ability to keep up with your event source. In case the two timestamps are identical, @timestamp should be used. | date | +| event.dataset | Event dataset | constant_keyword | +| event.ingested | Timestamp when an event arrived in the central data store. This is different from `@timestamp`, which is when the event originally occurred. It's also different from `event.created`, which is meant to capture the first time an agent saw the event. In normal conditions, assuming no tampering, the timestamps should chronologically look like this: `@timestamp` \< `event.created` \< `event.ingested`. | date | +| event.kind | This is one of four ECS Categorization Fields, and indicates the highest level in the ECS category hierarchy. `event.kind` gives high-level information about what type of information the event contains, without being specific to the contents of the event. For example, values of this field distinguish alert events from metric events. The value of this field can be used to inform how these kinds of events should be handled. They may warrant different retention, different access control, it may also help understand whether the data coming in at a regular interval or not. | keyword | +| event.module | Event module | constant_keyword | +| event.original | Raw text message of entire event. Used to demonstrate log integrity or where the full log message (before splitting it up in multiple parts) may be required, e.g. for reindex. This field is not indexed and doc_values are disabled. It cannot be searched, but it can be retrieved from `_source`. If users wish to override this and index this field, please see `Field data types` in the `Elasticsearch Reference`. | keyword | +| event.outcome | This is one of four ECS Categorization Fields, and indicates the lowest level in the ECS category hierarchy. `event.outcome` simply denotes whether the event represents a success or a failure from the perspective of the entity that produced the event. Note that when a single transaction is described in multiple events, each event may populate different values of `event.outcome`, according to their perspective. Also note that in the case of a compound event (a single event that contains multiple logical events), this field should be populated with the value that best captures the overall success or failure from the perspective of the event producer. Further note that not all events will have an associated outcome. For example, this field is generally not populated for metric events, events with `event.type:info`, or any events for which an outcome does not make logical sense. | keyword | +| event.start | event.start contains the date when the event started or when the activity was first observed. | date | +| event.type | This is one of four ECS Categorization Fields, and indicates the third level in the ECS category hierarchy. `event.type` represents a categorization "sub-bucket" that, when used along with the `event.category` field values, enables filtering events down to a level appropriate for single visualization. This field is an array. This will allow proper categorization of some events that fall in multiple event types. | keyword | +| host.architecture | Operating system architecture. | keyword | +| host.containerized | If the host is a container. | boolean | +| host.domain | Name of the domain of which the host is a member. For example, on Windows this could be the host's Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host's LDAP provider. | keyword | +| host.hostname | Hostname of the host. It normally contains what the `hostname` command returns on the host machine. | keyword | +| host.id | Unique host id. As hostname is not always unique, use values that are meaningful in your environment. Example: The current usage of `beat.name`. | keyword | +| host.ip | Host ip addresses. | ip | +| host.mac | Host mac addresses. | keyword | +| host.name | Name of the host. It can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use. | keyword | +| host.os.build | OS build information. | keyword | +| host.os.codename | OS codename, if any. | keyword | +| host.os.family | OS family (such as redhat, debian, freebsd, windows). | keyword | +| host.os.kernel | Operating system kernel version as a raw string. | keyword | +| host.os.name | Operating system name, without the version. | keyword | +| host.os.platform | Operating system platform (such centos, ubuntu, windows). | keyword | +| host.os.version | Operating system version as a raw string. | keyword | +| host.type | Type of host. For Cloud providers this can be the machine type like `t2.medium`. If vm, this could be the container, for example, or other information meaningful in your environment. | keyword | +| http.request.id | A unique identifier for each HTTP request to correlate logs between clients and servers in transactions. The id may be contained in a non-standard HTTP header, such as `X-Request-ID` or `X-Correlation-ID`. | keyword | +| http.request.method | HTTP request method. Prior to ECS 1.6.0 the following guidance was provided: "The field value must be normalized to lowercase for querying." As of ECS 1.6.0, the guidance is deprecated because the original case of the method may be useful in anomaly detection. Original case will be mandated in ECS 2.0.0 | keyword | +| http.response.bytes | Total size in bytes of the response (body and headers). | long | +| http.response.status_code | HTTP response status code. | long | +| http.version | HTTP version. | keyword | +| input.type | Type of Filebeat input. | keyword | +| log.file.path | Path to the log file. | keyword | +| log.flags | Flags for the log file. | keyword | +| log.offset | Offset of the entry in the log file. | long | +| network.protocol | L7 Network protocol name. ex. http, lumberjack, transport protocol. The field value must be normalized to lowercase for querying. See the documentation section "Implementing ECS". | keyword | +| network.transport | Same as network.iana_number, but instead using the Keyword name of the transport layer (udp, tcp, ipv6-icmp, etc.) The field value must be normalized to lowercase for querying. See the documentation section "Implementing ECS". | keyword | +| observer.type | The type of the observer the data is coming from. There is no predefined list of observer types. Some examples are `forwarder`, `firewall`, `ids`, `ips`, `proxy`, `poller`, `sensor`, `APM server`. | keyword | +| observer.vendor | Vendor name of the observer. | keyword | +| related.ip | All of the IPs seen on your event. | ip | +| source.address | Some event source addresses are defined ambiguously. The event will sometimes list an IP, a domain or a unix socket. You should always store the raw address in the `.address` field. Then it should be duplicated to `.ip` or `.domain`, depending on which one it is. | keyword | +| source.as.number | Unique number allocated to the autonomous system. The autonomous system number (ASN) uniquely identifies each network on the Internet. | long | +| source.as.organization.name | Organization name. | keyword | +| source.bytes | Bytes sent from the source to the destination. | long | +| source.domain | Source domain. | keyword | +| source.geo.city_name | City name. | keyword | +| source.geo.continent_name | Name of the continent. | keyword | +| source.geo.country_iso_code | Country ISO code. | keyword | +| source.geo.country_name | Country name. | keyword | +| source.geo.location | Longitude and latitude. | geo_point | +| source.geo.name | User-defined description of a location, at the level of granularity they care about. Could be the name of their data centers, the floor number, if this describes a local physical entity, city names. Not typically used in automated geolocation. | keyword | +| source.geo.region_iso_code | Region ISO code. | keyword | +| source.geo.region_name | Region name. | keyword | +| source.ip | IP address of the source (IPv4 or IPv6). | ip | +| source.port | Port of the source. | long | +| tags | List of keywords used to tag each event. | keyword | +| tls.cipher | String indicating the cipher used during the current connection. | keyword | +| tls.version | Numeric part of the version parsed from the original string. | keyword | +| tls.version_protocol | Normalized lowercase protocol name parsed from original string. | keyword | +| url.domain | Domain of the url, such as "www.elastic.co". In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the `domain` field. If the URL contains a literal IPv6 address enclosed by `[` and `]` (IETF RFC 2732), the `[` and `]` characters should also be captured in the `domain` field. | keyword | +| url.extension | The field contains the file extension from the original request url, excluding the leading dot. The file extension is only set if it exists, as not every url has a file extension. The leading period must not be included. For example, the value must be "png", not ".png". Note that when the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). | keyword | +| url.full | If full URLs are important to your use case, they should be stored in `url.full`, whether this field is reconstructed or present in the event source. | wildcard | +| url.original | Unmodified original url as seen in the event source. Note that in network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. | wildcard | +| url.password | Password of the request. | keyword | +| url.path | Path of the request, such as "/search". | wildcard | +| url.port | Port of the request, such as 443. | long | +| url.query | The query field describes the query string of the request, such as "q=elasticsearch". The `?` is excluded from the query string. If a URL contains no `?`, there is no query field. If there is a `?` but no query, the query field exists with an empty string. The `exists` query can be used to differentiate between the two cases. | keyword | +| url.scheme | Scheme of the request, such as "https". Note: The `:` is not part of the scheme. | keyword | +| url.username | Username of the request. | keyword | + + +An example event for `siem` looks as following: + +```json +{ + "@timestamp": "2016-08-11T13:45:33.026Z", + "agent": { + "ephemeral_id": "4c2c62fa-7687-4176-8caf-2cfbd88d02ac", + "hostname": "docker-fleet-agent", + "id": "8bf63e47-c038-4463-8608-aaaa12031474", + "name": "docker-fleet-agent", + "type": "filebeat", + "version": "7.16.0" + }, + "akamai": { + "siem": { + "bot": { + "response_segment": 3, + "score": 100 + }, + "client_data": { + "app_bundle_id": "com.mydomain.myapp", + "app_version": "1.23", + "sdk_version": "4.7.1", + "telemetry_type": 2 + }, + "config_id": "6724", + "policy_id": "scoe_5426", + "request": { + "headers": { + "Accept": "text/html,application/xhtml xml", + "User-Agent": "BOT/0.1 (BOT for JCE)" + } + }, + "response": { + "headers": { + "Content-Type": "text/html", + "Mime-Version": "1.0", + "Server": "AkamaiGHost" + } + }, + "rules": [ + { + "ruleActions": "ALERT", + "ruleData": "alert(", + "ruleMessages": "Cross-site Scripting (XSS) Attack", + "ruleSelectors": "ARGS:a", + "ruleTags": "WEB_ATTACK/XSS", + "rules": "950004" + }, + { + "ruleActions": "DENY", + "ruleData": "curl", + "ruleMessages": "Request Indicates an automated program explored the site", + "ruleSelectors": "REQUEST_HEADERS:User-Agent", + "ruleTags": "AUTOMATION/MISC", + "rules": "990011" + } + ], + "user_risk": { + "allow": 0, + "general": { + "duc_1d": "30", + "duc_1h": "10" + }, + "risk": { + "udfp": "1325gdg4g4343g/M", + "unp": "74256/H" + }, + "score": 75, + "status": 0, + "trust": { + "ugp": "US" + }, + "uuid": "964d54b7-0821-413a-a4d6-8131770ec8d5" + } + } + }, + "client": { + "address": "52.91.36.10", + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "geo": { + "city_name": "Ashburn", + "continent_name": "North America", + "country_iso_code": "US", + "country_name": "United States", + "location": { + "lat": 39.0481, + "lon": -77.4728 + }, + "region_iso_code": "US-VA", + "region_name": "Virginia" + }, + "ip": "52.91.36.10" + }, + "data_stream": { + "dataset": "akamai.siem", + "namespace": "ep", + "type": "logs" + }, + "ecs": { + "version": "1.12.0" + }, + "elastic_agent": { + "id": "8bf63e47-c038-4463-8608-aaaa12031474", + "snapshot": true, + "version": "7.16.0" + }, + "event": { + "agent_id_status": "verified", + "category": "network", + "created": "2021-12-08T14:30:39.871Z", + "dataset": "akamai.siem", + "id": "2ab418ac8515f33", + "ingested": "2021-12-08T14:30:40Z", + "kind": "event", + "original": "{\"attackData\":{\"clientIP\":\"52.91.36.10\",\"configId\":\"6724\",\"policyId\":\"scoe_5426\",\"ruleActions\":\"QUxFUlQ;REVOWQ==\",\"ruleData\":\"YWxlcnQo;Y3VybA==\",\"ruleMessages\":\"Q3Jvc3Mtc2l0ZSBTY3 JpcHRpbmcgKFhTUykgQXR0YWNr; UmVxdWVzdCBJbmRpY2F0ZXMgYW4 gYXV0b21hdGVkIHByb2 dyYW0gZXhwbG9yZWQgdGhlIHNpdGU=\",\"ruleSelectors\":\"QVJHUzph;UkVRVUVTVF9IRU FERVJTOlVzZXItQWdlbnQ=\",\"ruleTags\":\"V0VCX0FUVEFDSy9YU1M=;QV VUT01BVElPTi9NSVND\",\"ruleVersions\":\";\",\"rules\":\"OTUwMDA0;OTkwMDEx\"},\"botData\":{\"botScore\":\"100\",\"responseSegment\":\"3\"},\"clientData\":{\"appBundleId\":\"com.mydomain.myapp\",\"appVersion\":\"1.23\",\"sdkVersion\":\"4.7.1\",\"telemetryType\":\"2\"},\"format\":\"json\",\"geo\":{\"asn\":\"12271\",\"city\":\"NEWYORK\",\"continent\":\"NA\",\"country\":\"US\",\"regionCode\":\"NY\"},\"httpMessage\":{\"bytes\":\"34523\",\"host\":\"www.example.com\",\"method\":\"POST\",\"path\":\"/examples/1/\",\"port\":\"80\",\"protocol\":\"http/2\",\"query\":\"a%3D..%2F..%2F..%2Fetc%2Fpasswd\",\"requestHeaders\":\"User-Agent%3a%20BOT%2f0.1%20(BOT%20for%20JCE)%0d%0aAccept%3a%20text%2fhtml,application%2fxhtml+xml\",\"requestId\":\"2ab418ac8515f33\",\"responseHeaders\":\"Server%3a%20AkamaiGHost%0d%0aMime-Version%3a%201.0%0d%0aContent-Type%3a%20text%2fhtml\",\"start\":\"1470923133.026\",\"status\":\"301\",\"tls\":\"TLSv1.2\"},\"type\":\"akamai_siem\",\"userRiskData\":{\"allow\":\"0\",\"general\":\"duc_1h:10|duc_1d:30\",\"risk\":\"udfp:1325gdg4g4343g/M|unp:74256/H\",\"score\":\"75\",\"status\":\"0\",\"trust\":\"ugp:US\",\"uuid\":\"964d54b7-0821-413a-a4d6-8131770ec8d5\"},\"version\":\"1.0\"}", + "start": "2016-08-11T13:45:33.026Z" + }, + "host": { + "name": "docker-fleet-agent" + }, + "http": { + "request": { + "id": "2ab418ac8515f33", + "method": "POST" + }, + "response": { + "bytes": 34523, + "status_code": 301 + }, + "version": "2" + }, + "input": { + "type": "httpjson" + }, + "network": { + "protocol": "http", + "transport": "tcp" + }, + "observer": { + "type": "proxy", + "vendor": "akamai" + }, + "related": { + "ip": [ + "52.91.36.10" + ] + }, + "source": { + "address": "52.91.36.10", + "as": { + "number": 14618, + "organization": { + "name": "Amazon.com, Inc." + } + }, + "geo": { + "city_name": "Ashburn", + "continent_name": "North America", + "country_iso_code": "US", + "country_name": "United States", + "location": { + "lat": 39.0481, + "lon": -77.4728 + }, + "region_iso_code": "US-VA", + "region_name": "Virginia" + }, + "ip": "52.91.36.10" + }, + "tags": [ + "akamai-siem", + "forwarded", + "preserve_original_event" + ], + "tls": { + "version": "1.2", + "version_protocol": "tls" + }, + "url": { + "domain": "www.example.com", + "full": "www.example.com/examples/1/?a%3D..%2F..%2F..%2Fetc%2Fpasswd", + "path": "/examples/1/", + "port": 80, + "query": "a=../../../etc/passwd" + } +} +``` \ No newline at end of file diff --git a/packages/akamai/img/akamai_logo.svg b/packages/akamai/img/akamai_logo.svg new file mode 100644 index 000000000000..78cf6ad7e32b --- /dev/null +++ b/packages/akamai/img/akamai_logo.svg @@ -0,0 +1,151 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/packages/akamai/manifest.yml b/packages/akamai/manifest.yml new file mode 100644 index 000000000000..7b6eb4e3e361 --- /dev/null +++ b/packages/akamai/manifest.yml @@ -0,0 +1,26 @@ +name: akamai +title: Akamai +version: 0.1.0 +release: beta +description: Akamai Integration +type: integration +format_version: 1.0.0 +license: basic +categories: [security, network, web, cloud] +conditions: + kibana.version: "^7.16.0 || ^8.0.0" +icons: + - src: /img/akamai_logo.svg + title: Akamai + size: 409×167 + type: image/svg+xml +policy_templates: + - name: akamai + title: Akamai logs + description: Collect SIEM logs from Akamai + inputs: + - type: httpjson + title: "Collect Akamai SIEM logs via API" + description: "Collecting SIEM logs from Akamai via API" +owner: + github: elastic/security-external-integrations