Просмотр исходного кода

Cleanup EST authority and provisioner configuration

This removes some functionality that is not used with EST, simplifying
the configuration and validation of the authority and EST provisioner.

It stubs out some parts too, so that the code compiles again, albeit
with a non-complete EST implementation.
Herman Slatman 3 месяцев назад
Родитель
Сommit
2d22b8f7aa

+ 3 - 3
api/api.go

@@ -259,9 +259,9 @@ func scepFromProvisioner(p *provisioner.SCEP) *models.SCEP {
 
 func estFromProvisioner(p *provisioner.EST) *provisioner.EST {
 	prov := *p
-	prov.ClientCertificateRoots = []byte(redacted)
-	prov.BasicAuthUsername = redacted
-	prov.BasicAuthPassword = redacted
+	// prov.ClientCertificateRoots = []byte(redacted)
+	// prov.BasicAuthUsername = redacted
+	// prov.BasicAuthPassword = redacted
 	return &prov
 }
 

+ 2 - 33
authority/authority.go

@@ -75,7 +75,6 @@ type Authority struct {
 
 	// EST CA
 	estOptions   *est.Options
-	validateEST  bool
 	estAuthority *est.Authority
 
 	// SSH CA
@@ -141,7 +140,6 @@ func New(cfg *config.Config, opts ...Option) (*Authority, error) {
 		config:        cfg,
 		certificates:  new(sync.Map),
 		validateSCEP:  true,
-		validateEST:   true,
 		meter:         noopMeter{},
 		wrapTransport: httptransport.NoopWrapper(),
 	}
@@ -179,7 +177,6 @@ func NewEmbedded(opts ...Option) (*Authority, error) {
 		certificates:  new(sync.Map),
 		meter:         noopMeter{},
 		wrapTransport: httptransport.NoopWrapper(),
-		validateEST:   true,
 	}
 
 	// Apply options.
@@ -324,11 +321,6 @@ func (a *Authority) ReloadAdminResources(ctx context.Context) error {
 		// TODO(hs): don't remove the authority if we can't also
 		// reload it.
 		//a.scepAuthority = nil
-	case a.requiresEST() && a.GetEST() != nil:
-		a.estAuthority.UpdateProvisioners(a.getESTProvisionerNames())
-		if err := a.estAuthority.Validate(); err != nil {
-			log.Printf("failed validating EST authority: %v\n", err)
-		}
 	}
 
 	return nil
@@ -833,45 +825,22 @@ func (a *Authority) init() error {
 	switch {
 	case a.requiresEST() && a.GetEST() == nil:
 		if a.estOptions == nil {
-			options := &est.Options{
+			a.estOptions = &est.Options{
 				Roots:         a.rootX509Certs,
 				Intermediates: a.intermediateX509Certs,
 			}
-			if len(a.intermediateX509Certs) > 0 {
-				options.SignerCert = a.intermediateX509Certs[0]
-			}
-			if a.config.IntermediateKey != "" {
-				if signer, err := a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{
-					SigningKey: a.config.IntermediateKey,
-					Password:   a.password,
-				}); err == nil {
-					options.Signer = signer
-				}
-			}
-			a.estOptions = options
 		}
 
-		a.estOptions.ESTProvisionerNames = a.getESTProvisionerNames()
-
 		estAuthority, err := est.New(a, *a.estOptions)
 		if err != nil {
 			return err
 		}
 
-		if a.validateEST {
-			if err := estAuthority.Validate(); err != nil {
-				a.initLogf("failed validating EST authority: %v", err)
-			}
-		}
-
 		a.estAuthority = estAuthority
 	case !a.requiresEST() && a.GetEST() != nil:
 		a.estAuthority = nil
 	case a.requiresEST() && a.GetEST() != nil:
-		a.estAuthority.UpdateProvisioners(a.getESTProvisionerNames())
-		if err := a.estAuthority.Validate(); err != nil {
-			log.Printf("failed validating EST authority: %v\n", err)
-		}
+		// no-op
 	}
 
 	// Load X509 constraints engine.

+ 1 - 2
authority/options.go

@@ -18,8 +18,8 @@ import (
 	"github.com/smallstep/certificates/cas"
 	casapi "github.com/smallstep/certificates/cas/apiv1"
 	"github.com/smallstep/certificates/db"
-	"github.com/smallstep/certificates/internal/httptransport"
 	"github.com/smallstep/certificates/est"
+	"github.com/smallstep/certificates/internal/httptransport"
 	"github.com/smallstep/certificates/scep"
 )
 
@@ -259,7 +259,6 @@ func WithFullSCEPOptions(options *scep.Options) Option {
 func WithFullESTOptions(options *est.Options) Option {
 	return func(a *Authority) error {
 		a.estOptions = options
-		a.validateEST = false
 		return nil
 	}
 }

+ 48 - 64
authority/provisioner/est.go

@@ -4,39 +4,60 @@ import (
 	"context"
 	"crypto"
 	"crypto/x509"
-	"fmt"
 	"time"
 
 	"github.com/pkg/errors"
 
-	"github.com/smallstep/certificates/internal/httptransport"
 	"github.com/smallstep/linkedca"
+
+	"github.com/smallstep/certificates/authority/provisioner/est"
+
+	"github.com/smallstep/certificates/internal/httptransport"
 )
 
 // EST is the EST provisioner type, an entity that can authorize the EST flow.
 type EST struct {
 	*base
-	ID                            string   `json:"-"`
-	Type                          string   `json:"type"`
-	Name                          string   `json:"name"`
-	EnableTLSClientCertificate    *bool    `json:"enableTlsClientCertificate,omitempty"`
-	ForwardedTLSClientCertHeader  string   `json:"forwardedTlsClientCertHeader,omitempty"`
-	EnableHTTPBasicAuth           *bool    `json:"enableHTTPBasicAuth,omitempty"`
-	BasicAuthUsername             string   `json:"basicAuthUsername,omitempty"`
-	BasicAuthPassword             string   `json:"basicAuthPassword,omitempty"`
-	ClientCertificateRoots        []byte   `json:"clientCertificateRoots,omitempty"`
-	ForceCN                       bool     `json:"forceCN,omitempty"`
-	IncludeRoot                   bool     `json:"includeRoot,omitempty"`
-	ExcludeIntermediate           bool     `json:"excludeIntermediate,omitempty"`
-	MinimumPublicKeyLength        int      `json:"minimumPublicKeyLength,omitempty"`
-	CSRAttrs                      []byte   `json:"csrAttrs,omitempty"`
-	Options                       *Options `json:"options,omitempty"`
-	Claims                        *Claims  `json:"claims,omitempty"`
+	ID   string `json:"-"`
+	Type string `json:"type"`
+	Name string `json:"name"`
+
+	ForceCN                bool `json:"forceCN,omitempty"`
+	MinimumPublicKeyLength int  `json:"minimumPublicKeyLength,omitempty"`
+
+	// Authentication configures accepted client authentication. At
+	// least one method is required; RFC 7030 3.2.3 permits requiring
+	// HTTP authentication in addition to TLS client authentication.
+	Authentication est.Authentication `json:"authentication"`
+
+	// Operations enables EST operations. Defaults to cacerts,
+	// csrattrs, simpleenroll and simplereenroll.
+	Operations []est.Operation `json:"operations,omitempty"`
+
+	CACerts       est.CACerts        `json:"cacerts,omitempty"`
+	CSRAttributes *est.CSRAttributes `json:"csrAttributes,omitempty"`
+
+	// ProofOfPossession controls tls-unique identity/PoP linking
+	// (RFC 7030 3.5): disabled | optional | required.
+	ProofOfPossession est.PoPMode `json:"proofOfPossession,omitempty"`
+
+	DummyBool   *bool
+	DummyString string
+
+	// EnableTLSClientCertificate   *bool  `json:"enableTlsClientCertificate,omitempty"`
+	// ForwardedTLSClientCertHeader string `json:"forwardedTlsClientCertHeader,omitempty"`
+	// EnableHTTPBasicAuth          *bool  `json:"enableHTTPBasicAuth,omitempty"`
+	// BasicAuthUsername            string `json:"basicAuthUsername,omitempty"`
+	// BasicAuthPassword            string `json:"basicAuthPassword,omitempty"`
+	// ClientCertificateRoots       []byte `json:"clientCertificateRoots,omitempty"`
+
+	Options *Options `json:"options,omitempty"`
+	Claims  *Claims  `json:"claims,omitempty"`
+
 	ctl                           *Controller
 	signer                        crypto.Signer
 	signerCertificate             *x509.Certificate
 	challengeValidationController *challengeValidationController
-	notificationController        *notificationController
 	clientCertificateRootPool     *x509.CertPool
 }
 
@@ -88,8 +109,7 @@ func (s *EST) DefaultTLSCertDuration() time.Duration {
 func newESTChallengeValidationController(client HTTPClient, tw httptransport.Wrapper, webhooks []*Webhook) *challengeValidationController {
 	estHooks := []*Webhook{}
 	for _, wh := range webhooks {
-		// if wh.Kind != linkedca.Webhook_ESTCHALLENGE.String() {
-		if wh.Kind != "ESTCHALLENGE" {
+		if wh.Kind != linkedca.Webhook_ESTCHALLENGE.String() {
 			continue
 		}
 		estHooks = append(estHooks, wh)
@@ -124,20 +144,13 @@ func (s *EST) Init(config Config) (err error) {
 		s.GetOptions().GetWebhooks(),
 	)
 
-	// Prepare the EST notification controller
-	s.notificationController = newNotificationController(
-		config.WebhookClient,
-		config.WrapTransport,
-		s.GetOptions().GetWebhooks(),
-	)
-
-	if err := s.parseClientCertificateRoots(); err != nil {
-		return err
-	}
+	// if err := s.parseClientCertificateRoots(); err != nil {
+	// 	return err
+	// }
 
-	if err := s.normalizeAuthConfig(); err != nil {
-		return err
-	}
+	// if err := s.normalizeAuthConfig(); err != nil {
+	// 	return err
+	// }
 
 	s.ctl, err = NewController(s, s.Claims, config, s.Options)
 	return err
@@ -157,36 +170,7 @@ func (s *EST) AuthorizeSign(context.Context, string) ([]SignOption, error) {
 	}, nil
 }
 
-// ShouldIncludeRootInChain indicates if the CA should return its root in the chain.
-func (s *EST) ShouldIncludeRootInChain() bool {
-	return s.IncludeRoot
-}
-
-// ShouldIncludeIntermediateInChain indicates if the CA should include the intermediate CA certificate.
-func (s *EST) ShouldIncludeIntermediateInChain() bool {
-	return !s.ExcludeIntermediate
-}
-
-// GetSigner returns the provisioner specific signer, used to sign EST responses.
-func (s *EST) GetSigner() (*x509.Certificate, crypto.Signer) {
-	return s.signerCertificate, s.signer
-}
-
 // GetCSRAttributes returns the CSR attributes to signal to clients.
 func (s *EST) GetCSRAttributes(context.Context) ([]byte, error) {
-	return s.CSRAttrs, nil
-}
-
-func (s *EST) NotifySuccess(ctx context.Context, csr *x509.CertificateRequest, cert *x509.Certificate, transactionID string) error {
-	if s.notificationController == nil {
-		return fmt.Errorf("provisioner %q wasn't initialized", s.Name)
-	}
-	return s.notificationController.Success(ctx, csr, cert, transactionID)
-}
-
-func (s *EST) NotifyFailure(ctx context.Context, csr *x509.CertificateRequest, transactionID string, errorCode int, errorDescription string) error {
-	if s.notificationController == nil {
-		return fmt.Errorf("provisioner %q wasn't initialized", s.Name)
-	}
-	return s.notificationController.Failure(ctx, csr, transactionID, errorCode, errorDescription)
+	return nil, nil // TODO(hs): refactor
 }

+ 92 - 0
authority/provisioner/est/est.go

@@ -0,0 +1,92 @@
+package est
+
+import (
+	"crypto/x509"
+	"errors"
+)
+
+var (
+	ErrAuthMethodDisabled      = errors.New("est authentication method disabled")
+	ErrAuthMethodNotFound      = errors.New("no valid est authentication method found")
+	ErrAuthMethodMisconfigured = errors.New("est authentication method misconfigured")
+	ErrAuthDenied              = errors.New("est authentication denied")
+)
+
+type AuthMode string
+
+type HTTPAuth struct{}
+
+type EnrollmentIdentity string
+
+type Operation string
+
+type CSRAttributes struct{}
+
+type PoPMode string
+
+type Authentication struct {
+	// Mode is "any" (default) or "all", requiring every enabled
+	// method to succeed.
+	Mode AuthMode `json:"mode,omitempty"`
+
+	// ClientCertificate authenticates via the TLS client certificate
+	// (RFC 7030 3.3.2).
+	ClientCertificate *ClientCertificateAuth `json:"clientCertificate,omitempty"`
+
+	// HTTP authenticates via HTTP Basic or Digest (RFC 7030 3.2.3).
+	HTTP *HTTPAuth `json:"http,omitempty"`
+}
+
+type ClientCertificateAuth struct {
+	// Roots is a PEM bundle of external trust anchors for initial
+	// enrollment with an existing certificate (RFC 7030 2.2.1).
+	Roots []byte `json:"roots,omitempty"`
+
+	// AllowOwnCertificates accepts certificates issued by this CA,
+	// required for re-enrollment (RFC 7030 4.2.2). Scope with
+	// Provisioners; otherwise every leaf this CA has issued becomes
+	// an EST enrollment credential.
+	AllowOwnCertificates bool     `json:"allowOwnCertificates,omitempty"`
+	Provisioners         []string `json:"provisioners,omitempty"`
+
+	// Forwarded reads the client certificate from a header set by a
+	// TLS-terminating proxy. Incompatible with ProofOfPossession.
+	Forwarded *ForwardedClientCertificate `json:"forwarded,omitempty"`
+
+	// EnrollmentIdentity is "unrestricted" (default) or "match",
+	// requiring the CSR subject and SANs to equal the authenticating
+	// certificate's. Always enforced for simplereenroll (4.2.2).
+	EnrollmentIdentity EnrollmentIdentity `json:"enrollmentIdentity,omitempty"`
+}
+
+type ForwardedClientCertificate struct {
+	Header         string   `json:"header"`
+	Format         string   `json:"format,omitempty"`         // pem | der | url-encoded-pem | xfcc
+	TrustedProxies []string `json:"trustedProxies,omitempty"` // CIDRs
+}
+
+type CACerts struct {
+	ExcludeRoot         bool `json:"excludeRoot,omitempty"`
+	ExcludeIntermediate bool `json:"excludeIntermediate,omitempty"`
+	// Additional is a PEM bundle appended to /cacerts, e.g. Root CA
+	// Key Update certificates (RFC 7030 4.1.3).
+	Additional []byte `json:"additional,omitempty"`
+}
+
+// AuthRequest contains authentication material extracted from the request.
+type AuthRequest struct {
+	CSR                    *x509.CertificateRequest
+	ClientCertificate      *x509.Certificate
+	ClientCertificateChain []*x509.Certificate
+	CARoots                []*x509.Certificate
+	CAIntermediates        []*x509.Certificate
+	AuthenticationHeader   string
+	BasicAuthUsername      string
+	BasicAuthPassword      string
+	BearerToken            string
+}
+
+// HasBasicAuth reports whether any basic auth data is present.
+func (r *AuthRequest) HasBasicAuth() bool {
+	return r.BasicAuthUsername != "" || r.BasicAuthPassword != ""
+}

+ 26 - 49
authority/provisioner/est_auth.go

@@ -8,15 +8,10 @@ import (
 	"errors"
 	"fmt"
 
-	"github.com/smallstep/certificates/webhook"
 	"go.step.sm/crypto/x509util"
-)
 
-var (
-	ErrESTAuthMethodDisabled      = errors.New("est authentication method disabled")
-	ErrESTAuthMethodNotFound      = errors.New("no valid est authentication method found")
-	ErrESTAuthMethodMisconfigured = errors.New("est authentication method misconfigured")
-	ErrESTAuthDenied              = errors.New("est authentication denied")
+	"github.com/smallstep/certificates/authority/provisioner/est"
+	"github.com/smallstep/certificates/webhook"
 )
 
 // ClientCertificateConfig holds the EST client certificate authentication configuration.
@@ -25,28 +20,15 @@ type ClientCertificateConfig struct {
 	ForwardedTLSClientCertHeader string
 }
 
-// ESTAuthRequest contains authentication material extracted from the request.
-type ESTAuthRequest struct {
-	CSR                    *x509.CertificateRequest
-	ClientCertificate      *x509.Certificate
-	ClientCertificateChain []*x509.Certificate
-	CARoots                []*x509.Certificate
-	CAIntermediates        []*x509.Certificate
-	AuthenticationHeader   string
-	BasicAuthUsername      string
-	BasicAuthPassword      string
-	BearerToken            string
-}
-
 func (s *EST) GetClientCertificateConfig() *ClientCertificateConfig {
 	return &ClientCertificateConfig{
-		Enable:                       boolValue(s.EnableTLSClientCertificate, false),
-		ForwardedTLSClientCertHeader: s.ForwardedTLSClientCertHeader,
+		Enable:                       boolValue(s.DummyBool, false),
+		ForwardedTLSClientCertHeader: s.DummyString,
 	}
 }
 
 // AuthorizeRequest validates the request against configured EST auth methods.
-func (s *EST) AuthorizeRequest(ctx context.Context, req ESTAuthRequest) ([]SignCSROption, error) {
+func (s *EST) AuthorizeRequest(ctx context.Context, req est.AuthRequest) ([]SignCSROption, error) {
 	if s.hasAuthWebhooks() {
 		return s.authorizeWithWebhook(ctx, &req)
 	}
@@ -54,10 +36,10 @@ func (s *EST) AuthorizeRequest(ctx context.Context, req ESTAuthRequest) ([]SignC
 }
 
 // authorizeRequestLocal validates the request using provisioner configuration.
-func (s *EST) authorizeRequestLocal(req ESTAuthRequest) ([]SignCSROption, error) {
-	var lastErr error = ErrESTAuthMethodNotFound
+func (s *EST) authorizeRequestLocal(req est.AuthRequest) ([]SignCSROption, error) {
+	var lastErr error = est.ErrAuthMethodNotFound
 	if req.ClientCertificate != nil {
-		if boolValue(s.EnableTLSClientCertificate, false) {
+		if boolValue(s.DummyBool, false) { // TODO(hs): refactor
 			if s.hasClientCertificateRoots() {
 				if err := verifyCertificateWithPool(req.ClientCertificate, req.ClientCertificateChain, s.clientCertificateRootPool, nil); err == nil {
 					return []SignCSROption{}, nil
@@ -72,19 +54,19 @@ func (s *EST) authorizeRequestLocal(req ESTAuthRequest) ([]SignCSROption, error)
 				}
 			}
 		} else {
-			lastErr = ErrESTAuthMethodDisabled
+			lastErr = est.ErrAuthMethodDisabled
 		}
 	}
 
-	if req.hasBasicAuth() {
-		if boolValue(s.EnableHTTPBasicAuth, false) && s.BasicAuthPassword != "" {
+	if req.HasBasicAuth() {
+		if boolValue(s.DummyBool, false) && s.DummyString != "" {
 			if err := s.validateBasicAuthPassword(req.BasicAuthUsername, req.BasicAuthPassword); err == nil {
 				return []SignCSROption{}, nil
 			} else {
 				lastErr = err
 			}
 		} else {
-			lastErr = ErrESTAuthMethodDisabled
+			lastErr = est.ErrAuthMethodDisabled
 		}
 	}
 
@@ -93,19 +75,19 @@ func (s *EST) authorizeRequestLocal(req ESTAuthRequest) ([]SignCSROption, error)
 
 // validateBasicAuthPassword verifies the configured basic auth password.
 func (s *EST) validateBasicAuthPassword(username, password string) error {
-	if s.BasicAuthUsername != "" && username != s.BasicAuthUsername {
+	if s.DummyString != "" && username != s.DummyString {
 		return errors.New("invalid basic auth")
 	}
-	if subtleCompare(s.BasicAuthPassword, password) {
+	if subtleCompare(s.DummyString, password) {
 		return nil
 	}
 	return errors.New("invalid basic auth")
 }
 
 // authorizeWithWebhook executes configured webhooks for auth decisions.
-func (s *EST) authorizeWithWebhook(ctx context.Context, req *ESTAuthRequest) ([]SignCSROption, error) {
+func (s *EST) authorizeWithWebhook(ctx context.Context, req *est.AuthRequest) ([]SignCSROption, error) {
 	if !s.hasAuthWebhooks() {
-		return nil, ErrESTAuthMethodMisconfigured
+		return nil, est.ErrAuthMethodMisconfigured
 	}
 
 	var (
@@ -145,17 +127,12 @@ func (s *EST) authorizeWithWebhook(ctx context.Context, req *ESTAuthRequest) ([]
 	}
 
 	if len(opts) == 0 {
-		return nil, ErrESTAuthDenied
+		return nil, est.ErrAuthDenied
 	}
 
 	return opts, nil
 }
 
-// hasBasicAuth reports whether any basic auth data is present.
-func (r ESTAuthRequest) hasBasicAuth() bool {
-	return r.BasicAuthUsername != "" || r.BasicAuthPassword != ""
-}
-
 // hasAuthWebhooks reports whether auth webhooks are configured.
 func (s *EST) hasAuthWebhooks() bool {
 	return s.challengeValidationController != nil && len(s.challengeValidationController.webhooks) > 0
@@ -165,12 +142,12 @@ func (s *EST) hasAuthWebhooks() bool {
 func (s *EST) normalizeAuthConfig() error {
 	enable := true
 	if !s.authMethodsConfigured() {
-		s.EnableHTTPBasicAuth = &enable
+		s.DummyBool = &enable
 	}
-	if s.EnableHTTPBasicAuth == nil && (s.BasicAuthUsername != "" || s.BasicAuthPassword != "") {
-		s.EnableHTTPBasicAuth = &enable
+	if s.DummyBool == nil && (s.DummyString != "" || s.DummyString != "") { // TODO(hs): refactor
+		s.DummyBool = &enable
 	}
-	if boolValue(s.EnableHTTPBasicAuth, false) && s.BasicAuthPassword == "" && !s.hasAuthWebhooks() {
+	if boolValue(s.DummyBool, false) && s.DummyString == "" && !s.hasAuthWebhooks() {
 		return errors.New("basic auth password cannot be empty")
 	}
 	return nil
@@ -178,20 +155,20 @@ func (s *EST) normalizeAuthConfig() error {
 
 // authMethodsConfigured reports whether any auth method is explicitly configured.
 func (s *EST) authMethodsConfigured() bool {
-	return s.EnableTLSClientCertificate != nil ||
+	return s.DummyBool != nil ||
 		s.hasClientCertificateRoots() ||
-		s.EnableHTTPBasicAuth != nil
+		s.DummyBool != nil
 }
 
 // parseClientCertificateRoots loads external client certificate roots.
 func (s *EST) parseClientCertificateRoots() error {
-	if len(s.ClientCertificateRoots) == 0 {
+	if len(s.DummyString) == 0 {
 		return nil
 	}
 	var (
 		block   *pem.Block
 		hasCert bool
-		rest    = s.ClientCertificateRoots
+		rest    []byte
 	)
 	s.clientCertificateRootPool = x509.NewCertPool()
 	for rest != nil {
@@ -213,7 +190,7 @@ func (s *EST) parseClientCertificateRoots() error {
 }
 
 func (s *EST) hasClientCertificateRoots() bool {
-	return len(s.ClientCertificateRoots) > 0
+	return len(s.DummyString) > 0
 }
 
 // verifyCertificate validates the client certificate against CA roots.

+ 23 - 25
authority/provisioners.go

@@ -1006,23 +1006,22 @@ func ProvisionerToCertificates(p *linkedca.Provisioner) (provisioner.Interface,
 		return s, nil
 	case *linkedca.ProvisionerDetails_EST:
 		cfg := d.EST
-		enableTLSClientCertificate := cfg.EnableTlsClientCertificate
-		enableHTTPBasicAuth := cfg.EnableHttpBasicAuth
+		// enableTLSClientCertificate := cfg.EnableTlsClientCertificate
+		// enableHTTPBasicAuth := cfg.EnableHttpBasicAuth
 		return &provisioner.EST{
-			ID:                           p.Id,
-			Type:                         p.Type.String(),
-			Name:                         p.Name,
-			EnableTLSClientCertificate:   &enableTLSClientCertificate,
-			EnableHTTPBasicAuth:          &enableHTTPBasicAuth,
-			ForwardedTLSClientCertHeader: cfg.ForwardedTlsClientCertHeader,
-			BasicAuthUsername:            cfg.BasicAuthUsername,
-			BasicAuthPassword:            cfg.BasicAuthPassword,
-			ClientCertificateRoots:       provisionerPEMToCertificates(cfg.ClientCertificateRoots),
-			ForceCN:                      cfg.ForceCn,
-			IncludeRoot:                  cfg.IncludeRoot,
-			MinimumPublicKeyLength:       int(cfg.MinimumPublicKeyLength),
-			Claims:                       claims,
-			Options:                      options,
+			ID:                     p.Id,
+			Type:                   p.Type.String(),
+			Name:                   p.Name,
+			ForceCN:                cfg.ForceCn,
+			MinimumPublicKeyLength: int(cfg.MinimumPublicKeyLength),
+			// EnableTLSClientCertificate:   &enableTLSClientCertificate,
+			// EnableHTTPBasicAuth:          &enableHTTPBasicAuth,
+			// ForwardedTLSClientCertHeader: cfg.ForwardedTlsClientCertHeader,
+			// BasicAuthUsername:            cfg.BasicAuthUsername,
+			// BasicAuthPassword:            cfg.BasicAuthPassword,
+			// ClientCertificateRoots:       provisionerPEMToCertificates(cfg.ClientCertificateRoots),
+			Claims:  claims,
+			Options: options,
 		}, nil
 	case *linkedca.ProvisionerDetails_Nebula:
 		var roots []byte
@@ -1311,15 +1310,14 @@ func ProvisionerToLinkedca(p provisioner.Interface) (*linkedca.Provisioner, erro
 			Details: &linkedca.ProvisionerDetails{
 				Data: &linkedca.ProvisionerDetails_EST{
 					EST: &linkedca.ESTProvisioner{
-						ForceCn:                      p.ForceCN,
-						EnableTlsClientCertificate:   p.EnableTLSClientCertificate != nil && *p.EnableTLSClientCertificate,
-						EnableHttpBasicAuth:          p.EnableHTTPBasicAuth != nil && *p.EnableHTTPBasicAuth,
-						MinimumPublicKeyLength:       cast.Int32(p.MinimumPublicKeyLength),
-						IncludeRoot:                  p.IncludeRoot,
-						BasicAuthUsername:            p.BasicAuthUsername,
-						BasicAuthPassword:            p.BasicAuthPassword,
-						ClientCertificateRoots:       provisionerPEMToLinkedca(p.ClientCertificateRoots),
-						ForwardedTlsClientCertHeader: p.ForwardedTLSClientCertHeader,
+						ForceCn:                p.ForceCN,
+						MinimumPublicKeyLength: cast.Int32(p.MinimumPublicKeyLength),
+						// EnableTlsClientCertificate:   p.EnableTLSClientCertificate != nil && *p.EnableTLSClientCertificate,
+						// EnableHttpBasicAuth:          p.EnableHTTPBasicAuth != nil && *p.EnableHTTPBasicAuth,
+						// BasicAuthUsername:            p.BasicAuthUsername,
+						// BasicAuthPassword:            p.BasicAuthPassword,
+						// ClientCertificateRoots:       provisionerPEMToLinkedca(p.ClientCertificateRoots),
+						// ForwardedTlsClientCertHeader: p.ForwardedTLSClientCertHeader,
 					},
 				},
 			},

+ 3 - 1
est/api/api.go

@@ -20,6 +20,8 @@ import (
 	"github.com/smallstep/certificates/authority"
 	"github.com/smallstep/certificates/authority/provisioner"
 	"github.com/smallstep/certificates/est"
+
+	provest "github.com/smallstep/certificates/authority/provisioner/est"
 )
 
 const (
@@ -247,7 +249,7 @@ func authorizeEnrollRequest(ctx context.Context, csr *x509.CertificateRequest) (
 	prov := est.ProvisionerFromContext(ctx)
 	ca := authority.MustFromContext(ctx)
 
-	req := provisioner.ESTAuthRequest{
+	req := provest.AuthRequest{
 		CSR:             csr,
 		CARoots:         ca.GetRootCertificates(),
 		CAIntermediates: ca.GetIntermediateCertificates(),

+ 8 - 81
est/authority.go

@@ -3,10 +3,8 @@ package est
 import (
 	"bytes"
 	"context"
-	"crypto"
 	"crypto/x509"
 	"fmt"
-	"sync"
 
 	"github.com/smallstep/pkcs7"
 
@@ -17,13 +15,9 @@ import (
 
 // Authority handles EST interactions.
 type Authority struct {
-	signAuth            SignAuthority
-	roots               []*x509.Certificate
-	intermediates       []*x509.Certificate
-	defaultSigner       crypto.Signer
-	signerCertificate   *x509.Certificate
-	estProvisionerNames []string
-	provisionersMutex   sync.RWMutex
+	signAuth      SignAuthority
+	roots         []*x509.Certificate
+	intermediates []*x509.Certificate
 }
 
 type authorityKey struct{}
@@ -65,58 +59,12 @@ func New(signAuth SignAuthority, opts Options) (*Authority, error) {
 	}
 
 	return &Authority{
-		signAuth:            signAuth,
-		roots:               opts.Roots,
-		intermediates:       opts.Intermediates,
-		defaultSigner:       opts.Signer,
-		signerCertificate:   opts.SignerCert,
-		estProvisionerNames: opts.ESTProvisionerNames,
+		signAuth:      signAuth,
+		roots:         opts.Roots,
+		intermediates: opts.Intermediates,
 	}, nil
 }
 
-// validates if the EST Authority has a valid configuration.
-func (a *Authority) Validate() error {
-	if a == nil {
-		return nil
-	}
-
-	a.provisionersMutex.RLock()
-	defer a.provisionersMutex.RUnlock()
-
-	noDefaultSignerAvailable := a.defaultSigner == nil || a.signerCertificate == nil
-	for _, name := range a.estProvisionerNames {
-		p, err := a.LoadProvisionerByName(name)
-		if err != nil {
-			return fmt.Errorf("failed loading provisioner %q: %w", name, err)
-		}
-		if estProv, ok := p.(*provisioner.EST); ok {
-			cert, signer := estProv.GetSigner()
-			if cert == nil && noDefaultSignerAvailable {
-				return fmt.Errorf("EST provisioner %q does not have a signer certificate", name)
-			}
-			if signer == nil && noDefaultSignerAvailable {
-				return fmt.Errorf("EST provisioner %q does not have a signer", name)
-			}
-		}
-	}
-
-	return nil
-}
-
-// UpdateProvisioners updates the EST Authority with the new, and hopefully
-// current EST provisioners configured. This allows the Authority to be
-// validated with the latest data.
-func (a *Authority) UpdateProvisioners(estProvisionerNames []string) {
-	if a == nil {
-		return
-	}
-
-	a.provisionersMutex.Lock()
-	defer a.provisionersMutex.Unlock()
-
-	a.estProvisionerNames = estProvisionerNames
-}
-
 // LoadProvisionerByName calls out to the SignAuthority interface to load a
 // provisioner by name.
 func (a *Authority) LoadProvisionerByName(name string) (provisioner.Interface, error) {
@@ -125,19 +73,7 @@ func (a *Authority) LoadProvisionerByName(name string) (provisioner.Interface, e
 
 // GetCACertificates returns the certificate chain for the CA.
 func (a *Authority) GetCACertificates(ctx context.Context) (certs []*x509.Certificate, err error) {
-	p := provisionerFromContext(ctx)
-
-	if signerCert, _ := p.GetSigner(); signerCert != nil {
-		certs = append(certs, signerCert)
-	}
-
-	if p.ShouldIncludeIntermediateInChain() || len(certs) == 0 {
-		certs = append(certs, a.intermediates...)
-	}
-
-	if p.ShouldIncludeRootInChain() {
-		certs = append(certs, a.roots...)
-	}
+	certs = append(a.intermediates, a.roots...)
 
 	return certs, nil
 }
@@ -206,6 +142,7 @@ func (a *Authority) SignCSR(ctx context.Context, csr *x509.CertificateRequest, s
 	if err != nil {
 		return nil, fmt.Errorf("error generating certificate: %w", err)
 	}
+
 	// return leaf certificate (only): https://datatracker.ietf.org/doc/html/rfc7030#section-4.2.3
 	return certChain[0], nil
 }
@@ -226,13 +163,3 @@ func (a *Authority) BuildResponse(ctx context.Context, certs []*x509.Certificate
 	}
 	return degenerate, nil
 }
-
-func (a *Authority) NotifySuccess(ctx context.Context, csr *x509.CertificateRequest, cert *x509.Certificate, transactionID string) error {
-	p := provisionerFromContext(ctx)
-	return p.NotifySuccess(ctx, csr, cert, transactionID)
-}
-
-func (a *Authority) NotifyFailure(ctx context.Context, csr *x509.CertificateRequest, transactionID string, errorCode int, errorDescription string) error {
-	p := provisionerFromContext(ctx)
-	return p.NotifyFailure(ctx, csr, transactionID, errorCode, errorDescription)
-}

+ 2 - 18
est/options.go

@@ -1,7 +1,6 @@
 package est
 
 import (
-	"crypto"
 	"crypto/x509"
 	"errors"
 )
@@ -10,30 +9,15 @@ import (
 type Options struct {
 	Roots         []*x509.Certificate `json:"-"`
 	Intermediates []*x509.Certificate `json:"-"`
-	SignerCert    *x509.Certificate   `json:"-"`
-	Signer        crypto.Signer       `json:"-"`
-
-	ESTProvisionerNames []string
-}
-
-type comparablePublicKey interface {
-	Equal(crypto.PublicKey) bool
 }
 
 // Validate checks the fields in Options.
 func (o *Options) Validate() error {
 	switch {
+	case len(o.Roots) == 0:
+		return errors.New("no root certificate available for EST authority")
 	case len(o.Intermediates) == 0:
 		return errors.New("no intermediate certificate available for EST authority")
-	case o.SignerCert == nil:
-		return errors.New("no signer certificate available for EST authority")
-	}
-
-	if o.Signer != nil {
-		signerPublicKey := o.Signer.Public().(comparablePublicKey)
-		if !signerPublicKey.Equal(o.SignerCert.PublicKey) {
-			return errors.New("mismatch between signer certificate and public key")
-		}
 	}
 
 	return nil

+ 2 - 8
est/provisioner.go

@@ -2,10 +2,9 @@ package est
 
 import (
 	"context"
-	"crypto"
-	"crypto/x509"
 
 	"github.com/smallstep/certificates/authority/provisioner"
+	"github.com/smallstep/certificates/authority/provisioner/est"
 )
 
 // Provisioner is an interface that embeds the generic provisioner.Interface and
@@ -14,12 +13,7 @@ type Provisioner interface {
 	provisioner.Interface
 	GetOptions() *provisioner.Options
 	GetClientCertificateConfig() *provisioner.ClientCertificateConfig
-	ShouldIncludeRootInChain() bool
-	ShouldIncludeIntermediateInChain() bool
-	GetSigner() (*x509.Certificate, crypto.Signer)
-	AuthorizeRequest(ctx context.Context, req provisioner.ESTAuthRequest) ([]provisioner.SignCSROption, error)
-	NotifySuccess(ctx context.Context, csr *x509.CertificateRequest, cert *x509.Certificate, transactionID string) error
-	NotifyFailure(ctx context.Context, csr *x509.CertificateRequest, transactionID string, errorCode int, errorDescription string) error
+	AuthorizeRequest(ctx context.Context, req est.AuthRequest) ([]provisioner.SignCSROption, error)
 	GetCSRAttributes(ctx context.Context) ([]byte, error)
 }
 

+ 1 - 1
go.mod

@@ -174,4 +174,4 @@ require (
 	google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 // indirect
 )
 
-replace github.com/smallstep/linkedca => github.com/jbpin/linkedca v0.0.0-20260119192234-bf5917d1c897
+replace github.com/smallstep/linkedca => github.com/jbpin/linkedca v0.0.0-20260728083914-c76a61c2706f

+ 2 - 2
go.sum

@@ -261,8 +261,8 @@ github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw=
 github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
 github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
 github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
-github.com/jbpin/linkedca v0.0.0-20260119192234-bf5917d1c897 h1:DTvDVMjQ4IGEn+l7g1MqCZpqKFDU5ZTlRzTDTIMFUZs=
-github.com/jbpin/linkedca v0.0.0-20260119192234-bf5917d1c897/go.mod h1:bUm0HgkgtOjbnwShtNKu3XPuQ6AA/o680sxTfy9vdYk=
+github.com/jbpin/linkedca v0.0.0-20260728083914-c76a61c2706f h1:TwoMh5P12Fzoiw7iNsvDE8ABEpnJMQX+CYj348F5548=
+github.com/jbpin/linkedca v0.0.0-20260728083914-c76a61c2706f/go.mod h1:Z8c7EgVrSHNhshIhRnUGfKfE796+TwF2eyErhqANmJQ=
 github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
 github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
 github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW34dhU4az1GN0pTPADwNmvoRSeoZ6PItiqnY=