Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions data_sources/java_hotspot_exceptions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Java HotSpot Exceptions
id: ed7674d5-562b-4df8-a3d1-e1f38b973686
version: 1
creation_date: '2026-11-17'
modification_date: '2026-11-18'
author: Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk
description: |
Custom HotSpot unified exception diagnostics, separate from application and container logs. A stock JDK does not create an exceptions.log file; its default unified logging sends warning and error messages to stdout. Tomcat writes JULI logs under ${catalina.base}/logs, Spring Boot writes application logs to the console by default, and Elasticsearch uses its configured log directory. None of those application logs supplies this HotSpot stream by default.

Add a JVM startup option such as `-Xlog:exceptions=debug:file=/var/log/myapp/exceptions-%p.log:utctime,pid,level,tags:filecount=8,filesize=16m`. Replace the directory with one writable by the Java service account; `%p` makes the filename process-specific. For Tomcat started by its scripts, set CATALINA_OPTS in CATALINA_BASE/bin/setenv.sh or setenv.bat; for a Windows Tomcat service, set its Java options in the service configuration. For Spring Boot, add the option to the `java` command or service/container JVM arguments, not `logging.file.name`, which configures application logging. For Elasticsearch, add a .options file under config/jvm.options.d (tar/zip or Docker) or /etc/elasticsearch/jvm.options.d (Debian/RPM). Preserve the product's existing JVM logging settings.

Forward the configured file and its rotations with a file monitor such as `[monitor:///var/log/myapp/exceptions-*.log*]`, and assign the custom sourcetype java:hotspot:exceptions. On the Splunk parsing tier, use SHOULD_LINEMERGE=false, TIME_PREFIX=^\[, TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N%z, and MAX_TIMESTAMP_LOOKAHEAD=32. Search-time field extraction is optional for the associated detections: they can parse the decorated raw lines with SPL `rex` and use `coalesce` to accept either raw or extracted fields. If you want reusable jvm_pid, jvm_tags, and jvm_message fields outside these detections, set KV_MODE=none on the search head and use the extraction below (or a shared REPORT transform):

EXTRACT-jvm_unified = ^\[(?<jvm_event_time>[^\]]+)\]\[(?<jvm_pid>\d+)\]\[(?<jvm_level>[^\]]+)\]\[(?<jvm_tags>[^\]]+)\]\s*(?<jvm_message>.*)$

Confirm that the raw events retain the `[utctime][pid][level][tags] message` format and that the host matches endpoint telemetry. When props.conf extraction is configured, verify the fields as well. Exception logging can be high volume; size the rotation and retention accordingly. Some continuation lines lack the decorators and will not match either single-line extraction.

JVM option reference: https://docs.oracle.com/en/java/javase/21/docs/specs/man/java.html
Tomcat logging: https://tomcat.apache.org/tomcat-11.0-doc/logging.html
Spring Boot logging: https://docs.spring.io/spring-boot/reference/features/logging.html
Elasticsearch JVM settings: https://www.elastic.co/docs/reference/elasticsearch/jvm-settings
mitre_components:
- Application Log Content
- Process Metadata
source: exceptions-*.log
sourcetype: java:hotspot:exceptions
supported_TA: []
fields:
- _time
- host
- source
- sourcetype
- jvm_event_time
- jvm_pid
- jvm_level
- jvm_tags
- jvm_message
output_fields:
- jvm_pid
- jvm_tags
- jvm_message
example_log: |-
[2026-11-17T20:47:53.225+0000][10181][debug][exceptions] java.lang.IllegalArgumentException in java.util.Base64$Decoder
32 changes: 32 additions & 0 deletions data_sources/java_hotspot_fatal_error.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Java HotSpot Fatal Error
id: 1052f27b-1818-4dd7-98c0-a73eeeee7873
version: 1
creation_date: '2026-11-17'
modification_date: '2026-11-18'
author: Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk
description: |
HotSpot fatal error reports are created only after a fatal JVM error. Without -XX:ErrorFile, the JDK tries to write hs_err_pid<pid>.log in the process working directory and falls back to the operating-system temporary directory if needed. On Linux this fallback is /tmp; on Windows it follows TMP or TEMP. Tomcat and Spring Boot do not supply one universal working directory, so inspect the service configuration. Elasticsearch sets its own JVM fatal-error path in its logging directory: /var/log/elasticsearch for Debian/RPM packages or the installation's logs directory for tar/zip distributions.

To make collection predictable, set a writable absolute path such as `-XX:ErrorFile=/var/log/myapp/hs_err_pid%p.log` in the JVM startup options. For Tomcat scripts use CATALINA_OPTS in setenv.sh or setenv.bat; for a Windows Tomcat service use its Java options. For Spring Boot set the Java service/container arguments. For Elasticsearch inspect its existing -XX:ErrorFile setting in jvm.options before changing it. Monitor the chosen path as java:hotspot:fatal. Extract jvm_pid from the hs_err_pid filename if needed; these reports do not share the unified-log `[time][pid][level][tags]` format or guarantee a jvm_message field. A fatal report is not a required result of exploitation.

JDK fatal-error location: https://docs.oracle.com/en/java/javase/24/troubleshoot/location-fatal-error-log.html
Elasticsearch JVM settings: https://www.elastic.co/docs/reference/elasticsearch/jvm-settings
mitre_components:
- Application Log Content
- Process Termination
source: hs_err_pid*.log
sourcetype: java:hotspot:fatal
supported_TA: []
fields:
- _time
- host
- source
- sourcetype
- jvm_pid
- _raw
output_fields:
- jvm_pid
- source
- _raw
example_log: |-
A fatal error has been detected by the Java Runtime Environment: SIGSEGV
37 changes: 37 additions & 0 deletions data_sources/java_hotspot_jit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Java HotSpot JIT
id: 2b9c9f97-1e72-4be6-9e3e-0f8681bb86ad
version: 1
creation_date: '2026-11-17'
modification_date: '2026-11-18'
author: Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk
description: |
Custom HotSpot JIT compilation diagnostics, separate from Tomcat, Spring Boot, and Elasticsearch application logs. A stock JDK does not create a jit.log file or emit JIT compilation details at its default warning/error unified logging level. The file path is chosen by the JVM startup configuration, regardless of the application framework.

Add a JVM startup option such as `-Xlog:jit+compilation=debug:file=/var/log/myapp/jit-%p.log:utctime,pid,level,tags:filecount=8,filesize=16m`. Create a directory writable by the Java service account and preserve existing JVM options. For Tomcat started by its scripts, set CATALINA_OPTS in CATALINA_BASE/bin/setenv.sh or setenv.bat; for a Windows Tomcat service, use its Java options. For Spring Boot, add the option to the `java` command or service/container JVM arguments. For Elasticsearch, use config/jvm.options.d for tar/zip or Docker and /etc/elasticsearch/jvm.options.d for Debian/RPM.

Forward the configured file and rotations with a file monitor such as `[monitor:///var/log/myapp/jit-*.log*]`, and assign the custom sourcetype java:hotspot:jit. On the Splunk parsing tier, use SHOULD_LINEMERGE=false, TIME_PREFIX=^\[, TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N%z, and MAX_TIMESTAMP_LOOKAHEAD=32. The associated detection can parse `[utctime][pid][level][tags] message` directly from _raw with SPL `rex`, so props.conf search-time field extraction is optional. If you want reusable fields outside the detection, set KV_MODE=none on the search head and extract jvm_pid, jvm_tags, and jvm_message with the same EXTRACT regex or REPORT transform described in Java HotSpot Exceptions. Verify the raw format, optional fields, and host naming before using the detection. A JIT message shows compilation activity, not that a particular intrinsic executed.

JVM option reference: https://docs.oracle.com/en/java/javase/21/docs/specs/man/java.html
Elasticsearch JVM settings: https://www.elastic.co/docs/reference/elasticsearch/jvm-settings
mitre_components:
- Application Log Content
- Process Metadata
source: jit-*.log
sourcetype: java:hotspot:jit
supported_TA: []
fields:
- _time
- host
- source
- sourcetype
- jvm_event_time
- jvm_pid
- jvm_level
- jvm_tags
- jvm_message
output_fields:
- jvm_pid
- jvm_tags
- jvm_message
example_log: |-
[2026-11-17T20:47:52.225+0000][10181][debug][jit,compilation] java.util.Base64$Decoder::decode0
45 changes: 45 additions & 0 deletions data_sources/sysmon_for_linux_eventid_5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Sysmon for Linux EventID 5
id: 90e933ac-a4f8-451a-9bd5-16fd61c40910
version: 1
creation_date: '2026-11-17'
modification_date: '2026-11-17'
author: Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk
description: Logs process termination on Linux, including the image and PID of the process that exited.
mitre_components:
- Process Termination
- Process Metadata
source: Syslog:Linux-Sysmon/Operational
sourcetype: sysmon:linux
separator: EventID
separator_value: '5'
supported_TA:
- name: Splunk Add-on for Sysmon for Linux
url: https://splunkbase.splunk.com/app/6652
version: 1.0.0
fields:
- _time
- Computer
- EventID
- Image
- ProcessGuid
- ProcessId
- RuleName
- UtcTime
- User
- dest
- host
- index
- process_guid
- process_id
- process_name
- process_path
- source
- sourcetype
output_fields:
- dest
- process_guid
- process_id
- process_name
- process_path
- user
example_log: <Event><System><Provider Name="Linux-Sysmon"/><EventID>5</EventID><Channel>Linux-Sysmon/Operational</Channel><Computer>ar-linux</Computer></System><EventData><Data Name="RuleName">-</Data><Data Name="UtcTime">2026-11-17 20:48:00.000</Data><Data Name="ProcessGuid">{ec23eae3-3a27-62f2-085e-16549b550000}</Data><Data Name="ProcessId">10181</Data><Data Name="Image">/usr/bin/java</Data><Data Name="User">ubuntu</Data></EventData></Event>
60 changes: 60 additions & 0 deletions data_sources/zeek_http_post_body.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Zeek HTTP POST Body
id: 6e1fbb4c-d568-43b4-910d-3a3fdef03ae0
version: 1
creation_date: '2026-11-17'
modification_date: '2026-11-18'
author: Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk
description: |
Custom HTTP/1.1 POST-body log. The TA for Zeek does not produce or parse this stream.

The Zeek logger writes one JSON record per completed POST request to http_post_body.log. Include uid, the connection tuple, method, uri, body, body_bytes, logged_bytes, and truncated. Limit the captured body to 64 KiB.

Download the custom http-post-body.zeek script from https://gist.github.com/nasbench/4cd18a938056cbfbc8a9832edb26f4c4 and place it in /opt/zeek/share/zeek/site/. This script is not included with ESCU or the TA for Zeek. Add `redef LogAscii::use_json = T;` and `@load ./http-post-body` to
/opt/zeek/share/zeek/site/local.zeek, then run `sudo /opt/zeek/bin/zeekctl deploy`. The sensor must see HTTP request plaintext.

On the Zeek forwarder, add this inputs.conf stanza (replace zeek with your index):

[monitor:///opt/zeek/logs/current/http_post_body.log]
disabled = 0
index = zeek
sourcetype = zeek:http_post_body:json

Add this props.conf stanza on the parsing tier for line handling and on the search head for JSON extraction:

[zeek:http_post_body:json]
SHOULD_LINEMERGE = false
TRUNCATE = 524288
KV_MODE = json

Restart or reload the affected components and configure the zeek_http_post_body macro to select the indexed events.
Confirm that uid, id.orig_h, id.resp_h, uri, body, and truncated are extracted, and use only truncated=false events for complete bodies.
mitre_components:
- Network Traffic Content
- Application Log Content
source: http_post_body.log
sourcetype: zeek:http_post_body:json # Custom sourcetype
configuration: https://gist.github.com/nasbench/4cd18a938056cbfbc8a9832edb26f4c4
supported_TA: []
fields:
- ts
- uid
- id.orig_h
- id.orig_p
- id.resp_h
- id.resp_p
- method
- uri
- host
- body
- body_bytes
- logged_bytes
- truncated
output_fields:
- uid
- id.orig_h
- id.resp_h
- uri
- body
- truncated
example_log: |-
{"ts":1794948473.225,"uid":"Cexample123","id.orig_h":"10.0.2.1","id.resp_h":"10.0.2.13","method":"POST","uri":"/test","body":"{}","body_bytes":2,"logged_bytes":2,"truncated":false}
64 changes: 64 additions & 0 deletions data_sources/zeek_http_request_headers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Zeek HTTP Request Headers
id: 8b70371a-f613-48d2-80af-48d5be32e745
version: 1
creation_date: '2026-11-17'
modification_date: '2026-11-18'
author: Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk
description: |
Custom HTTP/1.1 request-header log. The TA for Zeek does not produce or parse this stream.
The Zeek logger writes one JSON record per selected header to http_request_headers.log.

Capture Authorization, HTTP2-Settings, Content-Type, Content-Disposition, Priority, X-ConsoleAnnotator, X-Connect-Authorization, and X-CSRF-Token.

Limit each header value to 8 KiB and include uid, the connection tuple, header_name, header_value, value_bytes, logged_bytes, and truncated.

Download the custom http-request-headers.zeek script from https://gist.github.com/nasbench/8581572459af92b7c30599f1068c791f and place it in /opt/zeek/share/zeek/site/. This script is not included with ESCU or the TA for Zeek. Add `redef LogAscii::use_json = T;` and `@load ./http-request-headers` to /opt/zeek/share/zeek/site/local.zeek, then run `sudo /opt/zeek/bin/zeekctl deploy`. The sensor must see HTTP request plaintext.

On the Zeek forwarder, add this inputs.conf stanza (replace zeek with your index):

[monitor:///opt/zeek/logs/current/http_request_headers.log]
disabled = 0
index = zeek
sourcetype = zeek:http_request_header:json

Add this props.conf stanza on the parsing tier for line handling and on the search head for JSON extraction:

[zeek:http_request_header:json]
SHOULD_LINEMERGE = false
TRUNCATE = 32768
KV_MODE = json

Restart or reload the affected components and configure the zeek_http_request_headers macro to select the indexed events.
Confirm that uid, id.orig_h, id.resp_h, header_name, header_value, and truncated are extracted, and use only truncated=false events for complete values.
mitre_components:
- Network Traffic Content
- Application Log Content
source: http_request_headers.log
sourcetype: zeek:http_request_header:json # Custom sourcetype
configuration: https://gist.github.com/nasbench/8581572459af92b7c30599f1068c791f
supported_TA: []
fields:
- ts
- uid
- id.orig_h
- id.orig_p
- id.resp_h
- id.resp_p
- method
- uri
- host
- header_name
- header_value
- value_bytes
- logged_bytes
- truncated
output_fields:
- uid
- id.orig_h
- id.resp_h
- uri
- header_name
- header_value
- truncated
example_log: |-
{"ts":1794948473.225,"uid":"Cexample123","id.orig_h":"10.0.2.1","id.resp_h":"10.0.2.13","method":"GET","uri":"/","header_name":"AUTHORIZATION","header_value":"Basic YYYY","value_bytes":10,"logged_bytes":10,"truncated":false}
Loading
Loading