-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: deny list #174
Merged
Merged
feat: deny list #174
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Allow users to specify deny list rules for the construct hub. Rules can match a package name and optionally a specific version. If a package is matched against a rule, the package is ignored and a log entry is emitted with the reason information.
d7ce166
to
d620e50
Compare
I forgot to grant permissions to read the Bucket and start the State Machines executions... Oops. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdklabs/construct-hub/actions/runs/1058031052 ------ *Automatically created by projen via the "upgrade-dependencies" workflow*
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Co-authored-by: Automation <github-actions@github.com>
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdklabs/construct-hub/actions/runs/1061359517 ------ *Automatically created by projen via the "upgrade-dependencies" workflow*
Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdklabs/construct-hub/actions/runs/1063494650 ------ *Automatically created by projen via the "upgrade-dependencies" workflow*
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
RomainMuller
suggested changes
Jul 27, 2021
RomainMuller
approved these changes
Jul 28, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved as discussed - outstanding minor comments to be handled in a subsequent PR.
mergify bot
pushed a commit
that referenced
this pull request
Jul 28, 2021
As a follow up of #174, we decided that we wanted the catalog builder to consult the deny list and avoid adding any packages to the catalog that match. This should be applied to full rebuilds as well as to incremental additions. This change adds this behavior to the catalog builder (along with tests) and also changes the deny list prune component to trigger a catalog rebuild only once instead of per deletion. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow users to specify deny list rules for the construct hub. Rules can match a package name and optionally a specific version. If a package is matched against a rule, the package is ignored by the discovery function, its relevant objects are deleted from the package data bucket and the catalog is created.
Design
A
deny-list.json
file is created in a dedicated S3 bucket and contains a hash map frompackage
(orpackage/vX.Y.Z
) to the deny list rule. ADenyListClient
is provided with a simple API for consuming the deny list.The discovery function will skip any packages that match a deny list rule.
An AWS Lambda function called "Prune Handler" is triggered every time the deny list is updated and periodically every 5 minutes (to compensate for race conditions with the ingestion flow). The prune handler iterates over the deny list and lists all the S3 objects in the package data bucket that match the prefix. It queues the matched objects into an SQS queue.
The SQS queue is consumed by another handler called "Prune Delete Handler" which deletes pruned objects and also triggers the catalog builder function so that the catalog will be rebuilt as needed.
We have also added REMOVE_OBJECT notification to the cache invalidation handler to make sure deleted objects are reflected in the edge cache as soon as possible. This required changing the cache invalidation
CallerReference
to use the Lambda request ID instead of the object ID.A section was added to the backend dashboard which monitors these resources.
Integration Tests
This commit also adds support for integration tests, which work similarly to AWS CDK integration tests. They are small CDK apps (with the
xxx.integ.ts
suffix) which can be deployed usingyarn integ:xxx:deploy
and if their deployment is successful, a snapshot is stored and compared against a synthesized result during tests. To implement integration test assertions, users can implement atrigger.xxx.lambda.ts
handlers which can be added to the test app and executed during deployment (see README for more details).Misc
Resolves https://github.com/cdklabs/construct-hub-internal/issues/34
Resolves #66
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license