Commit Graph

45 Commits

Author SHA1 Message Date
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
Mahmood Ali
88ff7f40de Merge pull request #11089 from hashicorp/b-cve-2021-37218
Apply authZ for nomad Raft RPC layer
2021-10-05 08:49:21 -04:00
James Rasell
3bffe443ac chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
Mahmood Ali
39627df49f Apply authZ for nomad Raft RPC layer
When mTLS is enabled, only nomad servers of the region should access the
Raft RPC layer. Clients and servers in other regions should only use the
Nomad RPC endpoints.

Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
Co-authored-by: Seth Hoenig <shoenig@hashicorp.com>
2021-08-26 15:10:07 -04:00
James Rasell
530c0f8448 tlsutil: update testing certificates close to expiry. 2021-08-13 11:09:40 +02:00
Kris Hicks
85ed8ddd4f Add gosimple linter (#9590) 2020-12-09 11:05:18 -08:00
Michael Schurter
556adad26a config: accept CA PEM files with extra whitespace
Previously we did a validation pass over CA PEM files before calling
Go's CertPool.AppendCertsFromPEM to provide more detailed error messages
than the stdlib provides.

Unfortunately our validation was overly strict and rejected valid CA
files. This is actually the reason the stdlib PEM parser doesn't return
meaningful errors: PEM files are extremely permissive and it's difficult
to tell the difference between invalid data and valid metadata.

This PR removes our custom validation as it would reject valid data and
the extra error messages were not useful in diagnosing the error
encountered.
2018-09-06 11:38:56 -07:00
Michael Schurter
c55d166712 client: set host name when migrating over tls
Not setting the host name led the Go HTTP client to expect a certificate
with a DNS-resolvable name. Since Nomad uses `${role}.${region}.nomad`
names ephemeral dir migrations were broken when TLS was enabled.

Added an e2e test to ensure this doesn't break again as it's very
difficult to test and the TLS configuration is very easy to get wrong.
2018-09-05 17:24:17 -07:00
Alex Dadgar
da0bec03c1 Fix make check errors 2018-09-04 16:03:52 -07:00
Chelsea Holland Komlo
067eef565a add signature algorithm to error message 2018-08-13 16:21:18 -04:00
Chelsea Holland Komlo
eb3cead2bc rename signature algorithm type per code review feedback 2018-08-13 16:11:49 -04:00
Chelsea Holland Komlo
011eced69d extract functionality for determining signature algorithm per code review feedback 2018-08-13 16:08:23 -04:00
Chelsea Holland Komlo
4f1d40926e change string repr of signature algorithms to constants 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
4fe562ca8c remove redundant nil check 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
5bb7d9d570 add default case for empty TLS structs 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
1a1effd2aa add comments 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
febf24e71f type safety for string keys 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
781b9c640d add simple getter for certificate 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
92fc1ce470 refactor to use golang built in api for certs 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
bc01b401fc add functionality to check if signature algorithm is supported in cipher suites 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
bfaf4dcb2b change function signature to take entire tls config object 2018-08-10 12:37:21 -04:00
Chelsea Holland Komlo
2cc252baa7 fixup! more specific test assertion 2018-06-13 09:58:40 -04:00
Chelsea Holland Komlo
cd8de515cc add tests and improve should reload logic 2018-06-08 15:10:10 -04:00
Chelsea Holland Komlo
ce9e93514c move logic to determine whether to reload tls configuration to tlsutil helper 2018-06-08 14:33:58 -04:00
Chelsea Holland Komlo
9943b9bafe enable more tls 1.2 ciphers 2018-06-07 17:49:57 -04:00
Alex Dadgar
f547535292 Merge branch 'master' into f-tls-parse-certs 2018-05-30 17:25:50 +00:00
Chelsea Holland Komlo
36fc53c057 fixup! clearify docs and group similar TLS fields 2018-05-29 21:30:49 -04:00
Chelsea Holland Komlo
8e2da4e048 refactor to remove duplication 2018-05-29 18:47:25 -04:00
Chelsea Holland Komlo
5ae88d9f0c handle parsing multiple certificates in a pem file 2018-05-29 18:25:43 -04:00
Chelsea Holland Komlo
a8ff38f790 remove unnecessary type conversation 2018-05-29 17:07:38 -04:00
Chelsea Holland Komlo
d4152c77ea parse CA certificate to catch more specific errors 2018-05-25 18:14:32 -04:00
Chelsea Holland Komlo
25896ddf3c add support for tls PreferServerCipherSuites
add further tests for tls configuration
2018-05-25 13:20:00 -04:00
Chelsea Holland Komlo
6733d768f0 refactor NewTLSConfiguration to pass in verifyIncoming/verifyOutgoing
add missing fields to TLS merge method
2018-05-23 18:35:30 -04:00
Chelsea Holland Komlo
509180ee00 add support for configurable TLS minimum version 2018-05-09 18:07:12 -04:00
Chelsea Holland Komlo
0f46208cc1 allow configurable cipher suites
disallow 3DES and RC4 ciphers

add documentation for tls_cipher_suites
2018-05-09 17:15:31 -04:00
Chelsea Holland Komlo
8de260f19b refactor creating a new tls configuration 2018-01-16 08:02:39 -05:00
Chelsea Komlo
fa9fd4422c Nomad agent reload TLS configuration on SIGHUP (#3479)
* Allow server TLS configuration to be reloaded via SIGHUP

* dynamic tls reloading for nomad agents

* code cleanup and refactoring

* ensure keyloader is initialized, add comments

* allow downgrading from TLS

* initalize keyloader if necessary

* integration test for tls reload

* fix up test to assert success on reloaded TLS configuration

* failure in loading a new TLS config should remain at current

Reload only the config if agent is already using TLS

* reload agent configuration before specific server/client

lock keyloader before loading/caching a new certificate

* introduce a get-or-set method for keyloader

* fixups from code review

* fix up linting errors

* fixups from code review

* add lock for config updates; improve copy of tls config

* GetCertificate only reloads certificates dynamically for the server

* config updates/copies should be on agent

* improve http integration test

* simplify agent reloading storing a local copy of config

* reuse the same keyloader when reloading

* Test that server and client get reloaded but keep keyloader

* Keyloader exposes GetClientCertificate as well for outgoing connections

* Fix spelling

* correct changelog style
2017-11-14 17:53:23 -08:00
Alex Dadgar
07f7e19578 Fix vet script and fix vet problems
This PR fixes our vet script and fixes all the missed vet changes.

It also fixes pointers being printed in `nomad stop <job>` and `nomad
node-status <node>`.
2017-02-27 16:00:19 -08:00
Michael Schurter
4a3243aaf5 Add docs for generating example certificates 2016-11-15 17:22:54 -08:00
Michael Schurter
c9397c75a8 Fix tlsutil tests 2016-11-10 12:18:13 -08:00
Alex Dadgar
818196e4a1 get tlsutil tests to compile - need to regenerate the certificates 2016-11-09 14:41:08 -08:00
Michael Schurter
1ce766408b Remove incorrectly committed line and wrong comment 2016-11-01 15:57:21 -07:00
Michael Schurter
cd9fbfa0c7 Remove ServerName because we verify based on region 2016-11-01 14:17:31 -07:00
Diptanu Choudhury
7ee2a1515b Making Nomad TLS configs region aware 2016-11-01 11:55:29 -07:00
Diptanu Choudhury
f416ac7419 Moved tlsutil into helpers 2016-10-25 16:05:37 -07:00