-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit the size of manifests/signatures sync/upload
Adds new settings to limit the size of manifests and signatures as a safeguard to avoid DDoS attack during sync and upload operations. To also prevent this during image upload, this commit configures a `client_max_body_size` for manifests and signatures Nginx endpoints. Modify the blob upload to read the layers in chunks. closes: #532
- Loading branch information
Showing
8 changed files
with
180 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Added support to the `MANIFEST_PAYLOAD_MAX_SIZE` and `SIGNATURE_PAYLOAD_MAX_SIZE` settings to define | ||
limits (for the size of Manifests and Signatures) to protect against OOM DoS attacks during synchronization tasks | ||
and image uploads. | ||
Additionally, the Nginx snippet has been updated to enforce the limit for these endpoints. | ||
Modified the internal logic of Blob uploads to read the receiving layers in chunks, | ||
thereby reducing the memory footprint of the process. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Limit the size of Manifests and Signatures | ||
|
||
It is possible to configure Pulp to block the synchronization and upload of image Manifests and/or | ||
Signatures if they exceed a defined size. A use case for this feature is to avoid OOM DoS attacks | ||
when synchronizing remote repositories with malicious or compromised containter images. | ||
To implement this, use the following settings: | ||
``` | ||
MANIFEST_MAX_PAYLOAD_SIZE=<bytes> | ||
SIGNATURE_MAX_PAYLOAD_SIZE=<bytes> | ||
``` | ||
|
||
!!! info | ||
By default, there is no definition for these settings, meaning that no limit will be enforced. | ||
|
||
|
||
!!! note | ||
A common value adopted by other registries is to set these values to 4MB (4000000). |
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
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
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
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
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
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