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

Github App Private Key printed on auth failure #12309

Closed
2 of 3 tasks
james-callahan opened this issue Feb 7, 2023 · 1 comment · Fixed by #12320
Closed
2 of 3 tasks

Github App Private Key printed on auth failure #12309

james-callahan opened this issue Feb 7, 2023 · 1 comment · Fixed by #12320
Labels
bug Something isn't working

Comments

@james-callahan
Copy link
Contributor

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

When trying to create an application, I saw in both a popup in the frontend UI, and in the logs from the server:

time="2023-02-07T03:07:17Z" level=info msg="finished unary call with code InvalidArgument" error="rpc error: code = InvalidArgument desc = application spec for argocd-admin is invalid: InvalidSpecError: repository not accessible: repositories not accessible: &Repository{Repo:https://github.com/james-callahan/gitops,Username:,Password:,SSHPrivateKey:,ConnectionState:ConnectionState{Status:,Message:,ModifiedAt:<nil>,},InsecureIgnoreHostKey:false,Insecure:false,EnableLFS:false,TLSClientCertData:,TLSClientCertKey:,Type:,Name:,InheritedCreds:true,EnableOCI:false,GithubAppPrivateKey:-----BEGIN RSA PRIVATE KEY-----\nTHEACTUALPRIVATEKEY\n-----END RSA PRIVATE KEY-----\n,GithubAppId:12345,GithubAppInstallationId:12345,GitHubAppEnterpriseBaseURL:,Proxy:,Project:,GCPServiceAccountKey:,ForceHttpBasicAuth:false,}" grpc.code=InvalidArgument grpc.method=Update grpc.service=application.ApplicationService grpc.start_time="2023-02-07T03:07:17Z" grpc.time_ms=38.558 span.kind=server system=grpc

where THEACTUALPRIVATEKEY is the actual private key for my github app.

Expected behavior

secret fields shouldn't be printed as part of error messages

Version

argocd-server: v2.6.0+acc554f
@james-callahan james-callahan added the bug Something isn't working label Feb 7, 2023
crenshaw-dev added a commit to crenshaw-dev/argo-cd that referenced this issue Feb 7, 2023
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
crenshaw-dev added a commit that referenced this issue Feb 8, 2023
* fix: sanitize repo creds in error messages (#12309)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* simplify

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comment

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* include error message

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
crenshaw-dev added a commit that referenced this issue Feb 8, 2023
* fix: sanitize repo creds in error messages (#12309)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* simplify

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comment

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* include error message

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator

Fixed with release 2.6.1. Thanks for catching this!

For future security issues, please start by reporting according to SECURITY.md. No big deal in this case, since it was an easy patch. But for more complicated fixes, reporting via private channels makes it a lot easier for the Argo team to develop/validate the patch(es) so we can roll them out in a responsible way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants