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

Set ownerReference for configauditreports resource #49

Closed
danielpacak opened this issue Jun 4, 2020 · 4 comments
Closed

Set ownerReference for configauditreports resource #49

danielpacak opened this issue Jun 4, 2020 · 4 comments
Assignees
Labels
crd/configauditreports This issue is somehow related to the configauditreports.aquasecurity.github.io resource 🙏 help wanted Extra attention is needed 🧑‍🎓 good first issue Good for newcomers

Comments

@danielpacak
Copy link
Contributor

No description provided.

@danielpacak danielpacak added 🧑‍🎓 good first issue Good for newcomers 🙏 help wanted Extra attention is needed crd/configauditreports This issue is somehow related to the configauditreports.aquasecurity.github.io resource labels Jun 4, 2020
@danielpacak danielpacak added this to the Release v0.3.0 milestone Jun 4, 2020
@rbren
Copy link

rbren commented Jun 8, 2020

Just to clarify - the ConfigAuditReport would get an ownerReference pointing back to the resource it audited?

@danielpacak
Copy link
Contributor Author

Yes. So If we have a ConfigAuditReport for Deployment B, and the Deployment B is removed we can take advantage of Kubernetes Garbage Collector to remove orphaned audit reports.

@krisctl
Copy link
Contributor

krisctl commented Jul 31, 2020

Hi @danielpacak,

I have been trying to solve this issue for some time but probably need some guidance. Where in the starboard codebase can I find references to the parent resources for which the audit reports are created? I played around polaris/crd/writer.go to no avail and also tried updating KubernetesResource like so:
type KubernetesResource struct {
Kind string json:"kind"
Name string json:"name"
UID types.UID json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"
ApiVersion string json:"apiVersion"
}

in /pkg/apis/aquasecurity/v1alpha1/common_types.go but could not get any further. I would really appreciate some pointers here. Thanks!

@danielpacak
Copy link
Contributor Author

Hey @krisctl !

It's going to be easier to resolve this issue once we implement #29

Currently we do run Polaris checker for all workloads accessible in a cluster, and then we convert the Polaris model to Starboard model in https://github.com/aquasecurity/starboard/blob/master/pkg/polaris/converter.go#L76

IIRC Polaris does not return UUID of Kubernetes workloads so we have to structure and refactor in a way to get somehow ObjectPartialMetadata just before we set the ownerReference

@danielpacak danielpacak self-assigned this Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crd/configauditreports This issue is somehow related to the configauditreports.aquasecurity.github.io resource 🙏 help wanted Extra attention is needed 🧑‍🎓 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants