Skip to content
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

Zarf CLI should easily show Git and Registry credentials #1098

Closed
runyontr opened this issue Dec 7, 2022 · 2 comments · Fixed by #1220
Closed

Zarf CLI should easily show Git and Registry credentials #1098

runyontr opened this issue Dec 7, 2022 · 2 comments · Fixed by #1220
Assignees
Labels
good first issue 🥇 Good for newcomers
Milestone

Comments

@runyontr
Copy link
Contributor

runyontr commented Dec 7, 2022

When looking to debug a deployment after doing a zarf init, if I didn't save the login credentials that get spit out durin gthe init phase, I can't find a clean way to discover the credentials. This is how I've been finding it:

k get secrets -n zarf zarf-state -o jsonpath="{ .data.state }" | base64 --decode | jq -r .

it would be nice if there were a zarf cli command to extract either the full secret, or at least the credentials that were returned as part of the init phase

@RothAndrew RothAndrew moved this to New Requests in Zarf Project Board Dec 7, 2022
@jeff-mccoy jeff-mccoy added the good first issue 🥇 Good for newcomers label Jan 4, 2023
@jeff-mccoy jeff-mccoy added this to the v0.24.0 milestone Jan 4, 2023
@jtaylor-afs
Copy link

I am still on an older Zarf, but from what I can tell, the stored secrets did not have all of the credentials. I think notably, either the git or registry read/write user were not published as a secret.

Just wanted to ask the question to see if this mechanism would encompass all creds.

@Racer159
Copy link
Contributor

@jtaylor-afs yep, in newer versions of Zarf all credentials are stored in the zarf state. Here is an example of the output from the commend @runyontr posted from a local dev run (keys have been rotated):

{
  "zarfAppliance": false,
  "distro": "k3d",
  "architecture": "amd64",
  "storageClass": "local-path",
  "agentTLS": {
    "ca": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURXakNDQWtLZ0F3SUJBZ0lSQU1nOFBhVmJscTMyOEhYSWdHMENFaVF3RFFZSktvWklodmNOQVFFTEJRQXcKTnpFWE1CVUdBMVVFQ2hNT1dtRnlaaUJEYjIxdGRXNXBkSGt4SERBYUJnTlZ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3BNY01sVllmR1Z3T29XV3RVYWpKbWlxMXNOYlhVSWRPdFdPSmZuN0xBPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo="
  },
  "gitServer": {
    "pushUsername": "zarf-git-user",
    "pushPassword": "IZuB4QGf6J8Ku2z6N1s8X2VI",
    "pullUsername": "zarf-git-read-user",
    "pullPassword": "ksCvpGrQqmHTh8EMXCve~QfS",
    "address": "http://zarf-gitea-http.zarf.svc.cluster.local:3000",
    "internalServer": true
  },
  "registryInfo": {
    "pushUsername": "zarf-push",
    "pushPassword": "cIjeA8jAAFofS4GLLM!p9CtG",
    "pullUsername": "zarf-pull",
    "pullPassword": "kNxKEXhC4QZnX3HPyWaiRDet",
    "address": "http://127.0.0.1:31999",
    "nodePort": 31999,
    "internalRegistry": true,
    "secret": "M230gy2lwgjEBqgBRpBebsxi6ebLc-peudQibA!T4teGyJx0"
  },
  "loggingSecret": "kORycrZT4NOoD2aQz13J!VK-"
}

@andrewg-xyz andrewg-xyz self-assigned this Jan 17, 2023
@andrewg-xyz andrewg-xyz linked a pull request Jan 19, 2023 that will close this issue
5 tasks
jeff-mccoy pushed a commit that referenced this issue Jan 27, 2023
## Description

Add command to easily get credentials printed during zarf init (i.e.
git, logging, registry)

## Related Issue

Fixes #1098 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
@github-project-automation github-project-automation bot moved this from New Requests to Done in Zarf Project Board Jan 27, 2023
Noxsios pushed a commit that referenced this issue Mar 8, 2023
## Description

Add command to easily get credentials printed during zarf init (i.e.
git, logging, registry)

## Related Issue

Fixes #1098 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue 🥇 Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants