Skip to content

Support S3 Object Deletion When Corresponding PolicyReport is Removed #734

@rivera-bl

Description

@rivera-bl

Hi,

First of all, thanks for this great tool!

I was wondering if it would be possible to delete S3 objects when the corresponding PolicyReport in Kubernetes is removed. I don't have much experience with Go, but I'm willing to contribute if pointed in the right direction.

From looking at the code, I think it shouldn't be too difficult. Maybe changing the S3 key so that the JSON file name is the PolicyReport UID? This would ensure uniqueness, correct? Then, we could create a Delete() function that triggers when the PolicyReport is deleted.

However, I'm not sure how the application currently uploads objects to S3 automatically when a new PolicyReport is created, so I don't know how to hook into the deletion process. Would this be a suitable feature? For us, it's essential because we want to reflect the cluster's vulnerability state accurately. Our goal is to store vulnerabilities in S3 and ingest them into a visualization service.

Also, I was able to run the application locally, but for some reason, it doesn’t pick up my S3 configuration from config.yaml. It only works when running in Kubernetes. I tried setting the access keys as environment variables and directly in config.yaml, but neither worked.

Any guidance would be greatly appreciated. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions