-
Notifications
You must be signed in to change notification settings - Fork 6
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
Read Git credentials from Vault #24
Comments
Given the following configuration: Configs in GitLab: A target on GitHub and BitBucket T({
name: "app",
url: "https://github.com/ns/repo",
up: "./run"
});
T({
name: "app",
url: "https://bitbucket.org/ns/repo",
up: "./run"
}); There are three sets of credentials to acquire. They may have the following names in Vault:
To close this issue, there needs to be some logic that maps from the above configuration to these Vault secrets. |
Why not have some global config in the main file which can be used to setup what these values could be. For example:
I might have made a mistake in the way I did it, I didn't check it syntax issues, but you get the idea. I think it might also make sense to make use of Vault's SSH storage, but be able to use that to also automate it using SSH and if it was done via pico, it could make it extremely simple. |
Yes I was thinking something like this. Instead of changing the |
T({
name: "app",
url: "https://github.com/ns/repo",
auth: "github_01",
up: "./run"
});
T({
name: "app",
url: "https://bitbucket.org/ns/repo",
auth: "bb_01",
up: "./run"
});
A({
name: "github_01",
source: "vault",
path: "pico_auth",
method: "http",
user_key: "GITHUB_USERNAME",
pass_key: "GITHUB_PASSWORD"
}); Would read from |
I have a feeling I will regret the single-letter function names in configuration files... |
haha probably, but I do like the concept. It could work out nicely. |
It suddenly got a whole lot more complex: Currently, all the targets are bundled together into a single gitwatch instance with a single auth method (either nil or ssh). This means different auth methods for different targets won't work simply with the current setup. I think it will be easier to update gitwatch to support per-repo settings such as auth instead of messing around with clustering targets with shared auth, firing multiple gitwatch instances and multiplexing their channels. |
Adds an `A` configuration primitive that declares a set of options for getting Git credentials for targets.
* started work on per-target auth secrets for #24 Adds an `A` configuration primitive that declares a set of options for getting Git credentials for targets. * implement per-target authentication
Currently, there are two ways to securely use Git to pull config repos and target repos:
SSH is really awkward to automate declaratively, so I generally avoid it. Basic auth works well as GitHub/Lab both provide machine tokens for automated access.
The issue is, you need to pass these tokens in as environment variables. It also means propagating them through to the target config which makes multiple tokens awkward.
So, pico should instead just load all credentials from Vault.
And drop SSH support, it's not worth maintaining for the aforementioned reason.
General architecture:
Now:
Future:
This also means that there needs to be some form of naming convention for the secrets in Vault so they map to repositories. Maybe based on regex?
The text was updated successfully, but these errors were encountered: