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

[Bug]: step ca provisioner update fails for JWK provisioner if --create is specified #1059

Open
maxhoesel opened this issue Oct 31, 2023 · 0 comments
Assignees
Labels
bug needs triage Waiting for discussion / prioritization by team
Milestone

Comments

@maxhoesel
Copy link

Steps to Reproduce

I am trying to apply the first example from the step ca provisioner update docs in a minimal test environment:

Update a JWK provisioner with newly generated keys and a template for x509 certificates:
step ca provisioner update cicd --create --x509-template ./templates/example.tpl

  1. Start a step-ca container:
  $ docker run --rm -it --name step-ca-test \
  -p 9000:9000 \
  -e "DOCKER_STEPCA_INIT_NAME=Test" \
  -e "DOCKER_STEPCA_INIT_DNS_NAMES=localhost,$(hostname -f)" \
  smallstep/step-ca
  1. In a second terminal, bootstrap step-cli (after backing up any previous configuration) and create a new provisioner:
  $ step-cli ca bootstrap --ca-url https://localhost:9000 --fingerprint <ca-fp> --force
  $ docker exec -it step-ca-test bash -c "echo hello > /tmp/password"
  $ docker exec -it step-ca-test step ca provisioner add test --type JWK --create --password-file /tmp/password
  ✔ CA Configuration: /home/step/config/ca.json

  Success! Your `step-ca` config has been updated. To pick up the new configuration SIGHUP (kill -1 <pid>) or restart the step-ca process.
  $ docker exec -it step-ca-test pgrep step-ca
  1
  $ docker exec -it step-ca-test kill -1 1
  1. Attempt to recreate the provisioners keys:
  docker exec -it step-ca-test step ca provisioner update test --create --password-file /tmp/password

Your Environment

OS: Arch

Step CLI:

$ step cli version
Smallstep CLI/0.25.0 (linux/amd64)
Release Date: 2023-09-27

Step CA: 0.25.0

Expected Behavior

The provisioner gets updated with a newly generated key.

Actual Behavior

Updating the JWK provisioner fails with this error message:

  docker exec -it step-ca-test step ca provisioner update test --create --password-file /tmp/password
  ✔ CA Configuration: /home/step/config/ca.json

  error updating provisioner: error updating provisioner 'test' in authority cache: provisioner test:xlByq2UljmiUvKkhL_yg0dOd8ueVBWhoMJBoSVTAifc not found

Additional Context

I tried looking for information about the authority cache mentioned in the error message, but couldn't find anything in the issues/docs.

I also tried rekeying a provisioner on a long-running step-ca instance but got the same result (though that instance is still on 0.23.2, so it's a little behind).

I'm happy to provide additional details if needed.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@maxhoesel maxhoesel added bug needs triage Waiting for discussion / prioritization by team labels Oct 31, 2023
@dopey dopey self-assigned this Nov 7, 2023
@hslatman hslatman added this to the v0.25.1 milestone Nov 21, 2023
@hslatman hslatman modified the milestones: v0.25.1, v0.25.2 Nov 29, 2023
@hslatman hslatman modified the milestones: v0.25.2, v0.25.3 Feb 20, 2024
@hslatman hslatman modified the milestones: v0.26.0, v0.26.1 Mar 29, 2024
@hslatman hslatman modified the milestones: v0.26.1, v0.26.2 Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

3 participants