Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auditbeat: socket reports truncated process name #24667

Closed
adriansr opened this issue Mar 22, 2021 · 1 comment · Fixed by #29410
Closed

Auditbeat: socket reports truncated process name #24667

adriansr opened this issue Mar 22, 2021 · 1 comment · Fixed by #29410
Labels
bug help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@adriansr
Copy link
Contributor

adriansr commented Mar 22, 2021

Auditbeat's system/socket dataset can return truncated process names in two scenarios:

  1. When the table of running processes its bootstrapped during startup, the "comm" field of /proc/<pid>/stat is used as the process name. This value is truncated to 15 chars by the kernel (TASK_COMM_LEN=16).

To align with the rest of the system/socket code, the filename extracted from the executable path should be used.

Example document:

{
    "@timestamp": "2021-03-22T08:57:10.558Z",
    "process": {
      "pid": 21830,
      "name": "elastic-endpoin",
      "args": [
        "/opt/Elastic/Endpoint/elastic-endpoint",
        "run"
      ],
      "executable": "/opt/Elastic/Endpoint/elastic-endpoint",
      "created": "2021-03-04T14:05:55.860Z"
    },
   [...]
}
  1. When an execve event is received, the length of the executable path and program arguments is limited to 128 characters each. When path is truncated, the wrong process name will be extracted from it.

As a suggestion, we could detect this truncation and do an alternative enrichment from /proc/<pid>/.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@adriansr adriansr added the help wanted Indicates that a maintainer wants help on an issue or pull request label Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
2 participants