Commit Graph

6560 Commits

Author SHA1 Message Date
Aaron Gable 1694f183f2
Fix source_redis_test context import (#7491)
For unknown reasons, this one test file was importing the old
context package.
2024-05-17 11:55:54 -07:00
Aaron Gable 146b78a0f7
Remove all static minica keys (#7489)
Remove the redis-tls, wfe-tls, and mail-test-srv keys which were
generated by minica and then checked in to the repo. All three are
replaced by the dynamically-generated ipki directory.

Part of https://github.com/letsencrypt/boulder/issues/7476
2024-05-17 11:45:40 -07:00
Aaron Gable eb607e5b10
Remove more test keys (#7488)
Part of https://github.com/letsencrypt/boulder/issues/7476
2024-05-16 11:20:07 -04:00
Aaron Gable 6ae6aa8e90
Dynamically generate grpc-creds at integration test startup (#7477)
The summary here is:
- Move test/cert-ceremonies to test/certs
- Move .hierarchy (generated by the above) to test/certs/webpki
- Remove our mapping of .hierarchy to /hierarchy inside docker
- Move test/grpc-creds to test/certs/ipki
- Unify the generation of both test/certs/webpki and test/certs/ipki
into a single script at test/certs/generate.sh
- Make that script the entrypoint of a new docker compose service
- Have t.sh and tn.sh invoke that service to ensure keys and certs are
created before tests run

No production changes are necessary, the config changes here are just
for testing purposes.

Part of https://github.com/letsencrypt/boulder/issues/7476
2024-05-15 11:31:23 -04:00
Aaron Gable 6ee675f2f0
Update public suffix list (#7484)
It's been one month since the last PSL update.

Update:
- github.com/weppos/publicsuffix-go from
v0.30.3-0.20240411085455-21202160c2ed to
v0.30.3-0.20240510084413-5f1d03393b3d
- golang.org/x/crypto from v0.22.0 to v0.23.0 (no changes)
- golang.org/x/net from v0.24.0 to v0.25.0
- golang.org/x/term from v0.19.0 to v0.20.0 (no changes)
- golang.org/x/text from v0.14.0 to v0.15.0 (no changes)
- golang.org/x/sys from v0.19.0 to v0.20.0

Fixes https://github.com/letsencrypt/boulder/issues/7483
2024-05-14 10:10:20 -04:00
Aaron Gable 774000bf8d
Update to go1.22.3 (#7485)
Release notes: https://go.dev/doc/devel/release#go1.22.3
2024-05-13 18:30:56 -04:00
Phil Porada d19f70407c
wfe: Don't serve renewalInfoPath with trailing slash in the directory (#7482)
[draft-ietf-acme-ari-03 section
4.1](https://www.ietf.org/archive/id/draft-ietf-acme-ari-03.html#section-4.1)
states the following indicating that it's the clients responsibility to
add a `/` after the `renewalInfoPath`, not the server.
> Thus the full request url is constructed as follows, where the "||"
operator indicates string concatenation and the renewalInfo url is taken
from the Directory object:
```
url = renewalInfo || '/' || base64url(AKI) || '.' || base64url(Serial)
```
Fixes https://github.com/letsencrypt/boulder/issues/7481
2024-05-13 16:10:29 -04:00
Phil Porada 44c0587988
remoteva: Config options to handle alternate deployment models (#7473)
* Adds a `VerifyGRPCClientCertIfGiven` boolean to the `remoteva` config
that cause the RVA server to use the less strict
`tls.VerifyClientCertIfGiven` for use with an Amazon Web Services
Application Load Balancer (ALB) between the `boulder-va` and `remoteva`.
See https://github.com/letsencrypt/boulder/issues/7386.

Part of https://github.com/letsencrypt/boulder/issues/5294

---------

Co-authored-by: Samantha <hello@entropy.cat>
2024-05-13 14:43:40 -04:00
Samantha 16d55ef120
ratelimits: Support new Comment field for each Id entry (#7480)
Fixes #7478
2024-05-13 14:16:51 -04:00
Samantha 10b7e638d5
WFE: Remove support for draft-ietf-acme-ari01 CertID format (#7448)
Fixes #7183

---------

Co-authored-by: Aaron Gable <aaron@letsencrypt.org>
2024-05-10 14:54:36 -04:00
Samantha 5c27eadb1d
ratelimits: Remove deprecated overrides format (#7458)
Fixes #7198
2024-05-08 15:38:21 -04:00
Phil Porada 42b2240481
test: Update eggsampler/acme to support draft-ietf-acme-ari-03 (#7470)
`Eggsampler/acme` v3.6.0 has been
[released](https://github.com/eggsampler/acme/releases/tag/v3.6.0). I've
updated the ARI integration tests to issue replacement orders.

Fixes https://github.com/letsencrypt/boulder/issues/7463

---------

Co-authored-by: Aaron Gable <aaron@letsencrypt.org>
2024-05-08 11:01:27 -04:00
Phil Porada c1561b070b
Add a new remoteva binary (#7437)
* Adds a new `remoteva` binary that takes a distinct configuration from
the existing `boulder-va`
* Removed the `boulder-remoteva` name registration from `boulder-va`. 
  * Existing users of `boulder-remoteva` must either 
1. laterally migrate to `boulder-va` which uses that same config, or
    2. switch to using `remoteva` with a new config.

Part of https://github.com/letsencrypt/boulder/issues/5294
2024-05-06 16:29:29 -04:00
Jacob Hoffman-Andrews b7553f1290
docs: add ISSUANCE-CYCLE.md (#7444)
Also update the CA and RA doccomments to link to it and describe the
roles of key functions a little better.

Remove outdated reference to generating OCSP at issuance time.
2024-05-06 13:01:08 -07:00
Samantha a9c2fa3f69
ratelimits: Small comment for clarification (#7472)
Fix some lacking documentation around our only "override only" limit.
2024-05-06 13:47:30 -04:00
Jacob Hoffman-Andrews e75a821cc9
sa: eliminate requestedNames table (#7471)
Part of https://github.com/letsencrypt/boulder/issues/7432

Follows up on https://github.com/letsencrypt/boulder/pull/7435, now that
that PR is deployed.
2024-05-06 09:15:51 -07:00
Aaron Gable f24a97928b
VA: put most recent, not original, IP in error messages (#7468)
When we present error messages containing IP addresses to end users,
sometimes we're presenting the IP at which we began a chain of
redirects, but not presenting the IP at which the final redirect was
located. This can make it difficult for client operators to identify
exactly which server in their infrastructure is misbehaving.

Change our IP error messages to reference the most-recently-tried
address from the set of all validation records, rather than the address
which started the current (potential) redirect chain.

Fixes https://github.com/letsencrypt/boulder/issues/7347
2024-05-03 13:21:52 -07:00
Phil Porada d219948d3a
wfe: Remove ResolverAddrs field from being displayed to the client (#7464)
The ResolverAddrs field is only useful for internal debugging and
shouldn't be displayed to clients.

Fixes https://github.com/letsencrypt/boulder/issues/7462
2024-05-03 10:51:30 -07:00
Aaron Gable ab8497fae6
CA: Remove deprecated crldpBase config (#7461)
Remove the CA's global "crldpBase" config item, and the code which used
it to produce a IDP URI in our CRLs if it was configured.

This config item has been replaced by per-issuer crlURLBase configs
instead, because we have switched our CRL URL format from
"commonURL/issuerID/shard.crl" to "issuerURL/shard.crl" in anticipation
of including these URLs directly in our end-entity certs.

IN-10046 tracked the corresponding change in prod
2024-05-02 15:14:05 -07:00
Aaron Gable 6063430aed
admin: fail if any error is encountered during parallel processing (#7466)
While we don't want to halt the admin tool in the midst of its parallel
processing, we can keep track of whether it has encountered any errors
and raise one meta-error at the end of its execution. This will prevent
the top-level admin code from claiming that execution succeeded, and
ensure operators notice any previously-logged errors.

As part of this, fix the SA's GetLintPrecertificate wrapper to actually
call the SARO's GetLintPrecertificate, instead of incorrectly calling
the SARO's GetCertificate.

Fixes https://github.com/letsencrypt/boulder/issues/7460
2024-05-01 13:57:32 -07:00
Aaron Gable db77952e87
RA: fix GetSerialsByKey and GetSerialsByAccount (#7465)
Correctly explode the params slice with Go's "..." notation so that
gorp/go-sql-driver correctly receives each element of the params slice,
rather than receiving the slice as a whole. Also use the SA's clock,
rather than the DB's, to control which certs are selected -- in
deployments this wouldn't make a difference but in test those clocks can
be very different.

Add two unit tests to ensure this query does not regress, and create a
generic fake gRPC server stream for use in several SA tests including
the new ones.

Fixes https://github.com/letsencrypt/boulder/issues/7460
2024-05-01 13:57:25 -07:00
Samantha 1d2dbbdf25
config: Update minimum TLS version from 1.2 to 1.3 (#7457)
Set the minimum TLS version used for communication with gRPC, Redis,
and Unbound to 1.3. Also remove deprecated `SecurityVersion` setting in
`clientTransportCredentials` and `serverTransportCredentials`, as
grpc-go now uses the settings provided by the `tls.Config`.

The http-01 and tls-alpn-01challenges are not affected:
- 939ac1be8f/va/http.go (L140-L157)
- 939ac1be8f/va/tlsalpn.go (L213-L217)
2024-04-30 09:45:39 -07:00
Aaron Gable 939ac1be8f
Add pkilint to CI via custom zlint (#7441)
Add a new "LintConfig" item to the CA's config, which can point to a
zlint configuration toml file. This allows lints to be configured, e.g.
to control the number of rounds of factorization performed by the Fermat
factorization lint.

Leverage this new config to create a new custom zlint which calls out to
a configured pkilint API endpoint. In config-next integration tests,
configure the lint to point at a new pkilint docker container.

This approach has three nice forward-looking features: we now have the
ability to configure any of our lints; it's easy to expand this
mechanism to lint CRLs when the pkilint API has support for that; and
it's easy to enable this new lint if we decide to stand up a pkilint
container in our production environment.

No production configuration changes are necessary at this time.

Fixes https://github.com/letsencrypt/boulder/issues/7430
2024-04-30 09:29:26 -07:00
Samantha 9f2a27e03b
grpc: Consolidate various testdata hierarchies (#7456)
TLS credential tests use `test/grpc-creds` instead of various
hierarchies in `testdata` directories.
2024-04-29 16:56:18 -07:00
Aaron Gable 1816657462
Fix cert-checker to initialize its logger correctly (#7449)
Previously, cert-checker largely ignored its own config file and always
initialized its logger to log to syslog. This makes cert-checker
initialize its logger in the same way as all other boulder components.
2024-04-26 10:48:17 -04:00
Phil Porada 57a4995a26
test: Remove n_subject_common_name_included from ignored lint list (#7453)
Fixes https://github.com/letsencrypt/boulder/issues/7261
2024-04-25 13:37:40 -04:00
Phil Porada 5cc32106e6
CA: Run all table test subtests in parallel (#7452)
[Previously](https://github.com/letsencrypt/boulder/pull/7438) I had
made a change to run all CA tests in parallel, which was great, but I
failed to account for several table driven tests. By rebinding the
subtest's iterator to the lexical scope, each subtest can now run in
parallel.
2024-04-25 13:34:36 -04:00
Aaron Gable a4f75c8447
admin: revoke certs or block keys based on cert PEM (#7431)
Add a new "-cert-file" input mode to both `admin revoke-cert` and `admin
block-key` which operates on the serial or pubkey found in the
PEM-encoded certificate in the supplied file.

Fixes https://github.com/letsencrypt/boulder/issues/7267
2024-04-24 08:15:03 -07:00
Aaron Gable d7a9dc0f2b
Clean up docker-compose warnings (#7450)
This stops docker-compose from printing warnings during startup.
2024-04-24 08:10:38 -07:00
Aaron Gable 7ee5b469a6
CA: Fix CRL chunking loop (#7451)
Partial revert of https://github.com/letsencrypt/boulder/pull/7434

The purpose of this loop is to chunk the CRL into thousand-byte pieces.
To that end, it iterated across the bytes of the CRL in steps of size
1000. When this loop was replaced with a range loop, that step size was
not preserved.

Our tests do not usually produce any CRLs that exceed 1k bytes, so the
test CRLs fit within a single chunk, and this bug was not detected.

A search of the diff in the previous change does not show any other
instances where a step size other than 1 was being used.
2024-04-23 17:47:36 -07:00
Phil Porada fc7c522c28
RA: Audit log and track cert profile names and hashes (#7433)
* Adds `CertProfileName` to the CAs `capb.IssuePrecertificateResponse`
so the RA can receive the CAs configured default profile name for audit
logging/metrics. This is useful for when the RA sends an empty string as
the profile name to the CA, but we want to know exactly what the profile
name chosen by the CA was, rather than just relying on comparing hashes
between CA and RA audit logs.
* Adds the profile name and hash to RA audit logs emitted after a
successful issuance.
* Adds new labels to the existing `new_certificates` metric exported by
the RA.
```
# HELP new_certificates A counter of new certificates including the certificate profile name and hexadecimal certificate profile hash
# TYPE new_certificates counter
new_certificates{profileHash="de4c8c8866ed46b1d4af0d79e6b7ecf2d1ea625e26adcbbd3979ececd8fbd05a",profileName="defaultBoulderCertificateProfile"} 2
```

Fixes https://github.com/letsencrypt/boulder/issues/7421
2024-04-23 12:05:25 -04:00
forcedebug b33d28c8bd
Remove repeated words in comments (#7445)
Signed-off-by: forcedebug <forcedebug@outlook.com>
2024-04-23 10:30:33 -04:00
Aaron Gable b3bb595075
Remove caa-log-checker (#7442)
We first introduced caa-log-checker as a remediation item in the wake of
https://bugzilla.mozilla.org/show_bug.cgi?id=1619047. Since that time,
we have upgraded to go1.22, which completely remoes the class of bug
which led to that incident (https://tip.golang.org/doc/go1.22#language).
Throughout its life, caa-log-checker was an operational burden, and was
at best a post-hoc check to detect issues after they had already
occurred. Therefore, we no longer run it in our production environment,
and it can be removed from the Boulder source.
2024-04-22 10:35:18 -07:00
Aaron Gable e05d47a10a
Replace explicit int loops with range-over-int (#7434)
This adopts modern Go syntax to reduce the chance of off-by-one errors
and remove unnecessary loop variable declarations.

Fixes https://github.com/letsencrypt/boulder/issues/7227
2024-04-22 10:34:51 -07:00
Jacob Hoffman-Andrews 89b07f4543
sa: get order names from authorizations (#7435)
This removes the only place we query the requestedNames table, which
allows us to get rid of it in a subsequent PR (once this one is merged
and deployed).

Part of https://github.com/letsencrypt/boulder/issues/7432
2024-04-18 14:00:53 -07:00
Aaron Gable 94d14689bf
Implement unpredictable issuance from similar intermediates (#7418)
Replace the CA's "useForRSA" and "useForECDSA" config keys with a single
"active" boolean. When the CA starts up, all active RSA issuers will be
used to issue precerts with RSA pubkeys, and all ECDSA issuers will be
used to issue precerts with ECDSA pubkeys (if the ECDSAForAll flag is
true; otherwise just those that are on the allow-list). All "inactive"
issuers can still issue OCSP responses, CRLs, and (notably) final
certificates.

Instead of using the "useForRSA" and "useForECDSA" flags, plus implicit
config ordering, to determine which issuer to use to handle a given
issuance, simply use the issuer's public key algorithm to determine
which issuances it should be handling. All implicit ordering
considerations are removed, because the "active" certificates now just
form a pool that is sampled from randomly.

To facilitate this, update some unit and integration tests to be more
flexible and try multiple potential issuing intermediates, particularly
when constructing OCSP requests.

For this change to be safe to deploy with no user-visible behavior
changes, the CA configs must contain:
- Exactly one RSA-keyed intermediate with "useForRSALeaves" set to true;
and
- Exactly one ECDSA-keyed intermediate with "useForECDSALeaves" set to
true.

If the configs contain more than one intermediate meeting one of the
bullets above, then randomized issuance will begin immediately.

Fixes https://github.com/letsencrypt/boulder/issues/7291
Fixes https://github.com/letsencrypt/boulder/issues/7290
2024-04-18 10:00:38 -07:00
Aaron Gable 13172ac3f1
Fix cert-checker in config-next integration tests (#7440)
Cert checker has been failing in config-next because the
"CertCheckerRequiresCorrespondence" flag is enabled, but no permissions
were granted on the precertificates table. While this did cause it to
log profusively, this did not cause the tests to fail because
integration-test.py simply executes cert-checker without caring about
its exit code.
2024-04-18 09:40:41 -07:00
Aaron Gable 5c97f994bb
SA: Remove unused PreviousCertificateExists method (#7439)
This method has had no callers since the removal of ACMEv1.
2024-04-18 12:29:35 -04:00
Phil Porada c0ecabd244
CA: Run all CA package tests in parallel (#7438)
The CA tests don't share any state and create their own individual CA
implementations. We can safely run these tests in parallel within the CA
package to shave at least a second off of unit test runs at the expense
of additional CPU and memory usage.
2024-04-17 16:01:37 -07:00
Aaron Gable 2b8dea9821
Update publicsuffix-go (#7429)
We last updated the PSL two months ago, and the latest officially-tagged
release of publicsuffic-go is just one month old, but the domain
prompting the latest request to update the PSL landed just a few days
ago, so update to the latest commit rather than the latest release.

Also incidentally updates x/crypto, x/net, x/term, and x/sys, but brings
in no meaningful updates for any of them.

Fixes https://github.com/letsencrypt/boulder/issues/7428
2024-04-15 11:37:11 -07:00
Aaron Gable e1c2352d8d
Revert "CA: Fix multi-profile deployability bug" (#7423)
Reverts https://github.com/letsencrypt/boulder/pull/7422. That PR was
landed only for the sake of deployability. Now that it has been tagged
(in `release-2024-04-09`), it should be safe to revert to the desired
stricter behavior in the next release.

Part of https://github.com/letsencrypt/boulder/issues/6966
2024-04-15 11:03:21 -07:00
Phil Porada 3dc0039838
issuance: Validate existence of a CRL's TBSCertList.revokedCertificates field (#7417)
[RFC 5280 Section
5.1.2.6](https://datatracker.ietf.org/doc/html/rfc5280#section-5.1.2.6)
states:
> When there are no revoked certificates, the revoked certificates list
> MUST be absent.

The golang x509 library does parse CRLs and by virtue of zero values,
will correctly omit the `revokedCertificates` field from the DER-encoded
bytes of an ASN.1 data structure. The important bits that `crypto/x509`
uses to determine whether `revokedCertificates` exists are here:
[[1]](https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/crypto/x509/x509.go;l=2263-2267)
[[2]](https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/crypto/x509/x509.go;l=2359-2369)
[[3]](https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/crypto/x509/x509.go;l=2453-2455)
and
[[4]](https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/crypto/x509/parser.go;l=1157-1163).

This code is a validation that golang is doing the correct thing with
respect to omitting this field. I chose this method over
`asn1.Unmarshal` and building out a struct representation of a CRL to
reduce complexity and avoid potential future issues in golang's handling
of asn1 encoding/decoding.

Fixes https://github.com/letsencrypt/boulder/issues/7415
2024-04-12 17:56:37 -04:00
Aaron Gable 3664314778
Add GitHub Action to prompt CP/CPS review when new flags are added (#7425)
Fixes https://github.com/letsencrypt/boulder/issues/7420
2024-04-12 12:04:48 -07:00
Aaron Gable ce8986e17b
Make "CRLDPBase" config item optional (#7427)
This was missed in https://github.com/letsencrypt/boulder/pull/7300

Part of https://github.com/letsencrypt/boulder/issues/7296
2024-04-12 11:23:27 -07:00
dependabot[bot] 393beac0a1
build(deps): bump golang.org/x/sync from 0.6.0 to 0.7.0 (#7426)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.6.0 to
0.7.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 12:30:55 -04:00
Aaron Gable 2099d57a9e
Run config/sql change action when ready for review (#7419)
Rather than running the "check-changes" action immediately when a PR is
opened, wait for the PR to be ready for review (either by being taken
out of draft mode, or by having reviewers added). This way it's possible
to create a draft PR, then create a corresponding deployment ticket
which references the PR, add that ticket to the PR description, and mark
the PR ready for review, thereby pre-empting the bot so it doesn't have
to leave a comment.
2024-04-10 11:22:04 -04:00
Aaron Gable ebdabe693b
CA: Fix multi-profile deployability bug (#7422)
When https://github.com/letsencrypt/boulder/pull/7325 was deployed to
staging, the CA threw "Incomplete cert for precertificate request"
errors. Even though the RA was forwarding the CertProfileHash in all
IssueCertificateForPrecertificate requests to updated CA instances, it
can't do that if the IssuePrecertificate request was handled by a
non-updated CA instance that didn't yet know to return the hash.

This PR should be landed, tagged with a release, and then immediately
reverted for inclusion in the next release.

Part of https://github.com/letsencrypt/boulder/issues/6966
2024-04-09 15:41:46 -07:00
Aaron Gable 327f96d281
Update integration test hierarchy for the modern era (#7411)
Update the hierarchy which the integration tests auto-generate inside
the ./hierarchy folder to include three intermediates of each key type,
two to be actively loaded and one to be held in reserve. To facilitate
this:
- Update the generation script to loop, rather than hard-coding each
intermediate we want
- Improve the filenames of the generated hierarchy to be more readable
- Replace the WFE's AIA endpoint with a thin aia-test-srv so that we
don't have to have NameIDs hardcoded in our ca.json configs

Having this new hierarchy will make it easier for our integration tests
to validate that new features like "unpredictable issuance" are working
correctly.

Part of https://github.com/letsencrypt/boulder/issues/729
2024-04-08 14:06:00 -07:00
Phil Porada 1e1f6ff254
CA: Load multiple certificate profiles (#7325)
This change introduces a new config key `certProfiles` which contains a
map of `profiles`. Only one of `profile` or `certProfiles` should be
used, because configuring both will result in the CA erroring and
shutting down. Further, the singular `profile` is now
[deprecated](https://github.com/letsencrypt/boulder/issues/7414).

The CA pre-computes several maps at startup; 
* A human-readable name to a `*issuance.Profile` which is referred to as
"name".
* A SHA-256 sum over the entire contents of the given profile to the
`*issuance.Profile`. We'll refer to this as "hash".

Internally, CA methods no longer pass an `*issuance.Profile`, instead
they pass a structure containing maps of certificate profile
identifiers. To determine the default profile used by the CA, a new
config field `defaultCertificateProfileName` has been added to the
Issuance struct. Absence of `defaultCertificateProfileName` will cause
the CA to use the default value of `defaultBoulderCertificateProfile`
such as for the the deprecated `profile`. The key for each given
certificate profile will be used as the "name". Duplicate names or
hashes will cause the CA to error during initialization and shutdown.

When the RA calls `ra.CA.IssuePrecertificate`, it will pass an arbitrary
certificate profile name to the CA triggering the CA to lookup if the
name exists in its internal mapping. The RA maintains no state or
knowledge of configured certificate profiles and relies on the CA to
provide this information. If the name exists in the CA's map, it will
return the hash along with the precertificate bytes in a
`capb.IssuePrecertificateResponse`. The RA will then call
`ra.CA.IssueCertificateForPrecertificate` with that same hash. The CA
will lookup the hash to determine if it exists in its map, and if so
will continue on with certificate issuance.

Precertificate and certificate issuance audit logs will now include the
certificate profile name and hex representation of the hash that they
were issued with.

Fixes https://github.com/letsencrypt/boulder/issues/6966

There are no required config or SQL changes.
2024-04-08 12:52:46 -04:00
Samantha a88bd68ead
WFE: Count NewOrders which indicate replacement (#7416)
Add support for counting new orders which indicate replacement according
to draft-ietf-acme-ari.

Fixes #7405
2024-04-08 12:32:45 -04:00