Skip to content

Commit

Permalink
feat: ingress resource on config-scan support (aquasecurity#1726)
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <hen.keinan@gmail.com>
  • Loading branch information
chen-keinan authored Dec 31, 2023
1 parent b82a141 commit 67e96c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/configauditreport/controller/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (r *ResourceController) SetupWithManager(mgr ctrl.Manager) error {

// Determine which Kubernetes workloads the controller will reconcile and add them to resources
targetWorkloads := r.Config.GetTargetWorkloads()
targetWorkloads = append(targetWorkloads, strings.ToLower(string(kube.KindIngress)))
for _, tw := range targetWorkloads {
var resource kube.Resource
if err = resource.GetWorkloadResource(tw, &v1alpha1.ConfigAuditReport{}, r.ObjectResolver); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/kube/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ func (r *Resource) GetWorkloadResource(kind string, object client.Object, resolv
*r = Resource{Kind: KindCronJob, ForObject: resolver.GetSupportedObjectByKind(KindCronJob, &batchv1.CronJob{}), OwnsObject: object}
case "job":
*r = Resource{Kind: KindJob, ForObject: &batchv1.Job{}, OwnsObject: object}
case "ingress":
*r = Resource{Kind: KindIngress, ForObject: &networkingv1.Ingress{}, OwnsObject: object}
default:
return fmt.Errorf("workload of kind %s is not supported", kind)
}
Expand Down

0 comments on commit 67e96c6

Please sign in to comment.