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

handling empty owner field #1266

Merged
merged 1 commit into from
Jun 13, 2023
Merged

handling empty owner field #1266

merged 1 commit into from
Jun 13, 2023

Conversation

Prateeknandle
Copy link
Collaborator

@Prateeknandle Prateeknandle commented Jun 13, 2023

Purpose of PR?:
Currently we're getting empty owner field in karmor logs, when owner's log info is empty. This pr resolves it.
Added some checks to checkout empty log owner info.

Logs having empty owner info:

ClusterName: default
HostName: prateek-lenovo-ideapad-310-15isk
NamespaceName: default
PodName: nginx
ContainerName: 2455eecdfe6f80c7647c7e39340635a38198751e29db6863faab8b1c6ef37ec2
ContainerID: 2455eecdfe6f80c7647c7e39340635a38198751e29db6863faab8b1c6ef37ec2
Type: ContainerLog
Source: /usr/sbin/nginx
Resource: /etc/group
Operation: File
Data: syscall=SYS_OPENAT fd=-100 flags=O_RDONLY|O_CLOEXEC
Result: Passed
HostPID: 131118
HostPPID: 131059
PID: 30
PPID: 1
ParentProcessName: /usr/sbin/nginx
ProcessName: /usr/sbin/nginx

Logs having owner info:

== Log / 2023-06-13 16:49:56.725239 ==
ClusterName: default
HostName: prateek-lenovo-ideapad-310-15isk
NamespaceName: default
PodName: nginx
Labels: run=nginx
ContainerName: nginx
ContainerID: 2455eecdfe6f80c7647c7e39340635a38198751e29db6863faab8b1c6ef37ec2
ContainerImage: docker.io/library/nginx:latest@sha256:be51ee4ca05e6aaee1dd95bec50efdd5aed33390fbb21e7c29931ef5c8e1309a
Type: ContainerLog
Source: /usr/sbin/nginx -g daemon off;
Operation: Syscall
Data: syscall=SYS_SETGID userid=0
Result: Passed
HostPID: 131059
HostPPID: 131052
Owner: map[Name:nginx Namespace:default Ref:Pod]
PID: 1
PPID: 131052
ProcessName: /usr/sbin/nginx

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

Can you add a sample kArmor log without owner reference? This will help keep track of what was fixed in the PR.

@Prateeknandle
Copy link
Collaborator Author

Can you add a sample kArmor log without owner reference? This will help keep track of what was fixed in the PR.

done.

@daemon1024 daemon1024 merged commit 1346451 into kubearmor:main Jun 13, 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.

2 participants