Commit Graph

4361 Commits

Author SHA1 Message Date
Roland Bracewell Shoemaker dad6cc0095 Send precerts to informational logs if feature is enabled (#3568)
Send precerts to informational logs if feature is enabled and log errors from submissions to informational logs.
2018-03-16 15:42:34 -04:00
Daniel McCarney 52dc5dc071
Ensure V1 pending authzs are not reused for V2 orders. (#3566)
This commit fixes `sa.GetAuthorizations` to ensure that both the valid
**and** the pending authorizations it finds for reuse by `ra.NewOrder`
are required to have rows in the order authz join table.

The `sa.GetAuthorizations` unit test is updated to ensure we test the
expected V2 reuse behaviour is enforced.

Resolves https://github.com/letsencrypt/boulder/issues/3565
2018-03-16 13:40:25 -04:00
Roland Bracewell Shoemaker 459a9036f6 Add integration test for wfe2 OnlyReturnExisting (#3555)
Fixes #3512.
2018-03-15 14:04:46 -07:00
Jacob Hoffman-Andrews d8fa5ba222
Automatically run all integration test cases (#3564)
Previously, each time we defined a new test case in integration-test.py, we had to explicitly call it.
This made it easy to leave out cases without realizing it. After this change, we will automatically
find all functions named "test_" and call them. As a result, I found that we weren't calling
`test_revoked_by_account`, and it was failing. So I fixed it as part of this PR.

Fixes #3518
2018-03-15 13:42:51 -07:00
Jacob Hoffman-Andrews 0a517aa9c0
Remove config-next gating on v2 and wildcard features (#3563)
Also, move the last of the v2 migrations from db-next into db.
2018-03-15 13:14:25 -07:00
Jacob Hoffman-Andrews 65b88a8dbc Run certlint in cert-checker (#3550)
This pulls in the certlint dependency, which in turn pulls in publicsuffix as a dependency.

Fixes #3549
2018-03-15 17:42:58 +00:00
Jacob Hoffman-Andrews 2093337fb9 Fix whitespace 2018-03-15 10:34:15 -07:00
Jacob Hoffman-Andrews 5a2f715413 Ungate a little extra. 2018-03-14 18:37:25 -07:00
Daniel McCarney 7e5f22dd8d Allow Content-Type header in V2 CORS. (#3559)
We are soon enforcing that V2 POST requests have a `Content-Type` of
`application/jose+json` to match ACME specification requirement. For
CORS this requires adding the `Content-Type` to the
`Access-Control-Allow-Headers` CORS field because the JOSE content type
is not one that can be used by a "simple header" whitelisted by default.

This commit adds `Access-Control-Allow-Headers: Content-Type` where
required and updates unit tests accordingly.
2018-03-14 15:32:22 -07:00
Jacob Hoffman-Andrews 59c7c9f54f Goimports. 2018-03-14 14:52:02 -07:00
Jacob Hoffman-Andrews 4a961c3bc8 Ungate config-next for wfe2 and Wildcards. 2018-03-14 13:18:37 -07:00
Jacob Hoffman-Andrews 700604dda1
Overlapping wildcard errors are 400, not 500. (#3561)
Return a malformed error for these requests. Also add an integration test.

Fixes #3558
2018-03-14 13:18:25 -07:00
Daniel McCarney 5172f03865
Enable WFE2 "EnforceV2ContentType" flag in config-next. (#3562)
We shipped this feature flag disabled because at the time Certbot's acme
module had a bug with revocation that sent the wrong content-type. That
has been fixed upstream and the current boulder-tools image has the fix.
We should be able to turn this flag on now for config-next without
breaking tests.
2018-03-14 16:09:58 -04:00
Daniel McCarney e00ed50cc3 Fix nil panic in mailer logger setup when DB conn fails. (#3545)
Prior to this commit, if the expiration-mailer database configuration is
invalid, or the database is unreachable,
`cmd/expiration-mailer/main.go`'s `main()` function tries to call
`sa.SetSQLDebug(dbMap, logger)` before erroring from the DB
initialization failure. This causes a nil panic.

This commit changes the order of two lines such that `sa.SetSQLDebug` is
only called when there was no db setup error.
2018-03-12 13:46:13 -07:00
Jacob Hoffman-Andrews d44afa6268 Speed up nonce service. (#3544)
The service used to do a linear scan for the lowest counter value in its
cross-off list, in order to expire that value. This took about 3ms. I added a
heap to make finding the lowest value more efficient. Now, redeeming a nonce
takes about 3μs.

```
benchmark             old ns/op     new ns/op     delta
BenchmarkNonces-4     1597950       5100          -99.68%
```

Fixes #1219.
2018-03-12 15:46:20 -04:00
Roland Bracewell Shoemaker 9c9e944759 Add SCT embedding (#3521)
Adds SCT embedding to the certificate issuance flow. When a issuance is requested a precertificate (the requested certificate but poisoned with the critical CT extension) is issued and submitted to the required CT logs. Once the SCTs for the precertificate have been collected a new certificate is issued with the poison extension replace with a SCT list extension containing the retrieved SCTs.

Fixes #2244, fixes #3492 and fixes #3429.
2018-03-12 11:58:30 -07:00
Daniel McCarney 6ad718a42e
Increase the MySQL container `max_connections`. (#3543)
By default the MariaDB/MySQL container starts with a global max
connections limit of 100. The SA is configured in `test/config` and
`test/config-next` to use 100 connections. This doesn't leave any
overhead for `ocsp-updater` connections and can be reached under load
pretty easily.

This commit adjusts the global max connections setting from
`test/create_db.sh`, setting it to a more generous `500` instead of the
default `100`.
2018-03-10 16:05:52 -05:00
Jacob Hoffman-Andrews 0dc185c6b8 Add cumulative nanoseconds for nonce scan. (#3538)
This will make it easier to calculate what fraction of the time we
expect to block on this.
2018-03-10 07:07:16 +00:00
Jacob Hoffman-Andrews 78379bfced Force challenge status to be equal to authz status (#3541)
This is in general the case, but occasionally when there are two inflight validations for
a challenge at once, the authz can get marked invalid while leaving the challenge
"pending". For clients that poll the challenge instead of the authz this can lead to infinite
polling. To stop those clients, we just ensure the challenge status is consistent with its
authorization object.

Fixes #3493.
2018-03-10 07:06:27 +00:00
Jacob Hoffman-Andrews c621cbd33f Reject overlaps with wildcards. (#3542)
Requesting a certificate with "*.example.com" and "www.example.com" as
separate SANs doesn't make sense, because "www.example.com" is covered
by the wildcard.

#3524
2018-03-10 06:49:36 +00:00
Jacob Hoffman-Andrews 687ab5722b
Allow publisher/ct-test-serv to work with precerts (#3537)
`boulder-publisher` and `ct-test-serv` make a number of assumptions about _what_ is
being submitted to a CT log (mainly that it's always a plain certificate) which prevents
proper submission of precertificates and verification/usage of the returned SCTs.

This change adds the ability for the publisher to submit both normal certificates and
precertificates and verify the returned SCTs. This change also adds the ability for
`ct-test-serv` to accept `/ct/v1/add-pre-chain` submissions and create correct SCTs
for precert entry types.
2018-03-09 10:03:47 -08:00
Roland Bracewell Shoemaker 28303e1896 Documentation + simplify signature verification 2018-03-09 15:45:58 +00:00
Roland Bracewell Shoemaker f0e0025143 Extend publisher unittest to cover precert submission/validation 2018-03-09 13:59:32 +00:00
Jacob Hoffman-Andrews 11434650b7 Check safe browsing at validation time (#3539)
Right now we check safe browsing at new-authz time, which introduces a possible
external dependency when calling new-authz. This is usually fine, since most safe
browsing checks can be satisfied locally, but when requests have to go external,
it can create variance in new-authz timing.

Fixes #3491.
2018-03-09 11:15:05 +00:00
Jacob Hoffman-Andrews d654675223 Remove BaseURL from WFE config. (#3540)
For a long time now the WFE has generated URLs based on the incoming
request rather than a hardcoded BaseURL. BaseURL is no longer set in the
prod configs.

This also allows factoring out relativeEndpoint into the web package.
2018-03-09 11:04:02 +00:00
Roland Bracewell Shoemaker 76be5d70e7 Update github.com/cloudflare/cfssl (#3536)
Pulls in SCT list serialization fix, unblocks #3521.

```
ok  	github.com/cloudflare/cfssl/api/client	1.137s	coverage: 52.2% of statements
ok  	github.com/cloudflare/cfssl/api/crl	1.110s	coverage: 75.0% of statements
ok  	github.com/cloudflare/cfssl/api/gencrl	1.062s	coverage: 72.5% of statements
ok  	github.com/cloudflare/cfssl/api/generator	1.304s	coverage: 33.3% of statements
ok  	github.com/cloudflare/cfssl/api/info	1.133s	coverage: 84.1% of statements
ok  	github.com/cloudflare/cfssl/api/initca	1.068s	coverage: 90.5% of statements
ok  	github.com/cloudflare/cfssl/api/ocsp	1.152s	coverage: 93.8% of statements
ok  	github.com/cloudflare/cfssl/api/revoke	2.574s	coverage: 75.0% of statements
ok  	github.com/cloudflare/cfssl/api/scan	2.885s	coverage: 62.1% of statements
ok  	github.com/cloudflare/cfssl/api/sign	3.188s	coverage: 83.3% of statements
ok  	github.com/cloudflare/cfssl/api/signhandler	1.179s	coverage: 26.3% of statements
ok  	github.com/cloudflare/cfssl/auth	1.012s	coverage: 68.2% of statements
ok  	github.com/cloudflare/cfssl/bundler	15.700s	coverage: 84.5% of statements
ok  	github.com/cloudflare/cfssl/certdb/dbconf	1.016s	coverage: 84.2% of statements
ok  	github.com/cloudflare/cfssl/certdb/ocspstapling	1.415s	coverage: 69.2% of statements
ok  	github.com/cloudflare/cfssl/certdb/sql	1.248s	coverage: 70.5% of statements
ok  	github.com/cloudflare/cfssl/cli	1.013s	coverage: 61.9% of statements
ok  	github.com/cloudflare/cfssl/cli/bundle	1.012s	coverage: 0.0% of statements [no tests to run]
ok  	github.com/cloudflare/cfssl/cli/crl	1.091s	coverage: 57.8% of statements
ok  	github.com/cloudflare/cfssl/cli/gencert	11.960s	coverage: 83.6% of statements
ok  	github.com/cloudflare/cfssl/cli/gencrl	1.089s	coverage: 73.3% of statements
ok  	github.com/cloudflare/cfssl/cli/gencsr	1.064s	coverage: 70.3% of statements
ok  	github.com/cloudflare/cfssl/cli/genkey	6.415s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/cli/ocsprefresh	1.060s	coverage: 64.3% of statements
ok  	github.com/cloudflare/cfssl/cli/revoke	1.033s	coverage: 88.2% of statements
ok  	github.com/cloudflare/cfssl/cli/scan	1.013s	coverage: 36.0% of statements
ok  	github.com/cloudflare/cfssl/cli/selfsign	2.029s	coverage: 73.2% of statements
ok  	github.com/cloudflare/cfssl/cli/serve	1.073s	coverage: 39.0% of statements
ok  	github.com/cloudflare/cfssl/cli/sign	1.054s	coverage: 54.8% of statements
ok  	github.com/cloudflare/cfssl/cli/version	1.012s	coverage: 100.0% of statements
ok  	github.com/cloudflare/cfssl/cmd/cfssl	1.036s	coverage: 0.0% of statements [no tests to run]
ok  	github.com/cloudflare/cfssl/cmd/cfssljson	1.018s	coverage: 3.4% of statements
ok  	github.com/cloudflare/cfssl/cmd/mkbundle	1.012s	coverage: 0.0% of statements [no tests to run]
ok  	github.com/cloudflare/cfssl/config	1.029s	coverage: 67.7% of statements
ok  	github.com/cloudflare/cfssl/crl	1.056s	coverage: 68.3% of statements
ok  	github.com/cloudflare/cfssl/csr	31.882s	coverage: 89.6% of statements
ok  	github.com/cloudflare/cfssl/errors	1.016s	coverage: 79.6% of statements
ok  	github.com/cloudflare/cfssl/helpers	1.251s	coverage: 82.8% of statements
ok  	github.com/cloudflare/cfssl/helpers/testsuite	6.974s	coverage: 65.8% of statements
ok  	github.com/cloudflare/cfssl/initca	207.580s	coverage: 73.2% of statements
ok  	github.com/cloudflare/cfssl/log	1.010s	coverage: 59.3% of statements
ok  	github.com/cloudflare/cfssl/multiroot/config	1.161s	coverage: 77.4% of statements
ok  	github.com/cloudflare/cfssl/ocsp	1.230s	coverage: 77.4% of statements
ok  	github.com/cloudflare/cfssl/revoke	1.336s	coverage: 77.9% of statements
ok  	github.com/cloudflare/cfssl/scan	1.016s	coverage: 1.1% of statements
ok  	github.com/cloudflare/cfssl/selfsign	1.059s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/signer	1.014s	coverage: 19.4% of statements
ok  	github.com/cloudflare/cfssl/signer/local	3.355s	coverage: 77.9% of statements
ok  	github.com/cloudflare/cfssl/signer/remote	2.371s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/signer/universal	2.163s	coverage: 67.7% of statements
ok  	github.com/cloudflare/cfssl/transport	1.012s
ok  	github.com/cloudflare/cfssl/transport/ca/localca	1.043s	coverage: 94.9% of statements
ok  	github.com/cloudflare/cfssl/transport/core	1.030s	coverage: 90.9% of statements
ok  	github.com/cloudflare/cfssl/transport/kp	1.032s	coverage: 37.1% of statements
ok  	github.com/cloudflare/cfssl/ubiquity	1.034s	coverage: 88.3% of statements
ok  	github.com/cloudflare/cfssl/whitelist	2.879s	coverage: 100.0% of statements
```
2018-03-08 14:31:42 -05:00
Daniel McCarney 3062662aad ACMEv2: Enforce POST Content-Type (when feature on) (#3532)
This commit adds a new WFE2 feature flag "EnforceV2ContentType". When
enabled, the WFE2's validPostRequest function will enforce that the
request carries a Content-Type header equal to
application/jose+json. This is required by ACME draft-10 per section
6.2 "Request Authentication".

This is behind a feature flag because it is likely to break
some number of existing ACMEv2 clients that may not be sending the
correct Content-Type.

We are defaulting to not setting the new feature flag in test/config-next
because it currently break's Certbot's acme module's revocation support
and we rely on this in our V2 integration tests.

Resolves #3529
2018-03-08 18:19:53 +00:00
Jacob Hoffman-Andrews 5c4f5e346a Fix pprof handlers. (#3533)
Some of the pprof handlers have to be accessed through
pprof.Handler("string"), while some have to be accessed through an
exported var in pprof. We weren't doing the latter before, which meant
some key handlers like Profile weren't available.
2018-03-08 18:18:13 +00:00
Jacob Hoffman-Andrews c8ee2a1719 Fix error logging in issueCertificate. (#3534)
The logEvent setup we had in issueCertificate depending on all error
handling code setting logEvent.Error in addition to returning the error.
Since this is not the common pattern in Go, there were a few places
where logEvent.Error wasn't set, making it hard to find the root cause
of errors in the RA logs (though the errors would get propagated to the
WFE for logging). This change wraps issueCertificate such that all
errors returned get logged.
2018-03-08 18:16:54 +00:00
Jacob Hoffman-Andrews c4607bac52 Update boulder-tools to new version. (#3535)
This pulls in an updated Certbot repo with a fix to content-type for the
revoke method.

Also, adds a convenience replacement in tag_and_release.sh to update
docker-compose.yml.
2018-03-08 18:14:58 +00:00
Roland Bracewell Shoemaker 7077740875 Add precert submission changes to ct-test-serv and boulder-publisher 2018-03-08 02:46:26 +00:00
Jacob Hoffman-Andrews b82c06d874 Update go-jose to 2.1.4 (#3531)
This pulls in an upstream change that allows us to reference the Protected
header separately from the unprotected one (confusingly just called Header).

$ go test gopkg.in/square/go-jose.v2/...
ok      gopkg.in/square/go-jose.v2      16.625s
ok      gopkg.in/square/go-jose.v2/cipher       0.004s
?       gopkg.in/square/go-jose.v2/jose-util    [no test files]
ok      gopkg.in/square/go-jose.v2/json 2.080s
?       gopkg.in/square/go-jose.v2/jwk-keygen   [no test files]
ok      gopkg.in/square/go-jose.v2/jwt  0.128s
2018-03-07 17:41:17 +00:00
Daniel McCarney 2612bf7168 Remove deprecated `sa.CountPendingOrders` cruft. (#3527)
#3501 made this code deprecated. We've deployed 3501 to the staging environment and can now pull out the old cruft.

Resolves #3502
2018-03-06 21:20:40 +00:00
Roland Bracewell Shoemaker 66695c0727 Update github.com/cloudflare/cfssl (#3528)
```
 roland@catbus  ~/code/go/src/github.com/cloudflare/cfssl   master  ./test.sh
BUILDING.md		Gopkg.toml		certdb			crl			helpers			revoke			test.sh
CHANGELOG		LICENSE			certinfo		crypto			info			scan			testdata
Dockerfile		README.md		cli			csr			initca			script			transport
Dockerfile.build	api			cmd			doc			log			selfsign		ubiquity
Dockerfile.minimal	auth			config			errors			multiroot		signer			vendor
Gopkg.lock		bundler			coverprofile.txt	gopath			ocsp			test.prof		whitelist
ok  	github.com/cloudflare/cfssl/api	1.043s	coverage: 81.1% of statements
ok  	github.com/cloudflare/cfssl/api/bundle	1.570s	coverage: 87.2% of statements
ok  	github.com/cloudflare/cfssl/api/certadd	12.607s	coverage: 86.8% of statements
ok  	github.com/cloudflare/cfssl/api/client	1.070s	coverage: 52.2% of statements
ok  	github.com/cloudflare/cfssl/api/crl	1.107s	coverage: 75.0% of statements
ok  	github.com/cloudflare/cfssl/api/gencrl	1.057s	coverage: 72.5% of statements
ok  	github.com/cloudflare/cfssl/api/generator	1.262s	coverage: 33.3% of statements
ok  	github.com/cloudflare/cfssl/api/info	1.102s	coverage: 84.1% of statements
ok  	github.com/cloudflare/cfssl/api/initca	1.073s	coverage: 90.5% of statements
ok  	github.com/cloudflare/cfssl/api/ocsp	1.116s	coverage: 93.8% of statements
ok  	github.com/cloudflare/cfssl/api/revoke	2.923s	coverage: 75.0% of statements
ok  	github.com/cloudflare/cfssl/api/scan	17.178s	coverage: 62.1% of statements
ok  	github.com/cloudflare/cfssl/api/sign	2.221s	coverage: 83.3% of statements
ok  	github.com/cloudflare/cfssl/api/signhandler	1.145s	coverage: 26.3% of statements
ok  	github.com/cloudflare/cfssl/auth	1.022s	coverage: 68.2% of statements
ok  	github.com/cloudflare/cfssl/bundler	14.899s	coverage: 84.5% of statements
ok  	github.com/cloudflare/cfssl/certdb/dbconf	1.040s	coverage: 84.2% of statements
ok  	github.com/cloudflare/cfssl/certdb/ocspstapling	1.283s	coverage: 69.2% of statements
ok  	github.com/cloudflare/cfssl/certdb/sql	1.092s	coverage: 70.5% of statements
ok  	github.com/cloudflare/cfssl/cli	1.036s	coverage: 61.9% of statements
ok  	github.com/cloudflare/cfssl/cli/bundle	1.034s	coverage: 0.0% of statements [no tests to run]
ok  	github.com/cloudflare/cfssl/cli/crl	1.106s	coverage: 57.8% of statements
ok  	github.com/cloudflare/cfssl/cli/gencert	6.106s	coverage: 83.6% of statements
ok  	github.com/cloudflare/cfssl/cli/gencrl	1.081s	coverage: 73.3% of statements
ok  	github.com/cloudflare/cfssl/cli/gencsr	1.075s	coverage: 70.3% of statements
ok  	github.com/cloudflare/cfssl/cli/genkey	2.903s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/cli/ocsprefresh	1.074s	coverage: 64.3% of statements
ok  	github.com/cloudflare/cfssl/cli/revoke	1.054s	coverage: 88.2% of statements
ok  	github.com/cloudflare/cfssl/cli/scan	1.032s	coverage: 36.0% of statements
ok  	github.com/cloudflare/cfssl/cli/selfsign	2.429s	coverage: 73.2% of statements
ok  	github.com/cloudflare/cfssl/cli/serve	1.172s	coverage: 39.0% of statements
ok  	github.com/cloudflare/cfssl/cli/sign	1.058s	coverage: 54.8% of statements
ok  	github.com/cloudflare/cfssl/cli/version	1.028s	coverage: 100.0% of statements
ok  	github.com/cloudflare/cfssl/cmd/cfssl	1.196s	coverage: 0.0% of statements [no tests to run]
ok  	github.com/cloudflare/cfssl/cmd/cfssljson	1.031s	coverage: 3.4% of statements
ok  	github.com/cloudflare/cfssl/cmd/mkbundle	1.032s	coverage: 0.0% of statements [no tests to run]
ok  	github.com/cloudflare/cfssl/config	1.054s	coverage: 67.7% of statements
ok  	github.com/cloudflare/cfssl/crl	1.072s	coverage: 68.3% of statements
ok  	github.com/cloudflare/cfssl/csr	20.657s	coverage: 89.6% of statements
ok  	github.com/cloudflare/cfssl/errors	1.029s	coverage: 79.6% of statements
ok  	github.com/cloudflare/cfssl/helpers	1.225s	coverage: 82.8% of statements
ok  	github.com/cloudflare/cfssl/helpers/testsuite	6.558s	coverage: 65.8% of statements
ok  	github.com/cloudflare/cfssl/initca	81.870s	coverage: 73.2% of statements
ok  	github.com/cloudflare/cfssl/log	1.019s	coverage: 59.3% of statements
ok  	github.com/cloudflare/cfssl/multiroot/config	1.190s	coverage: 77.4% of statements
ok  	github.com/cloudflare/cfssl/ocsp	1.226s	coverage: 77.4% of statements
ok  	github.com/cloudflare/cfssl/revoke	1.832s	coverage: 77.9% of statements
ok  	github.com/cloudflare/cfssl/scan	1.042s	coverage: 1.1% of statements
ok  	github.com/cloudflare/cfssl/selfsign	1.073s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/signer	1.030s	coverage: 19.4% of statements
ok  	github.com/cloudflare/cfssl/signer/local	3.171s	coverage: 78.1% of statements
ok  	github.com/cloudflare/cfssl/signer/remote	2.197s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/signer/universal	2.061s	coverage: 67.7% of statements
ok  	github.com/cloudflare/cfssl/transport	1.031s
ok  	github.com/cloudflare/cfssl/transport/ca/localca	1.062s	coverage: 94.9% of statements
ok  	github.com/cloudflare/cfssl/transport/core	1.054s	coverage: 90.9% of statements
ok  	github.com/cloudflare/cfssl/transport/kp	1.059s	coverage: 37.1% of statements
ok  	github.com/cloudflare/cfssl/transport/roots/system	1.384s	coverage: 77.1% of statements
ok  	github.com/cloudflare/cfssl/ubiquity	1.057s	coverage: 88.3% of statements
ok  	github.com/cloudflare/cfssl/whitelist	2.060s	coverage: 100.0% of statements
```
2018-03-06 12:44:57 -08:00
Daniel McCarney 49d55d9ab5 Make POSTing KeyAuthorization optional, V2 don't echo it. (#3526)
This commit updates the RA to make the notion of submitting
a KeyAuthorization value as part of the ra.UpdateAuthorization call
optional. If set, the value is enforced against expected and an error is
returned if the provided authorization isn't correct. If it isn't set
the RA populates the field with the computed authorization for the VA to
enforce against the value it sees in challenges. This retains the legacy
behaviour of the V1 API. The V2 API will never unmarshal a provided
key authorization.

The ACMEv2/WFEv2 prepChallengeForDisplay function is updated to strip
the ProvidedKeyAuthorization field before sending the challenge object
back to a client. ACMEv1/WFEv1 continue to return the KeyAuthorization
in challenges to avoid breaking clients that are relying on this legacy
behaviour.

For deployability ease this commit retains the name of the
core.Challenge.ProvidedKeyAuthorization field even though it should
be called core.Challenge.ComputedKeyAuthorization now that it isn't
set based on the client's provided key authz. This will be easier as
a follow-up change.

Resolves #3514
2018-03-06 20:33:01 +00:00
Daniel McCarney 5f605167e1 Size V2 newOrder requests randomly. (#3523)
Prior to this commit all of the `newOrder` requests generated by the
load generator had 1 DNS type identifier. In this commit the
`maxNamesPerCert` parameter that was present in the codebase is fixed
(it was never wired through to config before) and used to size the
orders randomly. Each order will have between 1 and `maxNamesPerCert`
identifiers.

For integration testing we set this at 20. 100 would be more realistic
but we'll start small for now.
2018-03-05 14:10:05 -08:00
Daniel McCarney 8954a07a49 Bump Travis to use Go 1.10 (#3522) 2018-03-05 13:38:10 -08:00
Daniel McCarney 531d9ce52c
Run load-generator against V1 and V2 API in CI. (#3509)
This commit adds short 15s runs of the load generator against the V1 and
V2 APIs during the three integration test runs (v1 config, v1
config-next, and v2). 15s was selected because 30s caused too much
output and the build log to be truncated.

Presently the latency output is *not* being checked for errors. This was
too flaky in practice.

A fix for a race condition in the load-generator code itself related to
HTTP status code tracking is included in this commit.

The pending authz rate limit also needed to be adjusted to keep the
load-generator from failing requests after hitting 429s.
2018-03-05 15:34:15 -05:00
Jacob Hoffman-Andrews 2d1d895da1
Copy authz.challenges to fix data race. (#3520)
This race was uncovered by running the load generator as part of our CI.

Also, update ra_test.go. It was previously testing that the returned authz
and the stored authz should be identical, which is not actually a property
of UpdateAuthorization; in general, they will not be identical.
2018-03-03 09:19:56 -08:00
Daniel McCarney fded62c183
Increase default order rate limit (#3519) 2018-03-02 15:15:29 -05:00
Daniel McCarney 28cc969814 Remove TLS-SNI-02 implementation. (#3516)
This code was never enabled in production. Our original intent was to
ship this as part of the ACMEv2 API. Before that could happen flaws were
identified in TLS-SNI-01|02 that resulted in TLS-SNI-02 being removed
from the ACME protocol. We won't ever be enabling this code and so we
might as well remove it.
2018-03-02 10:56:13 -08:00
Jacob Hoffman-Andrews 5d1a3bbf36 Copy authz for goroutine in RA. (#3508)
There's a minor data race in UpdateAuthorization where the authorization can
be changed in the goroutine concurrently with returning it. This fixes it by
copying the authorization as an argument to the goroutine.

Fixes #3506.
2018-03-02 10:52:24 -08:00
Daniel McCarney f2d3ad6d52 Enforce new orders per acct per window rate limit. (#3501)
Previously we introduced the concept of a "pending orders per account
ID" rate limit. After struggling with making an implementation of this
rate limit perform well we reevaluated the problem and decided a "new
orders per account per time window" rate limit would be a better fit for
ACMEv2 overall.

This commit introduces the new newOrdersPerAccount rate limit. The RA
now checks this before creating new pending orders in ra.NewOrder. It
does so after order reuse takes place ensuring the rate limit is only
applied in cases when a distinct new pending order row would be created.
To accomplish this a migration for a new orders field (created) and an
index over created and registrationID is added. It would be possible to
use the existing expires field for this like we've done in the past, but that
was primarily to avoid running a migration on a large table in prod. Since
we don't have that problem yet for V2 tables we can Do The Right Thing
and add a column.

For deployability the deprecated pendingOrdersPerAccount code & SA
gRPC bits are left around. A follow-up PR will be needed to remove
those (#3502).

Resolves #3410
2018-03-02 10:47:39 -08:00
Daniel McCarney 6f3b5a5726 Fix outdated IDN comment on `pa.WillingToIssue`. (#3511)
Prior to this commit the comment on `pa.WillingToIssue` incorrectly
asserted that the input domain must not contain IDN labels. That's not
true anymore! 🎉
2018-03-02 10:25:06 -08:00
Jacob Hoffman-Andrews edac482aeb publisher: Don't count cancellations as errors. (#3507)
Fixes #3504
2018-03-01 14:10:21 -08:00
Daniel McCarney ef6dbed39d Treat orders with expired authzs as invalid. (#3500)
This commit updates `sa.getAllOrderAuthorizations` to not exclude
expired authorizations. The expired authorizations are used in
`sa.statusForOrder` to set the overall order status to invalid when one
or more authorizations are expired.

Fixes #3499
2018-03-01 10:26:46 -08:00
Jacob Hoffman-Andrews 3568ad29ea Turn CT failures into hard failures in RA. (#3496)
When we originally deployed the inline CT submission code, we wanted to
be conservative in case it increased our issuance error rate. However,
we've established that the success rate is quite good, so we'll remove
some complexity and make things more realistic by removing the code that
avoids returning errors when CT submission fails.
2018-02-28 15:22:10 -08:00
Jacob Hoffman-Andrews 6b8b6a37c0 Update chisel2 and boulder-tools (#3495)
This change updates boulder-tools to use Go 1.10, and references a
newly-pushed image built using that new config.

Since boulder-tools pulls in the latest Certbot master at the time of
build, this also pulls in the latest changes to Certbot's acme module,
which now supports ACME v2. This means we no longer have to check out
the special acme-v2-integration branch in our integration tests.

This also updates chisel2.py to reflect some of the API changes that
landed in the acme module as it was merged to master.

Since we don't need additional checkouts to get the ACMEv2-compatible
version of the acme module, we can include it in the default RUN set for
local tests.
2018-02-28 15:21:40 -08:00
Jacob Hoffman-Andrews eb23cb3ffc Remove "Terminated request" / "Successful request" (#3484)
The WFE logs these with every request, but with #3483,
they aren't necessary; everything other than 2xx is a failed request.
2018-02-28 15:16:36 -08:00
Jacob Hoffman-Andrews 8cf8c44919 Change finalize order path (#3480)
This puts puts the path for order finalization at the beginning of the URL, rather than the end, making it easier to generate stats about. It also allows us to split out GetOrder and FinalizeOrder from the previous "Order" function that combined some unrelated code.

Fixes #3440 
Fixes #3439 (order finalization now has its own stats like the other endpoints do)
2018-02-28 09:50:12 -05:00