Bug 280405 - security/step-certificates: 'service step-ca configure' fails
Summary: security/step-certificates: 'service step-ca configure' fails
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-22 11:54 UTC by Jason Mann
Modified: 2024-07-24 18:41 UTC (History)
1 user (show)

See Also:
mw: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mann 2024-07-22 11:54:00 UTC
I installed the step-certificates and step-cli packages on a FreeBSD-14.1-RELEASE-amd64 system.

Following the installation, I performed the following actions:

- Added 'step_ca_enable="YES"' to /etc/rc.conf.local
- Ran 'service step-ca configure'

  root@filer ~]# service step-ca configure
  No configured Step CA found.
  Creating new one....
  open /usr/local/etc/step/ca/contexts.json failed: not a directory
  Step CA Password file for auto-start not found
  Creating it....
  Please enter the Step CA Password:

After entering a password, I could see that /usr/local/etc/step/password.txt had been created, as well as a /usr/local/etc/step/ca file.

The service then could not be started:

  [root@filer ~]# service step-ca start
  Starting step_ca.
  step_ca is not running.

Judging by the "open /usr/local/etc/step/ca/contexts.json failed: not a directory" error, that 'ca' file should instead be a directory.

I examined the /usr/local/etc/rc.d/step-ca RC script and found the following on line 93:

  install -m 600 -o ${step_ca_user} -g ${step_ca_group} /dev/null ${step_ca_steppath}

It appears this line is missing a '-d' argument to create a directory and instead creates a file.

I added the '-d' argument to the script on my system, deleted the /usr/local/etc/step/ca and password.txt files, then re-ran 'service step-ca configure' and got what looks like the correct outcome:

  [root@filer /usr/local/etc/step]# service step-ca configure
  No configured Step CA found.
  Creating new one....
  install: /dev/null exists but is not a directory
  ✔ Deployment Type: Standalone
  What would you like to name your new PKI?
  ✔ (e.g. Smallstep): [redacted]
  What DNS names or IP addresses will clients use to reach your CA?
  ✔ (e.g. ca.example.com[,10.1.2.3,etc.]): localhost
  What IP and port will your new CA bind to? (:443 will bind to 0.0.0.0:443)
  ✔ (e.g. :443 or 127.0.0.1:443): 127.0.0.1:8443
  What would you like to name the CA's first provisioner?
  ✔ (e.g. you@smallstep.com): [redacted]
  Choose a password for your CA keys and first provisioner.
  ✔ [leave empty and we'll generate one]: 
  ✔ Password: [redacted]
Comment 1 Markus Wipp 2024-07-23 18:32:43 UTC
Thanks for the bug report.
I will fix this in the package for the next version
Comment 2 Markus Wipp 2024-07-23 19:59:43 UTC
This should be resolved once bug #280420 has been committed.
Comment 3 Markus Wipp 2024-07-24 18:41:06 UTC
should be resolved now in version 0.27.2