kubewarden / audit-scanner

Reports evaluation of existing Kubernetes resources with your already deployed Kubewarden policies.
https://kubewarden.io
Apache License 2.0
7 stars 8 forks source link

invalid memory address or nil pointer dereference #376

Closed ferhatguneri closed 1 month ago

ferhatguneri commented 1 month ago

Is there an existing issue for this?

Current Behavior

PATCH:https://198.18.0.1:443/apis/wgpolicyk8s.io/v1alpha2/clusterpolicyreports/1256bac9-fe53-406c-8eb4-a3c5edfa3801 {"level":"error","error":"Post \"https://policy-server-default.cattle-kubewarden-system.svc:8443/audit/clusterwide-cluster-capabilities-protect-namespaces\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)","response":{"admissionRequest-name":"searchsrvr-84bf9f9ddc-j2p88","policy":"cluster-capabilities-protect-namespaces","resource":"searchsrvr-84bf9f9ddc-j2p88"},"time":"2024-09-20T07:09:43Z","message":"error sending AdmissionReview to PolicyServer"} panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1949d06] goroutine 17033 [running]: github.com/kubewarden/audit-scanner/internal/scanner.(Scanner).auditResource.func1() /workspace/internal/scanner/scanner.go:358 +0x366 created by github.com/kubewarden/audit-scanner/internal/scanner.(Scanner).auditResource in goroutine 17240 /workspace/internal/scanner/scanner.go:330 +0x265

Expected Behavior

Audit scanner to complete just fine

Steps To Reproduce

Start audit scanner on a large cluster

Environment

- OS:
- Architecture:

Anything else?

No response

flavio commented 1 month ago

This has been fixed a couple of days ago with https://github.com/kubewarden/audit-scanner/pull/369

The fix currently lives only on the main branch, but we are going to tag 1.17.0-rc3 later today.

The 1.17.0 is expected by the end of next week