-
Notifications
You must be signed in to change notification settings - Fork 4
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
External Secret Store Integration e.g. AWS Secrets Manager/ECS, Gitlab CI/CD #174
Comments
For AWS Secrets Manager, an example of non-plugin push integration would be scripting Also see the difference between parameter store and secrets manager here: https://www.1strategy.com/blog/2019/02/28/aws-parameter-store-vs-aws-secrets-manager/ Any work on AWS should be applied to a demo experiment involving:
|
To avoid the cost of writing push-based plugins, one can provide recipes for scripts that automate the usage of Writing plugins that use PK's API and AWS's (or any external) API is lot more difficult compared to just scripting usage of the CLI commands in a shell context. API integrations are likely to be more performant and more flexible, but they are likely to be a lot more expensive to develop, and more complex to develop. API integrations are code that has to be executed in a particular lower-level runtime introducing plugin integration complexity and potential security vulnerabilities, it could work when WASM becomes more available and robust though. It's possible to make these integrations a little easier by providing ways for PK to execute scripts when we have "automated" policies for secrets management workflows. This would mean users could program a secret management workflow into PK to have it run automatically on event triggers. Then PK would just end up calling external programs as dictated by the user. That might be the most cost-effective solution atm. |
Note a pull integration that exists in Gitlab CI/CD using hashicorp vault: https://docs.gitlab.com/ee/ci/yaml/index.html#secretsvault. This is provided by Gitlab CI/CD we could extend gitlab with our own service later. |
Plugin Design (Framework vs Library Control Flow)Regarding plugin design, there's few ways we can design it:
In the first case, PK is the framework that calls into the plugins. In the second case, PK is the library that the plugin calls into.
You can see that the first case is more limited (at least for the plugin), as the framework dictates the flow of control. This is actually called inversion of control. And it ultimately depends on well abstracted design with many extension points and hook points that plugins can slot into. The plugins "fill in the blanks" with custom functionality. In the second case, the plugin is the framework, and it can use PK like a library. In this sense, one may not really call it a plugin, since one could use PK as an embedded library. There's also licensing issues here, because the plugin depends on PK, the plugin is now GPL. In the first case, that does not occur. The usage of wasm gives some sort of middle ground. The plugin still needs to be hooked in somewhere (predefined by the framework extension points), but it's not limited to only STDIN data and STDOUT, it can perform side-effects against PK. It makes sense that if we wanted to "market" plugins, they need to be easy to develop, which means they have to be simple architecture, and not be infected by the GPL license, but also have some flexibility so it's not just functional input to output.
|
Specification
External secret stores are stateful systems that often store secrets that are intended for to be used DevOps work. Integrating into external secret stores prevents Secret Sprawl that leads to Configuration Divergence. Unifying secret configuration means there's one place to look at, edit and understand the provenance of secrets.
For example to use AWS ECS and to put in secret keys in during deployment we use environment variables. However sometimes these keys should not be exposed to the infrastructure team. So AWS allows one to get secret variables as paths to the AWS SSM. So if a user were to be using AWS ECS/SSM then where does polykey fit into that picture?
Consider the usecase of using Gitlab CI/CD or GitHub Actions. These systems also require secrets to be utilised to perform operations. Here's one example of all the environment variable configuration necessary for running CI/CD pipeline for our opensource code:
The problem of integrating External Secret Stores is a matter of Push vs Pull configuration. Note that has a relationship with push vs pull messaging systems, but the factors that are of concern are different in configuration management.
To summarise:
With respect to external secret stores, one can integrate them in push or pull style. Which style depends on the user's preference and situational constraints.
With respect to PK, a push integration would mean these possibilities:
pk
withgh
CLI for GitHub Actionsgh
- https://cli.github.com/manual/gh_secretglab
- Support creating project variables profclems/glab#515A pull integration would mean these possibilities:
Both situations can have plugins, but that is most expensive option as each target system will require development of a plugin. Not all systems can support plugins, or it can be difficult to know how to develop one. AWS ECS/SSM may require AWS lambda... etc.
The most realisable situation is to use higher level orchestration for push-integration, or using PK client for pull-integration. This can be demonstrated in our wikis #2.
Additional context
Tasks
gh
command linepk
CLIThe text was updated successfully, but these errors were encountered: