Commit Graph

10 Commits (3b55f7418e2ad8643bcca0f3504b6ca025fc3cee)

Author SHA1 Message Date
Dustin 3b55f7418e user: Add sshca user login command
The `sshca user login` command will eventually provide the command-line
interface for obtaining user SSH certificates.  It initiates the OAuth2
login process, retreiving an OpenID Connect Identity Token from the
OpenID Server.  This token will be submitted to the SSHCA server to
authorize a request to sign a certificate.  For now, though, the token
is printed to standard output, e.g. to be used in a `curl` request.
2023-11-21 20:13:17 -06:00
Dustin c26d67a25b main: Factor out get_sshca_server_url function
The `get_sshca_server_url` function encapsulates the logic of
identifying the URL of the SSHCA server.  For now, it only considers the
`SSHCA_SERVER` environment variable, but eventually, it will also
support other configuration methods like a configuration file.  Moving
this to a separate function will allow other areas of the code to share
the same logic.
2023-11-20 18:23:35 -06:00
Dustin 1d0e558163 Add SSHCA_CLI_DEBUG_TEST_MACHINE_ID env var
When running a debug build, the `sshca host sign` command will now check
the `SSHCA_CLI_DEBUG_TEST_MACHINE_ID` environment variable for the value
to use as the machine ID.  This is useful during development and
testing, where the real machine ID is inaccessible or otherwise
unavailable.

The `SSHCA_CLI_DEBUG_TEST_MACHINE_ID` environment variable is *NOT* used
at all in release builds.
2023-11-16 20:12:38 -06:00
Dustin 041788e818 ci: Import ci pipeline from original repo
dustin/sshca-cli/pipeline/head This commit looks good Details
When this repository was split from the original *dustin/sshca*
repository, the CI pipeline was not imported.  It wouldn't have mattered
if it had been, since it wouldn't have worked, anyway, given the path
changes.
2023-11-13 20:32:03 -06:00
Dustin 8d146cdb62 meta: Add .editorconfig 2023-11-13 19:42:53 -06:00
Dustin 630aa4dcee cli: Bump to v0.1.1 2023-11-12 18:23:18 -06:00
Dustin d8126a6dcb cli: Trim trailing null from RPi serial
The `/sys/firmware/devicetree/base/serial-number` pseudo-file has a
trailing null byte, which causes `Uuid::parse_srr` to fail.  This makes
it impossible to authenticate Raspberry Pi devices to the server.  The
trailing byte needs to be removed before attempting to parse the serial
number into a UUID to avoid this problem.
2023-11-12 10:44:48 -06:00
Dustin 5ab5c3e98d rpm: Add systemd service/target/timer units
The *ssh-host-cert-sign@.service* unit does what it says on the tin:
requests a signed host certificate from an SSHCA server.  It is a
template unit, whose instances correspond to SSH key types (RSA, ECDSA,
and Ed25519).  The *ssh-host-certs.target* unit depends on the three
instances of the template unit, so they can all be activated together.
This target is only activated on the first boot of the system, to
initially request the certificates.

The *ssh-host-certs-renew.timer* unit periodically renews the SSH hosts
certificates.  Its corresponding target unit depends on the three
instances of *ssh-host-cert-sign@.service*, so each certificate will be
renewed independently.
2023-11-06 18:34:20 -06:00
Dustin f6abf699e8 rpm: Add sshca-cli RPM spec
The *sshca-cli* RPM package can be used to install the SSHCA CLI client
on Fedora (and other RPM-based distributions).  The `.spec` file was
originally generated using [rust2rpm], but several manual modifications
were required.  Notably, the script does not generate `BuildRequres`
tags when run in "vendored" mode (i.e. third-party crate sources are
included in the source RPM package instead of packaged as separate
RPMS).
2023-11-06 18:11:19 -06:00
Dustin b203bbd87c cli: Begin CLI client
The CLI tool will be the primary method for interacting with the SSH CA
service.  For now, it supports a single operation: `sshca-cli host
sign`, which requests a certificate to be signed by the CA service.`
2023-11-05 10:31:58 -06:00