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

Malformed bootstrap.creds string prevents Artifactory from starting #1891

Open
keyboardsmash opened this issue Jun 10, 2024 · 4 comments
Open

Comments

@keyboardsmash
Copy link

BUG REPORT

Version of Helm and Kubernetes:

  • helm version.BuildInfo{Version:"v3.14.2", GitCommit:"c309b6f0ff63856811846ce18f3bdc93d2b4d54b", GitTreeState:"clean", GoVersion:"go1.21.7"}
  • Kubernetes Version: v1.27.13+fd36fb9

Which chart:

  • Artifactory 107.71.11
  • Artifactory 107.84.10
  • Most likely all previous versions

Which product license (Enterprise/Pro/oss):

  • Enterprise
  • Pro

JFrog support reference (if already raised with support team):

  • None

What happened:
While configuring Artifactory on our Openshift cluster using sealed secrets, I accidentally wrote the bootstrap.creds string as
password instead of [email protected]=password. This resulted in Artifactory not being able to start, micro services failing en masse:

  • jfco, jfevt, jfmd, jfint (only present in 107.71.11), jfrt could not join or access the jfrou micro service.
  • Jfrou could not connect to jfac due to it being unable to start caused by the malformed string. Jfrou output:
    [jfrou] Cluster join: Access Service ping failed, will retry. Error: cluster join: error from service registry on ping: url=http://localhost:8040/access/api/v1/system/ping, status code=404, body(100 first chars)='<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/c'

Not being overly familiar with the inner workings of the micro services, we first thought there was a problem with the join key since most services said they could not join. Finally we found the problem in the access service:

Log short:

Error creating bean with name 'accessServerBootstrapImpl': Invocation of init method failed; nested exception is
 java.lang.IllegalArgumentException: Illegal credentials file - each line is expected to be in the format: user=pass

jfac-log.log

What you expected to happen:
That the system should come up regardless of the string being malformed. Either by accepting a single value as password and defaulting the rest of the string to [email protected]= or throwing a visual warning on the login page stating that there is no valid local admin account. Regardless, Artifactory should still come up and allow users local or using other authentication providers to login and continue using the service. It should not be a showstopper in case someone later fails to rotate the credentials and updating or redeploying Artifactory. Doing so currently will at best leave Artifactory in a degraded state (multiple nodes) or worst case; totally down (single node).

How to reproduce it (as minimally and precisely as possible):
Set a malformed string as bootstrap.creds

Anything else we need to know:
Pranav Hegde suggested we create an issue.

@oumkale
Copy link
Member

oumkale commented Jun 11, 2024

Hi @keyboardsmash,

Thank you for creating issue, but this is expected. Better way is to update password here

@lunderhage
Copy link

Hello @oumkale,

I don't agree. It took lots of effort to figure out that the problem with the join key was due to this. Please add a format check in the chart.

@keyboardsmash
Copy link
Author

hello @oumkale from a security standpoint its not that great to store a password in a helm chart in a high sec environment, this is the reason we use sealed secrets.

@reespozzi
Copy link

Completely agree, we only just got round this weird error by thankfully finding this article

But as @lunderhage says, there are many issues open and related to join key errors in the logs, when in fact they are caused usually by a problem during bootstrapping, suggesting this as expected behaviour makes little sense and doesn't seem like a good idea at all.
+1 for the suggestion of this at the very least

the system should come up regardless of the string being malformed. Either by accepting a single value as password and defaulting the rest of the string to [email protected]= or throwing a visual warning on the login page stating that there is no valid local admin account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants