-
Notifications
You must be signed in to change notification settings - Fork 64
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
docs: add ratify v2 architecture design proposal #1962
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
975e88e
to
c625568
Compare
maintainers, please review @FeynmanZhou, @akashsinghal , @susanshi |
/cc @DahuK for a review if you are interested |
Thanks Feynman! As an adopter, we are very looking forward to the evolution of v2, especially Image Verification as an important feature of containerd 2.0. If ratify service can be adapted to the Image Transfer service, we will actively embrace such an evolution, and try to integrate this to provide a more flexible way of checking signatures and get rid of the dependency on k8s webhook. And I understand the importance of a loosely coupled and extensible architecture for the project, and will actively cooperate with the integration and transformation work under the v2 framework. I can't give more suggestions on the implementation details, but we have received some feedback from the users. Here is my two cents: I know that image signing and verification itself is a complex scenario, which depends on the integration of multiple tools and services, and Ratify provides a variety of built-in CRD (store, keymanagementproviders, verifier), which makes it difficult for beginners to troubleshoot and find some common configuration errors, and when the artifacts has multiple signatures, it is also difficult to locate the specific verification report detail in addition to querying the ratify pod logs when encountering signature verification failures. In the V2 version, is there any consideration for simplifying the cost of configuration? cause some users may only need to the basic verification of the image signature to complete the compliance requirements, it would be better if there were a simple minimal configuration set or best practice guidelines, is it possible for user to do all of the configurations in the v2 config.json with an easy way? |
thanks for the feedback and suggestion! Ratify v2 is designed to be more extensible to new scenarios including the containerD. For the configuration refactoring, we have another PR referring to it. We also heard similar feedback on the setting up the configuration. Therefore, it's also in v2 scope to make it more straighforward to configure Ratify. And if you have any ideas on better user experience, feel free to leave comments. As for troubleshooting, we also kept improving the user experience since v1, and will continue in v2. One possible improvement is to refactor the Policy Provider to make it return a more clear report when errors happen. |
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.
PR looks great, having the diagram is very helpful Binbin, we should include them on the Ratify website! Left some questions.
1. Ratify only supports CLI and K8s scenarios. But actually current Ratify is only well implemented/designed for K8s scenarios. There are some feature gaps between CLI and K8s implementations. To support more scenarios, like containerd plugins or docker plugins, or just a library for downstream services, we need to make Ratify to be more extensible. | ||
2. Ratify was designed to validate security metadata of any given artifacts. But right now Ratify is mainly focusing on the K8s scenarios with images being verified. | ||
3. The plugin framework was designed to separate built-in and external plugins. Built-in plugins run in the same process of Ratify while each external plugin would be executed in a new subprocess. Therefore, external plugins cannot share the in-momory cache with the main process, which may result to performance degradation, data inconsistency, race condition and security vulnerabilties. | ||
4. The built-in plugins and authentication for different cloud providers are part of the main Ratify repository, which introduces a significant number of dependencies. This issue will become even more pronounced as additional cloud provider and new plugin implementation are added in the future. |
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.
Hi @binbin-li , after the refactoring, will auth providers be in Ratify core, have we called this out already?
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.
Ratify core will just define the Store interface without its implementation. The auth provider will belong to oras implementation repo.
# Command to run the executable | ||
CMD ["./main"] | ||
``` | ||
In the above example, the only dependency of Ratify repo is the Ratify core library. And users could select appropriate interface implementations based on need in the Dockerfile. |
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.
just clarify, we will have docker files for each entry point ( cli , k8s)?
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.
we Ratify have a docker image with the default verifiers?
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.
Good question!
- For different repos, like ratify-cli, ratify, they will different scripts and Dockerfile for each.
- For ratify repo, users might have different scenarios to integrate different plugins. I plan to have one Dockerfile along with a script so that users can just pass in different plugin paths to it instead of writing different Dockerfiles.
- And ratify repo should also ship one or a few images with default verifiers that cover common user scenarios.
7. **Customized App**: The customized app can be any application behaves in a similar was as the middleware. It will be responsible for handling its own input and invoking the core logic to validate the security metadata of the artifacts and rendering its own output. | ||
|
||
### Deisgn Details | ||
Below is a more detailed design of the proposed architecture of Ratify v2. Note that text in red indicates a repository under `ratify-project` organization. |
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.
the v2 diagram doesn't show the cache component. Will all plugins share the oras cache in v2?
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.
yes, the new diagram focuses on the core and plugins. Oras cache will reside in the oras implementation. And since all plugins will run in the host process as library, the oras cache is also in the host process which can be safely shared by verifiers. I'll add it to the doc as well.
Signed-off-by: Binbin Li <[email protected]>
Signed-off-by: Binbin Li <[email protected]>
### Limitations | ||
1. Ratify only supports CLI and K8s scenarios. But actually current Ratify is only well implemented/designed for K8s scenarios. There are some feature gaps between CLI and K8s implementations. To support more scenarios, like containerd plugins or docker plugins, or just a library for downstream services, we need to make Ratify to be more extensible. | ||
2. Ratify was designed to validate security metadata of any given artifacts. But right now Ratify is mainly focusing on the K8s scenarios with images being verified. | ||
3. The plugin framework was designed to separate built-in and external plugins. Built-in plugins run in the same process of Ratify while each external plugin would be executed in a new subprocess. Therefore, external plugins cannot share the in-momory cache with the main process, which may result to performance degradation, data inconsistency, race condition and security vulnerabilties. |
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.
3. The plugin framework was designed to separate built-in and external plugins. Built-in plugins run in the same process of Ratify while each external plugin would be executed in a new subprocess. Therefore, external plugins cannot share the in-momory cache with the main process, which may result to performance degradation, data inconsistency, race condition and security vulnerabilties. | |
3. The plugin framework was designed to separate built-in and external plugins. Built-in plugins run in the same process of Ratify while each external plugin would be executed in a new subprocess. Therefore, external plugins cannot share the in-memory cache with the main process, which may result to performance degradation, data inconsistency, race condition and security vulnerabilities. |
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.
Nit: you may scan and check typos in this design proposal
Description
What this PR does / why we need it:
This PR adds more details and addressed feedback from the previous discussion on the Ratify architecture design v2 proposal: #1942
We already have another PR discussing the v2 scope, this PR just focuses on the system architecture refactoring.
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #1942
Type of change
Please delete options that are not relevant.
main
branch)How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Checklist:
Post Merge Requirements
Helm Chart Change