-
Notifications
You must be signed in to change notification settings - Fork 8
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: Warn instead of panic when API resource not found or forbidden #73
Commits on Jul 24, 2023
-
fix: Don't emit both Info & Error logs for PolicyReports
Before this fix, we were doing log.Info().Err(err), which emits a one-line log that is both info and error: {"level":"info","error":"resource not found","namespace":"demo2","time":"2023-07-24T15:23:17+02:00","message":"no pre-existing PolicyReport, will create one at the end of the scan"} Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ccb9695 - Browse repository at this point
Copy the full SHA ccb9695View commit details -
fix: Skip clusterwide resources in getResourcesForPolicies
We are looking for namespaced resources, clusterwide resources get checked in getClusterWideResourcesForPolicies() Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 478f74f - Browse repository at this point
Copy the full SHA 478f74fView commit details -
fix: Warn instead of panic when API resource not found or forbidden
When policies are configured with a spec.rules GVK, if resource doesn't exist because it has an incorrect GVK, or if because it is a CRD that we don't know about, emit warning and skip resource from scan. The same for when policies are configured with a spec.rules GVK that the audit-scanner lacks permissions for, emit warning and skip resource from scan. Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6682cbd - Browse repository at this point
Copy the full SHA 6682cbdView commit details -
docs: locally run with a specific ServiceAccount
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4de1faf - Browse repository at this point
Copy the full SHA 4de1fafView commit details
Commits on Jul 25, 2023
-
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3ee1086 - Browse repository at this point
Copy the full SHA 3ee1086View commit details -
tests: Add fakeClient now that we check if res are namespaced
Needed, as we need a client when we do `fetcher.isNamespacedResource()`. Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c41a12a - Browse repository at this point
Copy the full SHA c41a12aView commit details -
tests: Add test for incorrect GVKs
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 925e018 - Browse repository at this point
Copy the full SHA 925e018View commit details -
tests: Add test to show clusterwide res are skipped
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ff99749 - Browse repository at this point
Copy the full SHA ff99749View commit details -
tests: Add TestLackOfPermsWhenGettingResources()
Add a test that checks that we don't error nor panic when trying to filter resources that are forbidden (because the client lacks permissions, normally because the ServiceAccount is insufficient). Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 04c72ca - Browse repository at this point
Copy the full SHA 04c72caView commit details -
chore: Make golint-ci happy, and me a bit less
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 91944ce - Browse repository at this point
Copy the full SHA 91944ceView commit details