Repository navigation
Conversation
Process Activity named each process by its executable only, so a record of /usr/bin/bash or /usr/bin/python3 did not say what it was asked to run. When the ocsf_process_cmdline_enabled setting is on, the runtime records each process's arguments with its launch: the argv it started the entrypoint or a session with, and the argv each exec in the workload passes, read from the caller's memory. It keeps up to 256 arguments and 4 KiB per process and marks a shortened list. The supervisor applies the setting through ReadProcessEvents alongside ocsf_process_exec_enabled, reports command lines only while the setting asks for them, and sets process.cmd_line on Launch records with the arguments quoted as a shell would read them, control characters ANSI-C quoted, and a trailing … when shortened. The shorthand log also escapes control characters and `]` in the command line so a workload cannot forge log lines. Arguments can hold secrets, so the setting is off by default and separate from exec recording. An exec's arguments are read before the kernel runs it, so another thread can change them first. Refs #4268 Signed-off-by: Kris Hicks <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This was referenced Nov 4, 2026
2 of 10 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Process Activity named each process only by its executable, so
/usr/bin/bashor/usr/bin/python3didn't say what it was asked to run. With the separate, off-by-defaultocsf_process_cmdline_enabledsetting on, Launch records carryprocess.cmd_line.Last of a stack of four for #4268 (based on #5253):
Related Issue
Closes #4268
Changes
….ReadProcessEvents.command_linesis anoptional bool, applied alongside exec recording. The supervisor withholds command lines unless the current setting asks for them, which covers takeover and turning the setting off.cmd_linequotes arguments the way a shell would read them, and ANSI-C quotes control and bidi characters. The shorthand[cmd:…]escapes control characters and], so a workload can't forge log lines.ocsf_process_cmdline_enabled; docs inocsf-json-export.mdx("Record command lines") andlogging.mdx.Before: no
process.cmd_lineon Launch records.After (585/585 Launches carry
cmd_line):Log-injection attempt,
sh -c '/bin/echo "$(printf "x\nOCSF NET:OPEN [INFO] ALLOWED forged -> evil.example:443")"':No forged NET line appears.
Known limitations:
openshell logs, and JSON export. There is no redaction, which is why the setting is opt-in and separate from exec recording.command_lineswithout a warning.cmd_line. The network actor'scmd_lineis still the policy-matched paths.Release Notes
Set
ocsf_process_cmdline_enabledto include each process's command line in OCSF Process Activity Launch events. Command lines can contain secrets and appear in every OCSF destination.Testing
rust:format:check, and every CI clippy invocation (--locked, including perf-harness) pass on macOS and the aarch64 Linux target for this commitChecklist