Commit Graph

104 Commits

Author SHA1 Message Date
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
Nick Ethier
2c311f4321 vendor: remove unused github.com/kardianos/osext 2018-07-05 11:04:12 -04:00
Charlie Voiselle
b2fe392cfb Extend timeout based on user feedback
Closes https://github.com/hashicorp/nomad/issues/4439.
2018-06-21 15:27:56 -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
ec95677a4d Add test and docs 2018-05-31 18:05:03 -07: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 Komlo
31c21988b8 Merge pull request #4269 from hashicorp/f-tls-remove-weak-standards
Configurable TLS cipher suites and versions; disallow weak ciphers
2018-05-11 08:11:46 -04:00
Charlie Voiselle
41b71b6138 Added deferred cancel to prevent context leaks 2018-05-10 18:52:54 -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
Charlie Voiselle
43765af758 Merge branch 'master' into b-extend-win-cpu-fingerprint-timeout 2018-05-09 16:23:14 -04:00
Charlie Voiselle
2220b12446 Addressed review comments 2018-05-09 13:21:35 -04:00
Charlie Voiselle
db19b177ad Override 3 sec. WMI timeout in gopsutil
The default timeout is too short for some overburdened or resource
constrained machines to complete the WMI query before the context
deadline expires.  This causes them to be unable to fingerprint the CPU
properly.
2018-05-08 17:00:31 -04:00
Charlie Voiselle
c648159521 Fix the CPU Information error message
The new version of gopsutil introduces a 3 second timeout that could come up as an error here; however, we are outputting the wrong variable and eating the error.
2018-05-08 14:11:29 -04:00
Seth Vargo
ba6111e2a4 Set user-agent when talking to GCE metadata 2018-04-10 10:36:46 -04:00
Michael Schurter
587d4e264b testlog: override testlogger with envvar 2018-03-21 16:49:48 -07:00
Josh Soref
830e2ffb56 spelling: unknown 2018-03-11 19:07:31 +00:00
Alex Dadgar
f062c93e95 Client tls 2018-02-15 15:22:57 -08:00
Alex Dadgar
4f2725bb98 Enhance API pkg to utilize Server's Client Tunnel
This PR enhances the API package by having client only RPCs route
through the server when they are low cost and for filesystem access to
first attempt a direct connection to the node and then falling back to
a server routed request.
2018-02-15 13:59:03 -08:00
Alex Dadgar
c0e01d8a9e New RPC Modes and basic setup for streaming RPC handlers 2018-02-15 13:59:01 -08:00
Alex Dadgar
d15bb76538 Refactor 2018-02-15 13:59:00 -08:00
Alex Dadgar
0b6e4e2589 Pull inmem codec to helper 2018-02-15 13:59:00 -08:00
Chelsea Komlo
9d006ecd0d Merge pull request #3492 from hashicorp/f-client-tls-reload
Client/Server TLS dynamic reload
2018-01-23 05:51:32 -05:00
Charlie Voiselle
aacefafe53 Allow . in Environment Variable Names
From [https://github.com/appc/spec/blob/master/spec/aci.md](https://github.com/appc/spec/blob/master/spec/aci.md):

>environment (list of objects, optional) represents the app's environment variables (ACE can append). The listed objects must have two key-value pairs: name and value. The name must consist solely of letters, digits, and underscores '_' as outlined in IEEE Std 1003.1-2008, 2016 Edition, with practical considerations dictating that the name may also include periods '.' and hyphens '-'. The value is an arbitrary string. These values are not evaluated in any way, and no substitutions are made.

Dotted environment variables are frequently used as a part of the Spring Boot pattern. (re: ZD-6116)

This PR specifically doesn't address the conversion of hyphens (`-`) due to an issue with rkt [[Nomad GH # 2358]](https://github.com/hashicorp/nomad/issues/2358).
2018-01-22 13:59:37 -08:00
Chelsea Holland Komlo
8de260f19b refactor creating a new tls configuration 2018-01-16 08:02:39 -05:00
Michael Schurter
98c72e953b Improve naming and docs 2018-01-08 13:36:07 -08:00
Michael Schurter
4eaa6700fa Logger backed by *testing.T
For capturing log output in tests and only displaying them on failure.

Pulled out of #3241
2018-01-08 12:53:58 -08:00
Preetha Appan
05d52b621c Changes service name validation logic to ignore any environment variables first. 2017-11-15 15:35:43 -06: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