Commit Graph

42 Commits

Author SHA1 Message Date
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 e5a2c1abc9 Simplify docker-compose by eliminating build step. (#3497)
We have a Dockerfile that builds off of boulder-tools, but does
basically nothing. Removing it saves a build step and avoids some
hard-to-diagnose edge cases.

This change triggered an issue with the "prom" container and
"docker-compose up", saying that prom can't be linked to a not-running
container. Since we rarely use prom in dev/test, I'm removing it for
now. The nice, futuristic way to get containers to talk to each other is
with docker networking, so we can bring it back with a switch to docker
networking in the future if we want.
2018-02-28 09:42:57 -05:00
Jacob Hoffman-Andrews 8261d60ff9 Bump Go version and push new Docker image. (#3453)
Also, move the installation of `mock/model` above the removal of junk
directories; otherwise we get a "getcwd: no such file or directory"
error.
2018-02-16 09:27:19 -05:00
Jacob Hoffman-Andrews af0bd70196
Update boulder-tools version. (#3294)
Also update chisel.py to refer to josepy, and update featureflag_string.go based on latest stringer.

Fixes #3289
2017-12-21 10:36:04 -08:00
Robert Kästel 60ca8febb3 Pin version of Prometheus to 1.8.2 (#3230)
Pin version of Prometheus to `1.8.2` because Prometheus folks has just released v2 and switched the `:latest` tag to that.

Using Prometheus v2 produces an error:

     prometheus: error: unknown short flag '-c'
2017-11-09 09:03:12 -05:00
Jacob Hoffman-Andrews 84eaf49352 Update to Go 1.9.1 (#3153)
Update the boulder-tools Docker image, and switch to the new tag.
2017-10-06 09:38:49 -04:00
Roland Bracewell Shoemaker e91349217e Switch to using go 1.9 (#3047)
* Switch to using go 1.9

* Regenerate with 1.9

* Manually fix import path...

* Upgrade mockgen and regenerate

* Update github.com/golang/mock
2017-09-06 16:30:13 -04:00
Daniel McCarney bd3e2747ba Duplicate WFE to WFE2. (#2839)
This PR is the initial duplication of the WFE to create a WFE2
package. The rationale is briefly explained in `wfe2/README.md`.

Per #2822 this PR only lays the groundwork for further customization
and deduplication. Presently both the WFE and WFE2 are identical except
for the following configuration differences:

* The WFE offers HTTP and HTTPS on 4000 and 4430 respectively, the WFE2
  offers HTTP on 4001 and 4431.
* The WFE has a debug port on 8000, the WFE2 uses the next free "8000
  range port" and puts its debug service on 8013

Resolves https://github.com/letsencrypt/boulder/issues/2822
2017-07-05 13:32:45 -07:00
Brad Warren ee2f88a2e4 Use Docker Compose version 2 format (#2834)
After talking to @jsha, this updates Boulder's docker-compose.yml to version 2. I'm currently working on moving some Certbot tests from EC2 to Docker and this allows me to take advantage of networking features like embedded DNS which is used by default in newer versions of Docker Compose.

This shouldn't change any behavior of the file. One notable thing is I had to add network_mode: bridge to the bhsm service. I don't believe this is a change in behavior though since bhsm was included in the links section for boulder
2017-06-26 10:29:47 -04:00
Roland Bracewell Shoemaker 8fe0697b9a Bump golang version to 1.8.3 (#2787) 2017-05-25 17:01:31 -07:00
Roland Shoemaker 0131a96a71 Dockerfile/docker-compose.yml cleanups 2017-04-14 14:59:31 -07:00
Roland Bracewell Shoemaker a46d30945c Purge remaining AMQP code (#2648)
Deletes github.com/streadway/amqp and the various RabbitMQ setup tools etc. Changes how listenbuddy is used to proxy all of the gRPC client -> server connections so we test reconnection logic.

+49 -8,221 😁

Fixes #2640 and #2562.
2017-04-04 15:02:22 -07:00
Jacob Hoffman-Andrews f4c11a673c Revert BOULDER_CONFIG_DIR to test/config. (#2644)
This was accidentally changed in
https://github.com/letsencrypt/boulder/pull/2634/, and broke Certbot's tests.

This also includes an update to chisel that fetches the certificate chain, which
would have caught this error.
2017-04-03 17:29:51 -07:00
Roland Bracewell Shoemaker 08f4dda038 Update github.com/grpc-ecosystem/go-grpc-prometheus and google.golang.org/grpc (#2637)
Updates the various gRPC/protobuf libs (google.golang.org/grpc/... and github.com/golang/protobuf/proto) and the boulder-tools image so that we can update to the newest github.com/grpc-ecosystem/go-grpc-prometheus. Also regenerates all of the protobuf definition files.

Tests run on updated packages all pass.

Unblocks #2633 fixes #2636.
2017-04-03 11:13:48 -07:00
Jacob Hoffman-Andrews 6719dc17a6 Remove AMQP config and code (#2634)
We now use gRPC everywhere.
2017-04-03 10:39:39 -04:00
David Calavera 0d1cc66cab
Update to Go 1.8.0.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-02-21 10:57:57 +01:00
Jacob Hoffman-Andrews 1b994083ba Use latest Certbot in boulder-tools. (#2554)
This allows us to iterate more easily against the current acme module.

Also, remove nodejs from boulder-tools, clean up a few packages that weren't
previously cleaned up, and install a specific version of protoc-gen-go to match
our vendored grpc.
2017-02-09 16:10:01 -08:00
Patrick Figel 6ba8aadfd7 Use X.509 AIA Issuer URL in rel="up" link header (#2545)
In order to provide the correct issuer certificate for older certificates after an issuer certificate rollover or when using multiple issuer certificates (e.g. RSA and ECDSA), use the AIA CA Issuer URL embedded in the certificate for the rel="up" link served by WFE. This behaviour is gated behind the UseAIAIssuerURL feature, which defaults to false.

To prevent MitM vulnerabilities in cases where the AIA URL is HTTP-only, it is upgraded to HTTPS.

This also adds a test for the issuer URL returned by the /acme/cert endpoint. wfe/test/178.{crt,key} were regenerated to add the AIA extension required to pass the test.

/acme/cert was changed to return an absolute URL to the issuer endpoint (making it consistent with /acme/new-cert).

Fixes #1663
Based on #1780
2017-02-07 11:19:22 -08:00
Daniel McCarney 15e73edc5a Google Safe Browsing V4 Improvements (#2504)
This PR has three primary contributions:

1. The existing code for using the V4 safe browsing API introduced in #2446 had some bugs that are fixed in this PR.
2. A gsb-test-srv is added to provide a mock Google Safebrowsing V4 server for integration testing purposes.
3. A short integration test is added to test end-to-end GSB lookup for an "unsafe" domain.

For 1) most notably Boulder was assuming the new V4 library accepted a directory for its database persistence when it instead expects an existing file to be provided. Additionally the VA wasn't properly instantiating feature flags preventing the V4 api from being used by the VA.

For 2) the test server is designed to have a fixed set of "bad" domains (Currently just honest.achmeds.discount.hosting.com). When asked for a database update by a client it will package the list of bad domains up & send them to the client. When the client is asked to do a URL lookup it will check the local database for a matching prefix, and if found, perform a lookup against the test server. The test server will process the lookup and increment a count for how many times the bad domain was asked about.

For 3) the Boulder startservers.py was updated to start the gsb-test-srv and the VA is configured to talk to it using the V4 API. The integration test consists of attempting issuance for a domain pre-configured in the gsb-test-srv as a bad domain. If the issuance succeeds we know the GSB lookup code is faulty. If the issuance fails, we check that the gsb-test-srv received the correct number of lookups for the "bad" domain and fail if the expected isn't reality.

Notes for reviewers:

* The gsb-test-srv has to be started before anything will use it. Right now the v4 library handles database update request failures poorly and will not retry for 30min. See google/safebrowsing#44 for more information.
* There's not an easy way to test for "good" domain lookups, only hits against the list. The design of the V4 API is such that a list of prefixes is delivered to the client in the db update phase and if the domain in question matches no prefixes then the lookup is deemed unneccesary and not performed. I experimented with sending 256 1 byte prefixes to try and trick the client to always do a lookup, but the min prefix size is 4 bytes and enumerating all possible prefixes seemed gross.
* The test server has a /add endpoint that could be used by integration tests to add new domains to the block list, but it isn't being used presently. The trouble is that the client only updates its database every 30 minutes at present, and so adding a new domain will only take affect after the client updates the database.

Resolves #2448
2017-01-23 11:07:20 -08:00
Jacob Hoffman-Andrews 328589ba0f Add Prometheus to docker-compose. 2017-01-07 13:38:51 -08:00
Jacob Hoffman-Andrews 7e187773b2 Expose more debug ports. (#2471)
Some Boulder services offered debug ports but did not expose them in
docker-compose.yml.
2017-01-06 16:48:25 -05:00
Roland Bracewell Shoemaker 313bc75c05 Switch to Golang 1.7.3 in travis (#2305)
Protobuf files need to be regenerated because (I think) Golang 1.7.3 uses a somewhat different method of ordering fields in a struct when marshaling to bytes.
2016-11-07 10:49:23 -08:00
Jacob Hoffman-Andrews 580c25286a Switch back to go 1.5 in Travis. (#2261)
* Switch back to go 1.5 in Travis.

* Add back GO15VENDOREXPERIMENT.

* Add GO15VENDOREXPERIMENT to Dockerfile

* Revert FAKE_DNS change.

* Revert "Properly close test servers (#2110)"

* Revert "Close VA HTTP test servers (#2111)"

* Change Godep version to 1.5.

* Standardize on issue number
2016-10-20 14:11:26 -04:00
Roland Bracewell Shoemaker 239bf9ae0a Very basic feature flag impl (#1705)
Updates #1699.

Adds a new package, `features`, which exposes methods to set and check if various internal features are enabled. The implementation uses global state to store the features so that services embedded in another service do not each require their own features map in order to check if something is enabled.

Requires a `boulder-tools` image update to include `golang.org/x/tools/cmd/stringer`.
2016-09-20 16:29:01 -07:00
Jacob Hoffman-Andrews 87fee12d6c Improve single-ocsp command (#2181)
Output base64-encoded DER, as expected by ocsp-responder.
Use flags instead of template for Status, ThisUpdate, NextUpdate.
Provide better help.
Remove old test (wasn't run automatically).
Add it to integration test, and use its output for integration test of issuer ocsp-responder.

Add another slot to boulder-tools HSM image, to store root key.
2016-09-15 15:28:54 -07:00
Jacob Hoffman-Andrews 104f409a5e Put PKCS11_PROXY_SOCKET in docker-compose.yml. (#2167) 2016-09-12 09:53:20 -04:00
Roland Bracewell Shoemaker e3266a1684 Switch to Golang 1.6.3 (#2105)
* Switch to golang 1.6

* Update docker image references

* Update godep major version

* Remove GO15VENDOREXPERIMENT references

* Fix errcheck ignore path
2016-08-05 16:35:43 -04:00
Roland Bracewell Shoemaker a0a9623cb6 Switch to using SoftHSM in Docker for testing (#1920)
Instead of reading the CA key from a file on disk into memory and using that for signing in `boulder-ca` this patch adds a new Docker container that runs SoftHSM and pkcs11-proxy in order to hold the key and perform signing operations. The pkcs11-proxy module is used by `boulder-ca` to talk to the SoftHSM container.

This exercises (almost) the full pkcs11 path through boulder and will allow testing various HSM related failures in the future as well as simplifying tuning signing performance for benchmarking.

Fixes #703.
2016-07-11 11:20:51 -07:00
Jacob Hoffman-Andrews 2c108118a8 Docker test updates (#1842)
Commit test/boulder-tools (forgot to include them in #1838).
Mount $GOPATH as a volume in the container so that source code changes take
effect in the container without a rebuild, and build cache can make repeated
runs faster. Install rabbitmq-setup outside of the mounted-over path so it still
exists.
Remove unnecessary entries from Dockerfile's PATH and GOBIN.

https://github.com/letsencrypt/boulder/pull/1842
2016-05-25 12:19:51 -07:00
Jacob Hoffman-Andrews 71e4af43f7 Roll forward "Run Travis tests in Docker (#1830)" (#1838)
That change broke the certbot tests because it switched to a MariaDB
10.1-specific syntax. certbot/certbot#3058 changes the certbot tests to use
Boulder's docker-compose.yml, so they will get MariaDB 10.1 automatically.
2016-05-24 15:11:22 -07:00
Jacob Hoffman-Andrews b954dcc010 Revert "Run Travis tests in Docker (#1830)" (#1834)
This reverts commit 92d94f2 and commit 0b4623f to unbreak the Certbot build.
2016-05-20 15:57:10 -07:00
Jacob Hoffman-Andrews 92d94f2558 Run Travis tests in Docker (#1830)
* MariaDB 10.1

* MariaDB 10.1 in Docker

* Run docker stuff.

* Improve test.js error.

* Lower log level

* Revert dockerfile to master

* Export debug ports, set FAKE_DNS, and remove container_name.

* Remove typo.

* Make integration-test.py wait for debug ports.

* Use 10.1 and export more Boulder ports.

* Test updates for Docker

Listen on 0.0.0.0 for utility servers.
Make integration-test.py just wait for ports rather than calling startservers.
Run docker-compose in test.sh.
Remove bypass when database exists.
Separate mailer test into its own function in integration test.
Print better errors in test.js.

* Always bring up mysql container.

* Wait for MySQL to come up.

* Put it in travis-before-install.

* Use 127

* Remove manual docker-up.

* Add ifconfig

* Switch to docker-compose run

* It works!

* Remove some spurious env vars.

* Add bash

* try running it

* Add all deps.

* Pass through env.

* Install everything in the Dockerfile.

* Fix install of ruby

* More improvements

* Revert integration test to run directly
Also remove .git from dockerignore and add some packages.

* Revert integration-test.py to master.

* Stop ignoring test/js

* Start from boulder-tools.

* Add boulder-tools.

* Tweak travis.yml

* Separate out docker-compose pull as install.

* Build in install phase; don't bother with go install in Dockerfile

* Add virtualenv

* Actually build rabbitmq-setup

* Remove FAKE_DNS

* Trivial change

* Pull boulder-tools as a separate step so it gets its own timing info.

* Install certbot and protobuf from repos.

* Use cerbot from debian backports.

* Fix clone

* Remove CERTBOT_PATH

* Updates

* Go back to letsencrypt for build.sh

* Remove certbot volume.

* go back to preinstalled letsencrypt

* Restore ENV

* Remove BASH_ENV

* Adapt reloader test so it psses when run as root.

* Fixups for review.

* Revert test.js

* Revert startservers.py

* Revert Makefile.
2016-05-19 16:29:45 -07:00
Jakub Warmuz 1b7fd169ba Test ToS at :4000 (#1742)
Fixes #1720
2016-04-16 10:53:02 -07:00
Jacob Hoffman-Andrews 8bea50ca94 Merge pull request #1734 from ibukanov/fix-docker-grpc
under docker make boulder to resolve to 127.0.0.1
2016-04-15 11:46:12 -07:00
alexandru totolici 961651abcb `name` is not a valid docker-compose key (#1737)
The Docker Compose reference does not mention a key for `name`, and I believe the [correct one is `container_name`](https://docs.docker.com/compose/compose-file/#container-name), which is what this small patch changes.

```
± docker-compose build
ERROR: Validation failed in file './docker-compose.yml', reason(s):
Unsupported config option for bmysql: 'name'
Unsupported config option for brabbitmq: 'name'

± docker-compose -version
docker-compose version 1.6.2, build unknown```
2016-04-15 10:32:15 -07:00
Igor Bukanov d206d4b293 under docker make boulder to resolve to 127.0.0.1
This way gRPC can contact the boulder using boulder name inside the container. This fixed a regression from #1647.
2016-04-14 12:00:07 +02:00
Igor Bukanov 75134fc83f Speed up docker build (#1716)
Make COPY and compilation the last commands in the Dockerfile so in the common case Docker will cache results of EXPOSE, WORKDIR and ENV commands. The CMD is eliminated as entrypoint.sh now defaults to start.py if no arguments are given. The patch eliminates setting MYSQL_CONTAINER in run-docker.sh and docker-compose.yaml as entrypoint.sh sets the variable on its own when calling create_db.sh.

In addition the patch passes arguments passed to run-docker.sh as arguments to the entryscript.sh in the container. This way running `./run-docker.sh ./test.sh ...` allows to execute tests locally.
2016-04-08 09:58:50 -07:00
Jacob Hoffman-Andrews d98eb634d1 Docker improvements.
Use bridged networking.

Add some files to .dockerignore to shrink the build state sent to Docker
daemon.

Use specific hostnames to contact services, rather than localhost.

Add instructions for adding those hostnames to /etc/hosts in non-Docker config.

Use DSN-style connect strings for DBs.

Remove localhost / 127.0.0.1 rewrite hack from create_db.sh.

Add hosts section with new hostnames.

Remove bin from .dockerignore.

SQL grants go to %

Short-circuit DB creation if already existing.

Make `go install` a part of Docker image build so that Docker run is much
faster.

Bind to 0.0.0.0 for OCSP responders so they can be reached from host, and
publish / expose their ports.

Remove ToSServerThread and test.js' fetch of ToS.

Increase the registrationsPerIP rate limit threshold. When issuing from a Docker
host, the 127.0.0.1 override doesn't apply, so the limit is quickly hit.

Update docker-compose for bridged networking. Note: docker-compose doesn't currently work, but should be close.

https://github.com/letsencrypt/boulder/pull/1639
2016-04-04 16:05:08 -07:00
Igor Bukanov 09e18cea87 avoid exposing mysqld and rabbitmq beyond the host
This ensures that services in mariadb and rabbitmq containers bind only to 127.0.0.1, not all interfaces. With host networking that would expose the test services outside the host.

Fixes #1594
2016-03-11 22:32:21 +01:00
Fan Jiang 71b472dd13 Dockerfile of mariadb is mapping 10 as "10.1.10, 10.1, 10, latest"
Thus lead to the test/drop_users.sql having error, mentioned in #1322
If we don't support mariadb 10.1+ now, we should specify it.
2016-01-22 18:30:44 -05:00
Reinaldo de Souza Jr 932eaeaee8 RabbitMQ must also run on the host network 2015-12-23 16:07:39 -05:00
Jessica Frazelle 4d81e3090d
Cleanup of Docker Dev Playground
- Separated RabbitMq into it's own container
- some various Dockerfile-isms cleanup
- updated routes to linked containers
- removed nodejs, I have not been able to figure out why it was being installed
    (so this could be something that is actually needed)

To setup a dev environment:

You now need `docker-compose`, but running the setup with all the
configurations is as simple as:

```
$ docker-compose build
$ docker-compose up
```

Then you can even run the `test.sh` in the container with:

```
$ docker exec -it boulder_boulder_1 bash
root@container $ ./test.sh
```

This is just an _initial_ first pass at refactoring a bunch of this. There is
a bunch more I want to change and make better.

Also with regard to database migration taking awhile I want to try and move
the goose stuff over to the mariadb container, there is just some less savory
things I don't like about starting the db in the background then running the
migration script :/, I like to attach to the process on container start. I do
have some thoughts on a `docker exec` command in the mariadb container which
migrates the db... but trying to think of something better.

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-21 12:47:29 -07:00