Lease, Renew, and Revoke | Vault | HashiCorp Developer (2024)

With every dynamic secret and service type authentication token, Vaultcreates a lease: metadata containing information such as a time duration,renewability, and more. Vault promises that the data will be valid for thegiven duration, or Time To Live (TTL). Once the lease is expired, Vault canautomatically revoke the data, and the consumer of the secret can no longer becertain that it is valid.

The benefit should be clear: consumers of secrets need to check in withVault routinely to either renew the lease (if allowed) or request areplacement secret. This makes the Vault audit logs more valuable andalso makes key rolling a lot easier.

All dynamic secrets in Vault are required to have a lease. Even if the data ismeant to be valid for eternity, a lease is required to force the consumerto check in routinely.

In addition to renewals, a lease can be revoked. When a lease is revoked, itinvalidates that secret immediately and prevents any further renewals. Forexample, with the AWS secrets engine, theaccess keys will be deleted from AWS the moment a lease is revoked. Thisrenders the access keys invalid from that point forward.

Revocation can happen manually via the API, via the vault lease revoke cli command,the user interface (UI) under the Access tab, or automatically by Vault. When a leaseis expired, Vault will automatically revoke that lease. When a token is revoked,Vault will revoke all leases that were created using that token.

Note: The Key Value Backend which storesarbitrary secrets does not issue leases although it will sometimes return alease duration; see the documentation for more information.

When reading a dynamic secret, such as via vault read, Vault always returns alease_id. This is the ID used with commands such as vault lease renew and vault lease revoke to manage the lease of the secret.

Lease durations and renewal

Along with the lease ID, a lease duration can be read. The lease duration isa Time To Live value: the time in seconds for which the lease is valid. Aconsumer of this secret must renew the lease within that time.

When renewing the lease, the user can request a specific amount of time theywant remaining on the lease, termed the increment. This is not an incrementat the end of the current TTL; it is an increment from the current time. Forexample, vault lease renew -increment=3600 my-lease-id would request that the TTL of the leasebe adjusted to 1 hour (3600 seconds). Having the increment be rooted at thecurrent time instead of the end of the lease makes it easy for users to reducethe length of leases if they don't actually need credentials for the fullpossible lease period, allowing those credentials to expire sooner andresources to be cleaned up earlier.

The requested increment is completely advisory. The backend in charge of thesecret can choose to completely ignore it. For most secrets, the backend doesits best to respect the increment, but often limits it to ensure renewals everyso often.

As a result, the return value of renewals should be carefully inspected todetermine what the new lease is.

To implement token renewal logic in your application code, refer to the code example in the Authentication doc.

In addition to revoking a single secret, operators with proper access controlcan revoke multiple secrets based on their lease ID prefix.

Lease IDs are structured in a way that their prefix is always the path wherethe secret was requested from. This lets you revoke trees of secrets. Forexample, to revoke all AWS access keys, you can do vault lease revoke -prefix aws/.For more information about revoke command please checkcli's lease revokecommand docs.

This is very useful if there is an intrusion within a specific system: allsecrets of a specific backend or a certain configured backend can be revokedquickly and easily.

Lease, Renew, and Revoke | Vault | HashiCorp Developer (2024)
Top Articles
How to Manage DeFi Price Risk by Setting Stop Losses - Treehouse Academy
House-to-house enquiries | College of Policing
Tlc Africa Deaths 2021
Melson Funeral Services Obituaries
Otterbrook Goldens
Mcoc Immunity Chart July 2022
Puretalkusa.com/Amac
The Pope's Exorcist Showtimes Near Cinemark Hollywood Movies 20
Okatee River Farms
Apnetv.con
Fallout 4 Pipboy Upgrades
Spelunking The Den Wow
Winterset Rants And Raves
Med First James City
Shuiby aslam - ForeverMissed.com Online Memorials
Shooting Games Multiplayer Unblocked
Craigslist Deming
Spartanburg County Detention Facility - Annex I
Otterbrook Goldens
Munich residents spend the most online for food
25Cc To Tbsp
Khiara Keating: Manchester City and England goalkeeper convinced WSL silverware is on the horizon
Allentown Craigslist Heavy Equipment
Jayah And Kimora Phone Number
The best brunch spots in Berlin
Southland Goldendoodles
Kentuky Fried Chicken Near Me
Bn9 Weather Radar
Pain Out Maxx Kratom
Rek Funerals
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
'Insidious: The Red Door': Release Date, Cast, Trailer, and What to Expect
Nikki Catsouras: The Tragic Story Behind The Face And Body Images
Bursar.okstate.edu
Persona 4 Golden Taotie Fusion Calculator
Mumu Player Pokemon Go
Minecraft Jar Google Drive
Frostbite Blaster
Clark County Ky Busted Newspaper
Mvnt Merchant Services
Letter of Credit: What It Is, Examples, and How One Is Used
Giovanna Ewbank Nua
Craigslist/Nashville
Cvs Minute Clinic Women's Services
Assignation en paiement ou injonction de payer ?
Is Chanel West Coast Pregnant Due Date
Pilot Travel Center Portersville Photos
Subdomain Finer
683 Job Calls
Leslie's Pool Supply Redding California
Latest Posts
Article information

Author: Francesca Jacobs Ret

Last Updated:

Views: 5982

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Francesca Jacobs Ret

Birthday: 1996-12-09

Address: Apt. 141 1406 Mitch Summit, New Teganshire, UT 82655-0699

Phone: +2296092334654

Job: Technology Architect

Hobby: Snowboarding, Scouting, Foreign language learning, Dowsing, Baton twirling, Sculpting, Cabaret

Introduction: My name is Francesca Jacobs Ret, I am a innocent, super, beautiful, charming, lucky, gentle, clever person who loves writing and wants to share my knowledge and understanding with you.