Commit Graph

6560 Commits

Author SHA1 Message Date
dependabot[bot] 70d1887eea
build(deps): bump docker/login-action from 3.0.0 to 3.1.0 (#7399)
Bumps [docker/login-action](https://github.com/docker/login-action) from
3.0.0 to 3.1.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 13:56:24 -04:00
Aaron Gable 1f8a6e869c
Remove IssueCertificateRequest.IssuerNameID (#7409)
This field was introduced in
https://github.com/letsencrypt/boulder/pull/5222 to allow the old v1
WFEs to continue to tightly control which issuers were used, rather than
letting the CA dynamically pick an issuer based on the to-be-issued
certificate's public key. The plumbing between the v1 WFEs and the RA
was removed in https://github.com/letsencrypt/boulder/pull/5900, and
this has been dead code ever since.

Part of https://github.com/letsencrypt/boulder/issues/7291
2024-04-04 12:58:44 -04:00
Aaron Gable 7086537553
Update golang.org/x/net for security advisory (#7413)
This will fix the error govulncheck is reporting.
2024-04-04 12:50:42 -04:00
Aaron Gable a7b73450d5
Re-enable lints on go1.22 (#7412)
We had disabled our lints on go1.22 because golangci-lint and
staticcheck didn't work with some of its updates. Re-enable them, and
fix the things which the updated linters catch now.

Fixes https://github.com/letsencrypt/boulder/issues/7229
2024-04-04 08:14:29 -07:00
Samantha d509183513
Go: Update from 1.22.1 to 1.22.2 (#7410) 2024-04-03 18:49:39 -07:00
Aaron Gable 31907e5afd
Add checksums to release artifacts (#7404)
Fixes https://github.com/letsencrypt/boulder/issues/7403
2024-04-02 15:16:17 -07:00
Phil Porada 5f616ccdb9
Upgrade go-jose from v2.6.1 to v.4.0.1 (#7345)
Upgrade from the old go-jose v2.6.1 to the newly minted go-jose v4.0.1. 
Cleans up old code now that `jose.ParseSigned` can take a list of
supported signature algorithms.

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

---------

Co-authored-by: Aaron Gable <aaron@letsencrypt.org>
2024-04-02 17:49:51 -04:00
Aaron Gable 2f669ed3e7
Remove go1.21 from CI (#7401)
We have moved entirely to go1.22 in prod. This also allows us to remove
setting loopvar from our CI tasks, since it is the default behavior as
of go1.22.
2024-04-01 15:16:42 -07:00
Aaron Gable 28bf76e4ce
Fix new CRL IDP construction to avoid double slash (#7402) 2024-04-01 15:55:30 -04:00
Aaron Gable bce14e56f6
Restructure admin subcommands for greater flexibility (#7398)
Give the admin tool a slightly more structured subcommand system:
subcommands are now represented by structs (rather than just methods on
the admin object) which satisfy a particular interface. This interface
separates flag declaration from execution, so that we can have greater
flexibility with regard to command line parsing. This allows the two
top-level flags (-config and -dry-run) to appear anywhere in the command
line (not only before the subcommand name), and allows the -h/-help flag
to print usage information even when other critical flags (like -config)
are missing.

Fixes https://github.com/letsencrypt/boulder/issues/7393
Fixes https://github.com/letsencrypt/boulder/issues/7359
2024-03-29 12:51:27 -07:00
Aaron Gable 6149ac63e6
admin: gain ability to block keys by spki hash (#7397)
Add a new input method flag to `admin block-key` which processes a file
containing one hexadecimal-encoded SPKI hash on each line. To facilitate
this, restructure the block-key subcommand's execution to more closely
resemble the revoke-cert subcommand, with a parallelism flag and the
ability to run many workers at the same time.

Part of https://github.com/letsencrypt/boulder/issues/7267
2024-03-27 17:17:39 -07:00
George Ma 3f6eccf58d
Fix two function names in doc comments (#7394) 2024-03-25 23:46:29 -07:00
Shiloh Heurich 2cf734edcd
Fix TestAkamaiPurgerDrainQueueSucceeds data race (#7389)
Fixes https://github.com/letsencrypt/boulder/issues/7388
2024-03-25 10:52:19 -07:00
Samantha 3e2d852f3c
ARI: Return HTTP 409 "Conflict" when the certificate identified by 'replaces' has already been replaced (#7385)
Fixes #7338
2024-03-21 15:57:22 -04:00
dependabot[bot] f0ade6b2cb
build(deps): bump github.com/eggsampler/acme/v3 from 3.4.0 to 3.5.0 (#7391) 2024-03-20 15:21:16 -07:00
Phil Porada 8556eaedca
SA: store and return certificate profile name (#7352)
Adds `certificateProfileName` to the `orders` database table. The
[maximum
length](https://github.com/letsencrypt/boulder/pull/7325/files#diff-a64a0af7cbf484da8e6d08d3eefdeef9314c5d9888233f0adcecd21b800102acR35)
of a profile name matches the `//issuance` package.

Adds a `MultipleCertificateProfiles` feature flag that, when enabled,
will store the certificate profile name from a `NewOrderRequest`. The
certificate profile name is allowed to be empty and the database will
treat that row as [NULL](https://mariadb.com/kb/en/null-values/). When
the SA retrieves this potentially NULL row, it will be cast as the
golang string zero value `""`.

SRE ticket IN-10145 has been filed to perform the database migration and
enable the new feature flag. The migration must be performed before
enabling the feature flag.

Part of https://github.com/letsencrypt/boulder/issues/7324
2024-03-20 13:08:31 -04:00
Samantha c6b50558e6
WFE: Add support for certificate profiles (#7373)
- Parse and validate the `profile` field in `newOrder` requests.
- Pass the `profile` field from `newOrder` calls to the resulting
`RA.NewOrder` call.
- When the client requests a specific profile, ensure that the profile
field is populated in the order returned.

Fixes #7332
Part of #7309
2024-03-20 12:49:45 -04:00
dependabot[bot] 206c35f099
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#7384)
Updates google.golang.org/protobuf from 1.32.0 to 1.33.0
Also updates github.com/golang/protobuf from 1.5.3 to 1.5.4
2024-03-19 10:39:33 -07:00
Aaron Gable 7f04092e72
Simplify streaming rows from the database (#7372)
Create a new method on the gorm rows object which runs a small closure
for every row retrieved from the database. Use this new method to remove
20 lines of boilerplate from five different SA methods and rocsp-tool.
2024-03-19 08:39:00 -07:00
Samantha 5e68cbe552
WFE: Gate ARI limit exemption and replacement tracking on a feature flag (#7383)
Gate checking of replacement orders and exemption for ARI replacements
on the `TrackReplacementCertificatesARI` feature flag.
2024-03-18 12:22:01 -04:00
Aaron Gable 8ac88f557b
RA: Propagate profile name and hash from SA to CA (#7367)
When the order object retrieved from the SA contains a profile name,
propagate that into the request for the CA to issue a precertificate.
Similarly, when the CA's precertificate issuance response contains a
profile hash, propagate that into the request for the CA to issue the
corresponding final certificate.

Fixes https://github.com/letsencrypt/boulder/issues/7366
2024-03-14 14:55:32 -07:00
Aaron Gable 8d169a8dfb
Add certificateProfileName to RA, SA, and Core order protos (#7381)
This adds the profile name to the proto messages necessary to propagate
it from the WFE to the SA, and from the SA to the CA. This change is
safe to land prior to any logic being added, and unblocks
profile-handling logic changes to the WFE, RA, SA, and CA.

Part of https://github.com/letsencrypt/boulder/issues/7309
2024-03-14 13:46:58 -04:00
dependabot[bot] c175272335
build(deps): bump go.opentelemetry.io/otel/trace from 1.21.0 to 1.24.0 (#7343)
Bumps
[go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go)
from 1.21.0 to 1.24.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 13:36:52 -04:00
Kruti Sutaria 57cf7d5f45
fixes #7356: admin-tool checks serial format for cert revocation (#7379)
When a serial is passed in, all extraneous characters that are not
alphanumeric are stripped. The result is checked against
[[core.ValidSerial](9b05c38eb3/core/util.go (L170))]
to ensure that it is a valid hex of 32 or 36 characters and then passed
to the rest of boulder. If the stripped serial is not a valid serial, an
error is thrown and revocation does not proceed.
2024-03-14 12:58:33 -04:00
Jacob Hoffman-Andrews c724845579
ci: update govulncheck (#7380)
Always run on the latest Go version. This reduces busywork / failed CI
builds when Go publishes a security release, since we have other
processes for making sure we get notice of those security releases.

This may still fail for a little while after the Go release is
published, while we wait for GitHub to update the Go version used in CI
as "latest", but it will be a little faster and require less manual
work.
2024-03-13 15:52:46 -04:00
Samantha e2c89ddb7e
ARI: Fix typo in error (#7382) 2024-03-13 12:07:02 -07:00
Aaron Gable ffef10ab36
admin: use SA to get metadata before blocking key (#7377)
Use two existing SA methods, KeyBlocked and GetSerialsByKey, to replace
the direct database access previously used by the blockSPKIHash method.
This is less efficient than before -- it now streams the whole set of
affected serials rather than just counting them -- but doing so prevents
us from needing an additional SA method just for counting.

Also update the default mock StorageAuthority and
StorageAuthorityReadOnly provided by the mocks package to return actual
stream objects (which stream zero results) instead of nil, so that tests
can attempt to read from the resulting stream without getting a nil
pointer exception.

Part of https://github.com/letsencrypt/boulder/issues/7350
2024-03-11 15:18:46 -07:00
Samantha 7e5c1ca4bd
RA: Count failed authorizations using key-value rate limits (#7346)
Part of #5545
2024-03-11 17:24:45 -04:00
Aaron Gable 6710ebe4cd
admin: use SA to get serials by account and by SPKI hash (#7369)
Add two new methods to the SA, GetSerialsByKey and GetSerialsByAccount,
which use the same query as the admin tool has previously used to get
serials matching a given SPKI hash or a given registration ID. These two
new gRPC methods read the database row-by-row and produce streams of
results to keep SA memory usage low.

Use these methods in the admin tool so it no longer needs a direct
database connection for these actions.

Part of https://github.com/letsencrypt/boulder/issues/7350
2024-03-11 13:25:59 -07:00
Matthew McPherrin 7d633c6e78
Check if JSON configs are properly formatted instead of relying on git --diff (#7375)
This adds a new --write flag which will write out the formatted JSON
files.

By default this command now checks if the files are properly formatted
and prints a list of unformatted files.

This avoids the problem of lints failing if there are uncommited
changes, and decouples this check from git.

By using a proper argument parsing library, we also get a good --help
flag.
2024-03-08 14:39:00 -08:00
Brad 03c2ef6a69
Add/clean up admin tool audit lines (#7376)
Before this PR, this is what example output of using the admin tool
would look like for an example command (in this case, certificate
revocation):
```
$ sudo /vagrant/admin -config /etc/boulder/config/admin.json revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
20:22:05.682795 6 admin qK_A7gU Debug server listening on :8000
20:22:05.682908 6 admin ts7-5Ag Versions: admin=(Unspecified Unspecified) Golang=(go1.21.8) BuildHost=(Unspecified)
20:22:05.689743 6 admin 6MX16g0 Found 1 certificates to revoke
20:22:05.691842 6 admin 1b3FsgU dry-run: &proto.AdministrativelyRevokeCertificateRequest{state:impl.MessageState{NoUnkeyedLiterals:pragma.NoUnkeyedLiterals{}, DoNotCompare:pragma.DoNotCompare{}, DoNotCopy:pragma.DoNotCopy{}, atomicMessageInfo:(*impl.MessageInfo)(nil)}, sizeCache:0, unknownFields:[]uint8(nil), Cert:[]uint8(nil), Serial:"2a13699017c283dea4d6ac5ac6d40caa3321", Code:0, AdminName:"root", SkipBlockKey:false, Malformed:false}
20:22:05.691901 6 admin 7tT7rAY Dry run complete. Pass -dry-run=false to mutate the database.
```
after this change the output looks like this:
```
$ sudo /vagrant/admin -config /etc/boulder/config/admin.json revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
21:22:13.769728 6 admin qK_A7gU Debug server listening on :8000
21:22:13.770156 6 admin ts7-5Ag Versions: admin=(Unspecified Unspecified) Golang=(go1.21.8) BuildHost=(Unspecified)
21:22:13.779291 6 admin xNuU_gY [AUDIT] admin tool executing a dry-run with the following arguments: revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
21:22:13.779534 6 admin 6MX16g0 Found 1 certificates to revoke
21:22:13.784524 6 admin yvHv9AM dry-run: "serial:\"2a13699017c283dea4d6ac5ac6d40caa3321\" adminName:\"root\""
21:22:13.786379 6 admin nKfNswk [AUDIT] admin tool has successfully completed executing a dry-run with the following arguments: revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
21:22:13.786951 6 admin 7tT7rAY Dry run complete. Pass -dry-run=false to mutate the database.
```
and with `-dry-run=false`:
```
$ sudo /vagrant/admin -config /etc/boulder/config/admin.json -dry-run=false revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
21:23:19.080073 6 admin qK_A7gU Debug server listening on :8000
21:23:19.080510 6 admin ts7-5Ag Versions: admin=(Unspecified Unspecified) Golang=(go1.21.8) BuildHost=(Unspecified)
21:23:19.089588 6 admin iKnckQ0 [AUDIT] admin tool executing with the following arguments: revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
21:23:19.089625 6 admin 6MX16g0 Found 1 certificates to revoke
21:23:19.169317 6 admin 9oyv3QY [AUDIT] admin tool has successfully completed executing with the following arguments: revoke-cert -serial 2a13699017c283dea4d6ac5ac6d40caa3321
```

Fixes #7358
2024-03-08 14:38:21 -08:00
Aaron Gable cd418af285
Make inmem mock streams generic (#7370)
This significantly reduces the amount of code necessary to add inmem
wrappers for other streaming SA methods if/when we need them in the
future.
2024-03-08 08:04:16 -08:00
Aaron Gable 74328338a0
Centralize IDP construction and make IDP comparison smarter (#7341)
Change crl-storer to only require that 1 of the IssuingDistributionPoint
URIs remain consistent between consecutive CRLs in the same sequence.
This allows us to add and remove IDP URIs, so we can change our IDP
scheme over time.

To facilitate this, also move all code which builds or parses IDP
extensions into a single place, so that we don't have to have multiple
definitions of the same types and similar code in many places.

Fixes https://github.com/letsencrypt/boulder/issues/7340
Part of https://github.com/letsencrypt/boulder/issues/7296
2024-03-07 14:18:42 -08:00
Aaron Gable c110a3e6c9
Update Review Requirements (#7363)
Make the Review Requirements section of CONTRIBUTING.md more accurately
reflect our actual policy and behavior, and include a clarification for
external contributions.
2024-03-07 15:47:33 -05:00
Phil Porada 8a74de18ab
ceremony: Remove unnecessary fmt.Print (#7368)
I accidentally left this print line in while working on
https://github.com/letsencrypt/boulder/pull/7364 and forgot to clean it
up.
2024-03-07 15:17:23 -05:00
Phil Porada 62153579db
ceremony: Add post-issuance linting (#7364)
Adds post-issuance zlint linting to the `rootCeremony`,
`intermediateCeremony`, and `crossCertCeremony` ceremonies. It calls
zlint directly rather than using the existing
`issueLintCertAndPerformLinting` because the throwaway linting key pair
is unnecessary at this point.

Fixes https://github.com/letsencrypt/boulder/issues/7354
2024-03-07 13:03:10 -05:00
Jacob Hoffman-Andrews 9b05c38eb3
Bump Go version used by govulncheck (#7362) 2024-03-06 11:06:18 -08:00
Samantha 529157ce56
ratelimits: Fix transaction building for Failed Authorizations Limit (#7344)
- Update the failed authorizations limit to use 'enum:regId:domain' for
transactions while maintaining 'enum:regId' for overrides.
- Modify the failed authorizations transaction builder to generate a
transaction for each order name.
- Rename the `FailedAuthorizationsPerAccount` enum to
`FailedAuthorizationsPerDomainPerAccount` to align with its corrected
implementation. This change is possible because the limit isn't yet
deployed in staging or production.

Blocks #7346
Part of #5545
2024-03-06 13:48:32 -05:00
Jacob Hoffman-Andrews 51231a3942
va: log internal error (#7335)
In addition to the user-facing error, it's sometimes useful to have the
fully detailed internal error.

Fixes #7289
2024-03-06 10:10:26 -08:00
Shiloh Heurich 76705b60a2
s3-test-srv: sync r/w to srv.allShards (#7361)
Fixes https://github.com/letsencrypt/boulder/issues/7353
2024-03-06 11:59:25 -05:00
Aaron Gable 7ddb2be3f9
Update CI to go1.21.8 and go1.22.1 (#7356)
Security releases announced here:
https://groups.google.com/g/golang-announce/c/5pwGVUPoMbg
2024-03-05 14:13:21 -08:00
Aaron Gable 517efde477
Strip old admin-revoker down to bare bones (#7317)
De-duplicate the code that has been replaced by `admin`, and cause all
of its subcommands to print helpful messages indicating the
corresponding `admin` command to run instead.
2024-03-05 12:36:29 -08:00
Phil Porada bb827263a9
CA: gRPC plumbing for multiple certificate profiles (#7331)
Adds a new `certProfileName` message to the
`CA.IssueCertificateRequest`. This field contains a human-readable
"name" set by the
[WFE2](https://github.com/letsencrypt/boulder/issues/7332), and in turn
the RA. At the time of precertificate issuance, the receiving CA will
determine if it is capable of fulfilling the `ra.CA.IssuePrecertificate`
request for the given `certProfileName`. If the name is found in the
CA's map, the CA will return a `capb.IssuePrecertificateResponse`
message with a populated `certProfileHash` field back to the RA. When
that RA calls `ra.CA.IssueCertificateForPrecertificate`, it will send
that same `certProfileHash` message to a CA which must ensure it
contains a certificate profile matching the provided hash. If the hash
in found in the CA's map a final certificate issuance attempt will
proceed. This is done to prevent certificate profile changes in the
duration between requests from causing a mismatch between precerticate
and final certificate.

Part of https://github.com/letsencrypt/boulder/issues/7309
Part of https://github.com/letsencrypt/boulder/issues/6966
2024-03-05 12:22:28 -05:00
Matthew McPherrin 751281b0b1
Set MaxIdleConnsPerHost to MaxIdleConns (#7349)
MaxIdleConns defaults to 100, but MaxIdleConnsPerHost is only 2. Because
there's a new Transport per client, we should allow a single host to use
all the idle connections.

A CT Log operator has notified us we're churning a lot of connections.
This should significantly help.

We might want to make the value configurable, instead of just using the
default value, but that can always come later if needed.
2024-03-04 13:48:10 -05:00
orangepizza c2fe5f5d7c
expiry mailer : typo fix (#7348)
makes linter happy: not sure why 7 year old typo starts to hit by linter
nowdays though
not sure why github CI can't catch this but running t.sh locally marks
this as typo: (and it is)
2024-03-04 13:35:08 -05:00
Samantha a97e074b5a
WFE/ARI: Add method for tracking certificate replacement (#7298)
Implement draft-ietf-acme-ari-02 changes in WFE newOrder:
- Add a `replaces` field to the newOrder request object
- Ensure that `replaces` values provided by subscribers are vetted
according to the requirements set out in the draft specification
- When a NewOrder request falls inside the suggested RenewalWindow,
exempt from rate limits in the WFE and indicate exemption in the RA
NewOrder request

Part of #7038
2024-02-26 16:47:08 -05:00
dependabot[bot] 34b705f293
build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.48.0 to 1.50.2 (#7333)
Bumps
[github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2)
from 1.48.0 to 1.50.2.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:31:30 -05:00
Matthew McPherrin 313e3b93ba
Add DNSStaticResolver option (#7336)
We run the RVAs in AWS, where we don't have all the same service
discovery infrastructure we do for the primary VAs and the rest of
Boulder. The solution for populating SRV records we have today hasn't
been reliable, so we'd like to experiment with bringing up RVAs paired
1:1 with a local DNS resolver. This brings back some of the previous
static DNS resolver configuration, though it's not a clean revert
because other configuration has changed in the meantime
2024-02-23 14:45:01 -08:00
Matthew McPherrin 96f1240603
Update publicsuffix-go (#7334) 2024-02-21 17:51:26 -05:00
Samantha 4eb5e3caa2
ratelimits: Fetch correct limit when building transaction (#7330)
Fix copy-paste that lead to the wrong rate limit retrieved for some
transactions.
2024-02-16 15:01:01 -05:00