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

The _scanFunction is not a public property on the ServerlessClamscan construct #786

Open
whatsrupp opened this issue Mar 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@whatsrupp
Copy link

this._scanFunction

is not a public variable on the ServerlessClamscan construct. This limits the ability to extend the stack. Has this been done for a reason?

I mainly need the ability to

  1. Export properties from scan function to other stacks
  2. Add new triggers for the scan lambda - primarily for reprocessing.

It would be a fairly quick change to add it as a new public variable in the ServerlessClamscan construct so that people can extend the scan lambda where necessary

Failing this, how is best to trigger scans on objects in buckets that existed before ServerlessClamscan was pointed at the old bucket?

@dontirun
Copy link
Contributor

I did not want users to have the ability to directly modify the lambda function when I initially designed the construct because I didn't think of the scenarios where this would be helpful, especially since the scanning lambda was designed specifically for s3 notifications and the construct did not initially allow for using imported buckets.

That being said, I think it's reasonable request to expose it.

Would you be willing to submit a PR for this?

@whatsrupp
Copy link
Author

I'm going to give it a go and use this approach to access the private property , and see if it works well - if it does, am happy to open a PR.

Other use cases could be where you have a bucket where you want to trigger other side effects other than just this lambda at the bucket create event (As you can only hook a single trigger into a bucket create event, you need to fan it out to SNS if you want to do that, which would mean the AV lambda would need to subscribe to that instead)

Although at that point, maybe that's where you realise that you should probably just write something more custom 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants