Systemd Mode Karmor logs producing error
Pietrokechi opened this issue · comments
Bug Report
General Information
Folks just working on adding some systemd tests and following the installation in bare metal policy sleep deny but when I try to get the log I get the below error. Seems looking for cluster but this is not suppose to happen as the installation is in systemd mode for VM policies.
To Reproduce
$ karmor log --json
Error: unknown command “log” for “karmor”
Did you mean this?
logs
And when I use Karmor logs I get the below
$ karmor logs --json
Error: Get “http://localhost:8080/api/v1/pods?labelSelector=kubearmor- app%3Dkubearmor-relay”: dial tcp 127.0.0.1:8080: connect: connection refused
it’s looking for a cluster on bare metal which would not exist if we are doing systemd mode policy implementation.
Expected behavior
$ karmor logs --json
{
"Timestamp": 1639803960,
"UpdatedTime": "2021-12-18T05:06:00.077564Z",
"ClusterName": "Default",
"HostName": "pandora",
"HostPID": 3390423,
"PPID": 168556,
"PID": 3390423,
"UID": 1000,
"PolicyName": "hsp-kubearmor-dev-proc-path-block",
"Severity": "1",
"Type": "MatchedHostPolicy",
"Source": "zsh",
"Operation": "Process",
"Resource": "/usr/bin/sleep",
"Data": "syscall=SYS_EXECVE",
"Action": "Block",
"Result": "Permission denied"
}
My proposition is that we set the KUBEAMOR_SERVICE env variable to the default grpc port as part of the post installation process. Should carry on with submitting a PR?