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
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
lease.go logical/aws: Harden WAL entry creation (#5202) 2018-09-27 09:54:59 -05:00
lease_test.go
logical.go
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
storage.go
storage_inmem.go
storage_inmem_test.go
system_view.go The big one (#5346) 2018-09-17 23:03:00 -04:00
testing.go
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