You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm guessing that under some circumstances the call the /healthz is returning a value with spaces in it, e.g. not ready.
So for example if you ran:
status="not ready"
[ $status!="ok" ]
This will reproduce the error:
-bash: [: too many arguments
Wrapping in double-quotes, e.g. [ "$status" != "ok" ] will fix this specific example.
It's not clear to me whether there isn't a latent vulnerability associated with taking arbitrary output from the UAA /healthz check and passing to the test in this manner, but I wasn't able to find a way to exploit it.
In any case I think there are at least 3 issues:
That this error didn't result in the script actually failing. Perhaps consider adding set -e or similar so that errors actually cause failure instead of failing silently.
Quoting or otherwise treating correctly the value of $status would allow this check to proceed as designed.
The -k in the curl command skips TLS verification. Given the trouble we have to go to in order to pass CA certs to begin with, there doesn't seem any obvious good reason for doing this.
The text was updated successfully, but these errors were encountered:
What version of the credhub server you are using?
2.1.2
If you were attempting to accomplish a task, what was it you were attempting to do?
Deploy via
bosh
withuaa
What did you expect to happen?
Not get errors in
stderr
What was the actual behavior?
/var/vcap/sys/log/credhub/credhub.stderr.log
shows:Please confirm where necessary:
Detail
/var/vcap/jobs/credhub/bin/ctl
contains this code:I'm guessing that under some circumstances the call the
/healthz
is returning a value with spaces in it, e.g.not ready
.So for example if you ran:
This will reproduce the error:
Wrapping in double-quotes, e.g.
[ "$status" != "ok" ]
will fix this specific example.It's not clear to me whether there isn't a latent vulnerability associated with taking arbitrary output from the UAA
/healthz
check and passing to the test in this manner, but I wasn't able to find a way to exploit it.In any case I think there are at least 3 issues:
set -e
or similar so that errors actually cause failure instead of failing silently.$status
would allow this check to proceed as designed.-k
in thecurl
command skips TLS verification. Given the trouble we have to go to in order to pass CA certs to begin with, there doesn't seem any obvious good reason for doing this.The text was updated successfully, but these errors were encountered: