Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions command/ca/provisioner/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ACME

**step ca provisioner add** <name> **--type**=ACME
[**--force-cn**] [**--require-eab**] [**--challenge**=<challenge>]
[**--acme-proxy-url**=<url>] [**--acme-disable-proxy**] [**--acme-dns-resolver**=<host:port>]
[**--attestation-format**=<format>] [**--attestation-roots**=<file>]
[**--admin-cert**=<file>] [**--admin-key**=<file>]
[**--admin-subject**=<subject>] [**--admin-provisioner**=<name>] [**--admin-password-file**=<file>]
Expand Down Expand Up @@ -145,12 +146,15 @@ SCEP
// Nebula provisioner flags
nebulaRootFlag,

// ACME provisioner flags
requireEABFlag, // ACME
forceCNFlag, // ACME + SCEP
challengeFlag, // ACME + SCEP
attestationFormatFlag, // ACME
attestationRootsFlag, // ACME
// ACME provisioner flags
requireEABFlag, // ACME
forceCNFlag, // ACME + SCEP
challengeFlag, // ACME + SCEP
acmeProxyURLFlag, // ACME networking
acmeDisableProxyFlag, // ACME networking
acmeDNSResolverFlag, // ACME networking
attestationFormatFlag, // ACME
attestationRootsFlag, // ACME

// SCEP provisioner flags
scepCapabilitiesFlag,
Expand Down Expand Up @@ -335,19 +339,26 @@ func addAction(ctx *cli.Context) (err error) {
return errs.InvalidFlagValue(ctx, "type", ctx.String("type"), "JWK, ACME, OIDC, SSHPOP, K8SSA, NEBULA, SCEP, AWS, GCP, AZURE")
}

p := &linkedca.Provisioner{
Name: args.Get(0),
Type: linkedca.Provisioner_Type(typ),
}

// Validate challenge flag on scep and acme
if err := validateChallengeFlag(ctx, p.Type); err != nil {
return err
}
// Validate attestation format flag on acme
if err := validateAttestationFormatFlag(ctx, p.Type); err != nil {
return err
}
p := &linkedca.Provisioner{
Name: args.Get(0),
Type: linkedca.Provisioner_Type(typ),
}

// Validate challenge flag on scep and acme
if err := validateChallengeFlag(ctx, p.Type); err != nil {
return err
}
// Validate attestation format flag on acme
if err := validateAttestationFormatFlag(ctx, p.Type); err != nil {
return err
}

// Informative note: networking flags for ACME require server + linkedca support
if p.Type == linkedca.Provisioner_ACME {
if ctx.IsSet("acme-proxy-url") || ctx.IsSet("acme-disable-proxy") || ctx.IsSet("acme-dns-resolver") {
ui.PrintSelected("Notice", "ACME networking flags provided (proxy/DNS). Server support depends on linkedca fields.\nIf your CA version does not yet include these fields, the settings will be ignored.")
}
}

// Read x509 template if passed
p.X509Template = &linkedca.Template{}
Expand Down
17 changes: 17 additions & 0 deletions command/ca/provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,23 @@ Use the flag multiple times to remove multiple challenges.`,
If this flag is set to false, then disable EAB.`,
}

// ACME networking flags (provider-level)
acmeProxyURLFlag = cli.StringFlag{
Name: "acme-proxy-url",
Usage: `Explicit proxy <url> to use for outbound ACME validation requests (e.g. http-01 fetches).
If not set, system or environment proxy configuration will be used unless '--acme-disable-proxy' is set.`,
}

acmeDisableProxyFlag = cli.BoolFlag{
Name: "acme-disable-proxy",
Usage: `Disable any HTTP(S) proxy for outbound ACME validation requests, ignoring environment variables.`,
}

acmeDNSResolverFlag = cli.StringFlag{
Name: "acme-dns-resolver",
Usage: `Force a DNS resolver <host:port> (e.g. 8.8.8.8:53) for DNS queries performed during ACME challenges.`,
}

attestationFormatFlag = cli.StringSliceFlag{
Name: "attestation-format",
Usage: `Enable an ACME attestation statement <format> in the provisioner. Use the flag
Expand Down
20 changes: 12 additions & 8 deletions command/ca/provisioner/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ACME

**step ca provisioner update** <name> [**--force-cn**] [**--require-eab**]
[**--challenge**=<challenge>] [**--remove-challenge**=<challenge>]
[**--acme-proxy-url**=<url>] [**--acme-disable-proxy**] [**--acme-dns-resolver**=<host:port>]
[**--attestation-format**=<format>] [**--remove-attestation-format**=<format>]
[**--attestation-roots**=<file>] [**--admin-cert**=<file>] [**--admin-key**=<file>]
[**--admin-subject**=<subject>] [**--admin-provisioner**=<name>] [**--admin-password-file**=<file>]
Expand Down Expand Up @@ -141,14 +142,17 @@ SCEP
// Nebula provisioner flags
nebulaRootFlag,

// ACME provisioner flags
requireEABFlag, // ACME
forceCNFlag, // ACME + SCEP
challengeFlag, // ACME + SCEP
removeChallengeFlag, // ACME
attestationFormatFlag, // ACME
removeAttestationFormatFlag, // ACME
attestationRootsFlag, // ACME
// ACME provisioner flags
requireEABFlag, // ACME
forceCNFlag, // ACME + SCEP
challengeFlag, // ACME + SCEP
removeChallengeFlag, // ACME
acmeProxyURLFlag, // ACME networking
acmeDisableProxyFlag, // ACME networking
acmeDNSResolverFlag, // ACME networking
attestationFormatFlag, // ACME
removeAttestationFormatFlag, // ACME
attestationRootsFlag, // ACME

// SCEP flags
scepCapabilitiesFlag,
Expand Down