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

[8.16](backport #41863) helper/hasher general improvements #41874

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 3, 2024

Proposed commit message

  • Fix a TOCTOU by opening the file handle and then doing stat(), instead of doning stat() and then opening.
  • Make sure this is a regular file, otherwise you could trick auditbeat into hashing an infinite source like a pipe.
  • Allow for rate (but not file size) to be infinite, this is needed for an upcoming new backend for module/system/process.
  • Finally, fix error messages that show up on ECS, see below.

before:

failed to hash executable /d/e/beats/x-pack/auditbeat/auditbeat for PID 50751: failed to hash file /d/e/beats/x-pack/auditbeat/auditbeat: hasher: file size 143673152 exceeds max file size

after:

failed to hash executable /d/e/beats/x-pack/auditbeat/auditbeat for PID 50804: size 143673152 exceeds max file size

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

error.message will stop duplicating text.


This is an automatic backport of pull request #41863 done by Mergify.

 * Fix a TOCTOU by opening the file handle and then doing stat(), instead of
   doning stat() and then opening.
 * Make sure this is a regular file, otherwise you could trick auditbeat into
   hashing an infinite source like a pipe.
 * Allow for rate (but not file size) to be infinite, this is needed for an
   upcoming new backend for module/system/process.
 * Finally, fix error messages that show up on ECS, see below.

before:
```
failed to hash executable /d/e/beats/x-pack/auditbeat/auditbeat for PID 50751: failed to hash file /d/e/beats/x-pack/auditbeat/auditbeat: hasher: file size 143673152 exceeds max file size
```

after:
```
failed to hash executable /d/e/beats/x-pack/auditbeat/auditbeat for PID 50804: size 143673152 exceeds max file size
```

(cherry picked from commit 8b38b65)
@mergify mergify bot added the backport label Dec 3, 2024
@mergify mergify bot requested a review from a team as a code owner December 3, 2024 20:21
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 3, 2024
@haesbaert haesbaert enabled auto-merge (squash) December 3, 2024 20:23
@haesbaert haesbaert disabled auto-merge December 3, 2024 20:29
@haesbaert haesbaert added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Dec 3, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 3, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

@haesbaert haesbaert enabled auto-merge (squash) December 4, 2024 06:38
@haesbaert haesbaert merged commit ccf9983 into 8.16 Dec 4, 2024
30 checks passed
@haesbaert haesbaert deleted the mergify/bp/8.16/pr-41863 branch December 4, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Security-Linux Platform Linux Platform Team in Security Solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants