175 Commits

Author SHA1 Message Date
Mariano Cano
1011f5f540 Improve validation in authorization path 2025-12-02 16:54:44 -08:00
Herman Slatman
f1092e103a Fix govet non-constant error format string issues 2025-09-09 01:38:33 +02:00
Mariano Cano
c26c8d7615 Add SSH certificate type to metrics
This commit passes the commit updates the Meter interface with SSH
certificates and X.509 certificate chains. This allows us to add
certificate specific things into the metrics. In this PR we are adding
the SSH certificate type, user, or host.
2025-06-05 16:41:42 -07:00
Herman Slatman
acf4387180 Fix new golangci-lint v2 linter issues 2025-05-21 12:21:47 +02:00
Herman Slatman
27944b4eae Fix linter issues 2025-02-18 11:04:54 +01:00
Herman Slatman
aeb5e1b366 Address linter issues 2024-08-20 16:54:29 +02:00
Mariano Cano
9e8087fbb1 Add GetX509Signer method
This commit adds a method to the Authority type that returns the signer
used to sign X509 certificates.
2024-05-15 17:41:33 -07:00
Mariano Cano
0ac9023590 Fix typo in error message and comment 2024-03-12 14:58:36 -07:00
Mariano Cano
10f6a901ec Let the CA determine the RA lifetime
When the RA mode with StepCAS is used, let the CA decide which lifetime
the RA should get instead of requiring always 24h.

This commit also fixes linter warnings.

Related to #1094
2024-03-12 14:29:55 -07:00
Panagiotis Siatras
fb4cd6fe81 fix: Webhook-related instruments
* fix: also instrument webhooks that do not reach the wire
* fix: register the webhook instrumentation
2024-02-27 22:43:45 +02:00
Herman Slatman
2a8b80a3e1 Merge branch 'master' into herman/webhook-request-id 2024-02-27 12:17:10 +01:00
Herman Slatman
d1deb7f930 Add Expires header to CRL response 2024-02-08 14:10:48 +01:00
Panagiotis Siatras
dd1ff9c15b Implementation of the Prometheus endpoint (#1669)
Implementation of the http://{metricsAddress}/metrics Prometheus endpoint.
2024-01-25 23:47:27 -08:00
Herman Slatman
25c109e75d Change error message for CSR validation 2024-01-08 20:05:16 +01:00
Herman Slatman
4e06bdbc51 Add SignWithContext method to authority and mocks 2023-09-19 16:30:53 +02:00
max furman
8b256f0351 address linter warning for go 1.19 2023-05-09 23:47:28 -07:00
LarsBingBong
0d5c40e059 Mark the IDP critical in the generated CRL data.
Trying to get CRL to work on my environment I've been reading up on [RFC5280](https://www.rfc-editor.org/rfc/rfc5280#section-5.2.5) ... and the IDP to be marked as `Critical`. I hope I'm correct and that my understanding on how to mark the IDP is critical.
Looking at e.g. `3470b1ec57/x509util/extensions_test.go (L48)` makes me think so.

---

Hopefully the above change - if accepted - can get CRL's to work on my environment. If not we're at least one step closer.
2023-02-24 20:32:49 +01:00
foleyjohnm
c79d4e9316 adding CRLIDP config 2022-11-11 11:50:20 -05:00
Mariano Cano
c7f226bcec Add support for renew when using stepcas
It supports renewing X.509 certificates when an RA is configured with stepcas.
This will only work when the renewal uses a token, and it won't work with mTLS.

The audience cannot be properly verified when an RA is used, to avoid this we
will get from the database if an RA was used to issue the initial certificate
and we will accept the renew token.

Fixes #1021 for stepcas
2022-11-04 16:42:07 -07:00
Mariano Cano
2d582e5694 Remove use of time.Duration.Abs
time.Duration.Abs() was added in Go 1.19
2022-10-27 12:20:13 -07:00
Mariano Cano
51c7f56030 Truncate time to the second 2022-10-27 11:57:48 -07:00
Mariano Cano
59775fff0c Merge branch 'master' into crl-support 2022-10-27 10:13:19 -07:00
Mariano Cano
8200d19894 Improve CRL implementation
This commit adds some changes to PR #731, some of them are:
- Add distribution point to the CRL
- Properly stop the goroutine that generates the CRLs
- CRL config validation
- Remove expired certificates from the CRL
- Require enable set to true to generate a CRL

This last point is the principal change in behaviour from the previous
implementation. The CRL will not be generated if it's not enabled, and
if it is enabled it will always be regenerated at some point, not only
if there is a revocation.
2022-10-26 18:55:24 -07:00
Mariano Cano
aefdfc7be7 Use RawSubject on renew and rekey
Renew was not replicating exactly the subject because extra names
gets decoded into pkix.Name.Names, the non-default ones should be
added to pkix.Name.ExtraNames. Instead of doing that, this commit
sets the RawSubject that will also keep the order.

Fixes #1106
2022-10-19 19:10:50 -07:00
Raal Goff
f7df865687 refactor crl config, add some tests 2022-10-07 10:30:00 +08:00
Mariano Cano
bd1938b0da Add support for storing or sending attestation data to linkedca 2022-10-06 12:22:19 -07:00
Raal Goff
d0e81af524 Merge branch 'master' into crl-support 2022-09-30 08:45:48 +08:00
Andrew Reed
7101fbb0ee Provisioner webhooks (#1001) 2022-09-29 19:16:26 -05:00
Mariano Cano
c9e7af3722 Use only name constraints in GetTLSCertificate 2022-09-23 11:04:27 -07:00
Mariano Cano
2eba5326db Remove policy validation on renew 2022-09-22 12:17:16 -07:00
Mariano Cano
d68c765e20 Add context to errors 2022-09-21 18:46:34 -07:00
Mariano Cano
72e2c4eb2e Render proper policy and constrains errors 2022-09-21 18:35:18 -07:00
Mariano Cano
4b79405dac Check constraints and policy for leaf certificates too 2022-09-21 15:54:28 -07:00
Mariano Cano
325d8bca4f Merge branch 'master' into name-constraints 2022-09-21 13:29:44 -07:00
Mariano Cano
debe565e42 Validate constraints on Sign and Renew/Rekey
Fixes #1060
2022-09-20 18:52:47 -07:00
max furman
ab0d2503ae Standardize linting file and fix or ignore lots of linting errors 2022-09-20 16:35:41 -07:00
Mariano Cano
34c6c65671 Pass attestation information to the Sign method
Attestation information might be useful in authorizing webhooks
2022-09-16 12:37:41 -07:00
Raal Goff
40baf73dff remove incorrect check on revoked certificate dates, add mutex lock for generating CRLs, 2022-09-15 15:03:42 +08:00
Raal Goff
924082bb49 fix linter errors 2022-09-08 10:09:37 +08:00
Raal Goff
d2483f3a70 Merge branch 'master' into crl-support
# Conflicts:
#	authority/config/config.go
2022-09-08 09:45:04 +08:00
Mariano Cano
8bd0174251 Rename field to IsCAServerCert 2022-08-11 15:14:26 -07:00
Mariano Cano
5df1694250 Add endpoint id for the RA certificate
In a linked RA mode, send an endpoint id to group the server
certificates.
2022-08-11 14:47:11 -07:00
Mariano Cano
eb091aec54 Simplify field names for ProvisionerInfo 2022-08-10 17:44:14 -07:00
Mariano Cano
6b5d3dca95 Add provisioner name to RA info 2022-08-03 18:44:04 -07:00
Mariano Cano
f9df8ac05f Remove unused interface 2022-08-03 12:03:49 -07:00
Mariano Cano
9408d0f24b Send RA provisioner information to the CA 2022-08-02 19:28:49 -07:00
Raal Goff
60671b07d7 Merge branch 'master' into crl-support
# Conflicts:
#	api/api.go
#	authority/config/config.go
#	cas/softcas/softcas.go
#	db/db.go
2022-07-13 08:52:58 +08:00
Mariano Cano
ce9a23a0f7 Fix SSH certificate revocation 2022-05-25 16:55:22 -07:00
Mariano Cano
c8d7ad7ab9 Fix store certificates methods with new interface 2022-05-18 18:33:22 -07:00
Herman Slatman
6e1f8dd7ab Refactor policy engines into container 2022-04-26 13:12:16 +02:00