open-vault/logical
Joel Thompson 73112c49fb logical/aws: Harden WAL entry creation (#5202)
* logical/aws: Harden WAL entry creation

If AWS IAM user creation failed in any way, the WAL corresponding to the
IAM user would get left around and Vault would try to roll it back.
However, because the user never existed, the rollback failed. Thus, the
WAL would essentially get "stuck" and Vault would continually attempt to
roll it back, failing every time. A similar situation could arise if the
IAM user that Vault created got deleted out of band, or if Vault deleted
it but was unable to write the lease revocation back to storage (e.g., a
storage failure).

This attempts to harden it in two ways. One is by deleting the WAL log
entry if the IAM user creation fails. However, the WAL deletion could
still fail, and this wouldn't help where the user is deleted out of
band, so second, consider the user rolled back if the user just doesn't
exist, under certain circumstances.

Fixes #5190

* Fix segfault in expiration unit tests

TestExpiration_Tidy was passing in a leaseEntry that had a nil Secret,
which then caused a segfault as the changes to revokeEntry didn't check
whether Secret was nil; this is probably unlikely to occur in real life,
but good to be extra cautious.

* Fix potential segfault

Missed the else...

* Respond to PR feedback
2018-09-27 09:54:59 -05:00
..
framework The big one (#5346) 2018-09-17 23:03:00 -04:00
plugin Fix compilation/protobuf 2018-09-22 17:58:39 -04:00
testing The big one (#5346) 2018-09-17 23:03:00 -04:00
auth.go Fix for using ExplicitMaxTTL in auth method plugins. (#5379) 2018-09-21 14:31:29 -07:00
connection.go Sync over 2017-10-23 16:43:07 -04:00
error.go Translate AWS Rate limiting errors to 502 errors (#5270) 2018-09-18 15:26:06 -05:00
identity.pb.go Fix compilation/protobuf 2018-09-22 17:58:39 -04:00
identity.proto Pass identity metadata through to plugins (#4967) 2018-07-23 12:45:06 -04:00
lease.go logical/aws: Harden WAL entry creation (#5202) 2018-09-27 09:54:59 -05:00
lease_test.go Remove Unix() invocations on 'time.Time' objects and removed conversion of time to UTC 2016-07-08 18:30:18 -04:00
logical.go Move to "github.com/hashicorp/go-hclog" (#4227) 2018-04-02 17:46:59 -07:00
plugin.pb.go Fix compilation/protobuf 2018-09-22 17:58:39 -04:00
plugin.proto Add PluginEnv to SystemView (#5028) 2018-08-03 09:32:17 -07:00
request.go The big one (#5346) 2018-09-17 23:03:00 -04:00
request_util.go The big one (#5346) 2018-09-17 23:03:00 -04:00
response.go Move sort from listresponse to file backend to solve 5141 2018-08-24 13:37:15 -04:00
response_util.go The big one (#5346) 2018-09-17 23:03:00 -04:00
response_util_test.go Add error logical.ErrUpstreamRateLimited and return 502 from RespondCommonError 2018-09-05 11:07:50 -05:00
secret.go Sync over 2017-10-23 16:43:07 -04:00
storage.go Clean up error string formatting (#4304) 2018-04-09 14:35:21 -04:00
storage_inmem.go Convert logical.InmemStorage to a wrapper around physical/inmem. 2018-02-12 11:16:16 -05:00
storage_inmem_test.go vault: Passthrough backend uses logical.Backend 2015-03-15 14:27:06 -07:00
system_view.go The big one (#5346) 2018-09-17 23:03:00 -04:00
testing.go Offline token revocation fix 2018-06-05 18:53:27 -04:00
token.go The big one (#5346) 2018-09-17 23:03:00 -04:00
translate_response.go Re-add injecting into top routes (#5244) 2018-09-05 11:45:17 -04:00