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

fix(monitor): set actual process name in logs instead of symlinks #1251

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

daemon1024
Copy link
Member

We resolved actual process names in and stored it in the userspace process map, but we never updated the log base created in kprobe event.

This PR removes the null check and updates the log base with actual process names in the kretprobe event which we would have recieved from the bprm hook which was triggered before kretprobe execve(at)

Purpose of PR?:

Fixes #984

Does this PR introduce a breaking change?
No

If the changes in this PR are manually verified, list down the scenarios covered::
Check Telemetry Info using kArmor logs

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

  • Bug fix. Fixes Inconsistent Behaviour with Symlinks Execution #984
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

We resolved actual process names in and stored it in the userspace process map, but we never updated the log base created in kprobe event.

This commit removes the null check and updates the log base with actual process names in the kretprobe event which we would have recieved from the bprm hook which was triggered before kretprobe execve(at)

Signed-off-by: daemon1024 <[email protected]>
@daemon1024
Copy link
Member Author

{"Timestamp":1685455502,"UpdatedTime":"2023-05-30T14:05:02.615298Z","NamespaceName":"container_namespace","PodName":"armored-container","ContainerID":"ce0e9a12750f6e26dc8e8481be8ef26035608d02bd2b27385ca47e6e11bdb651","ContainerName":"armored-container","ParentProcessName":"/bin/busybox","ProcessName":"/bin/busybox","HostPPID":59047,"HostPID":96816,"PPID":1,"PID":19,"Type":"ContainerLog","Source":"/bin/busybox","Operation":"Process","Resource":"/bin/cat file.txt","Data":"syscall=SYS_EXECVE","Result":"Passed"}

Copy link
Contributor

@nyrahul nyrahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@achrefbensaad achrefbensaad merged commit 3e918bd into kubearmor:main Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent Behaviour with Symlinks Execution
3 participants