-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix: limit the plugin output size #484
fix: limit the plugin output size #484
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #484 +/- ##
==========================================
+ Coverage 80.39% 80.47% +0.08%
==========================================
Files 34 35 +1
Lines 3330 3344 +14
==========================================
+ Hits 2677 2691 +14
Misses 508 508
Partials 145 145 ☔ View full report in Codecov by Sentry. |
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.
I actually have a couple of questions regarding this PR and the issue #187 itself:
- We are essentially limiting the behavior of a plugin due to a certain extent of
untrust
. Do we need to reflect this in the Notary project spec? (such as, where does the 10MiB comes from?) - What security concern do we have if the plugin output size is larger than 10 MiB? According to Notation threat model: https://github.com/notaryproject/specifications/blob/main/threatmodels/notation-threatmodel.md, plugins are inside the trust boundary. If we do not trust the plugin's output, how do we interpret the trust boundary then?
|
Note: any extra restriction on the plugin without reflecting in the spec may lead to potential breaking changes for Notation. It's not about the number, whether it's 10 or 64. It's about best practice. The reason is simple, plugin builders follow the spec: https://github.com/notaryproject/specifications/blob/main/specs/plugin-extensibility.md to build their plugins. Any extra restriction that's not in that spec can be a hidden rule and unexpected.
If we indeed do not have any security concern regarding this issue, then we should leave the control to plugin authors and users. If a plugin has a bug, its usage should be dropped until the bug is fixed right? I don't think this is in Notation's scope, just like we do not censor the output content of a plugin. |
As per our online discussion, I created a corresponding Spec PR: notaryproject/specifications#320 |
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.
LGTM with suggestions
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.
LGTM
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.
LGTM
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.
LGTM
@JeyJeyGao Please sign all the commits. |
8c94583
to
ecd22a2
Compare
commit ecd22a2 Author: Junjie Gao <junjiegao@microsoft.com> Date: Tue Dec 3 06:19:18 2024 +0000 fix: update comment Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 32ae375 Author: Junjie Gao <junjiegao@microsoft.com> Date: Mon Dec 2 09:10:37 2024 +0000 fix: update Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 0076d0f Author: Junjie Gao <junjiegao@microsoft.com> Date: Mon Dec 2 03:13:08 2024 +0000 fix: update LimitedWriter Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 067d4f6 Author: Junjie Gao <junjiegao@microsoft.com> Date: Mon Dec 2 02:32:17 2024 +0000 fix(test): update Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 3099d35 Author: Junjie Gao <junjiegao@microsoft.com> Date: Mon Dec 2 10:03:54 2024 +0800 perf(log): encode objects only when logged (notaryproject#481) Fix: - replaced `.String()` with the `%v` format to avoid rendering the string before actually logging it. Resolves notaryproject#480 Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 8bc331b Author: Patrick Zheng <patrickzheng@microsoft.com> Date: Mon Dec 2 08:30:56 2024 +0800 fix: enable timestamping cert chain revocation check during signing (notaryproject#482) Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 161a736 Author: Junjie Gao <junjiegao@microsoft.com> Date: Mon Dec 2 02:13:35 2024 +0000 fix: resolve comments for Shiwei Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 665e111 Author: Junjie Gao <junjiegao@microsoft.com> Date: Fri Nov 29 08:07:16 2024 +0000 fix: update code style Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 5d6c89e Author: Junjie Gao <junjiegao@microsoft.com> Date: Fri Nov 29 08:06:15 2024 +0000 fix: update comments Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 3bc343d Author: Junjie Gao <junjiegao@microsoft.com> Date: Fri Nov 29 07:42:38 2024 +0000 fix: update comment Signed-off-by: Junjie Gao <junjiegao@microsoft.com> commit 69303b5 Author: Junjie Gao <junjiegao@microsoft.com> Date: Fri Nov 29 07:40:15 2024 +0000 fix: limit the plugin output size Signed-off-by: Junjie Gao <junjiegao@microsoft.com> Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
ecd22a2
to
7a78f52
Compare
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.
LGTM
Fix: - set the plugin output limit for STDOUT and STDERR to be 10MiB Test: - when the plugin output size exceeds 64MiB, the output pipe breaks, and the plugin process outputs an error to STDERR Spec changes: notaryproject/specifications#320 Resolves notaryproject#187 Signed-off-by: Junjie Gao <junjiegao@microsoft.com> Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Fix:
Test:
Spec changes: notaryproject/specifications#320
Resolves #187