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

Testing #2

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion KubeArmor/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Apache-2.0

Check warning on line 1 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-lint

invalid file KubeArmor/main.go: KubeArmor/main.go:41:68: missing ',' before newline in argument list (and 10 more errors)
// Copyright 2021 Authors of KubeArmor

// Package main is the entrypoint to initializing the armor
Expand Down Expand Up @@ -35,22 +35,23 @@
}

func main() {
kg.Printf("Need to have root privileges to run %s\n", os.Args[0])
if os.Geteuid() != 0 {
if os.Getenv("KUBEARMOR_UBI") == "" {
kg.Printf("Need to have root privileges to run %s\n", os.Args[0])
kg.Printf("Need to have root privileges to run %s\n", os.Args[0]

Check failure on line 41 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' before newline in argument list
return

Check failure on line 42 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

expected operand, found 'return'

Check failure on line 42 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' in argument list

Check failure on line 42 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

expected operand, found newline
}
}
// initial clean up

bpfMapsDir := "/sys/fs/bpf/"
bpfMapsName := []string{"kubearmor_config", "kubearmor_events", "kubearmor_containers", "kubearmor_visibility", "kubearmor_alert_throttle"}
for _, mp := range bpfMapsName {

Check failure on line 49 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' in argument list

Check failure on line 49 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' in argument list

Check failure on line 49 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

expected operand, found 'range'
path := bpfMapsDir + mp
/* This should not be triggered in ideal cases,
if this is triggered that means there is incomplete cleanup process
from the last installation */
if _, err := os.Stat(path); !os.IsNotExist(err) {

Check failure on line 54 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' in argument list

Check failure on line 54 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' in argument list

Check failure on line 54 in KubeArmor/main.go

View workflow job for this annotation

GitHub Actions / go-vuln

missing ',' in argument list
err = os.Remove(path)
if err != nil {
kg.Err(err.Error())
Expand Down
Loading