Ensure API Keys Are Rotated Every 90 Days (2024)

Description

Description:

API Keys should only be used for services in cases where other authentication methods are unavailable. If they are in use it is recommended to rotate API keys every 90 days.

Rationale:

Security risks involved in using API-Keys are listed below:

  • API keys are simple encrypted strings

  • API keys do not identify the user or the application making the API request

  • API keys are typically accessible to clients, making it easy to discover and steal an API key

Because of these potential risks, Google recommends using the standard authentication flow instead of API Keys. However, there are limited cases where API keys are more appropriate. For example, if there is a mobile application that needs to use the Google Cloud Translation API, but doesn't otherwise need a backend server, API keys are the simplest way to authenticate to that API.

Once a key is stolen, it has no expiration, meaning it may be used indefinitely unless the project owner revokes or regenerates the key.
Rotating API keys will reduce the window of opportunity for an access key that is associated with a compromised or terminated account to be used.

API keys should be rotated to ensure that data cannot be accessed with an old key that might have been lost, cracked, or stolen.

'Regenerating Key' may break existing client connectivity as the client will try to connect with older API keys they have stored on devices.

Remediation

From Google Cloud Console

  1. Go to 'APIs & Services\Credentials' using 'https://console.cloud.google.com/apis/credentials'

  2. In the section 'API Keys', Click the 'API Key Name'. The API Key properties display on a new page.

  3. Click 'REGENERATE KEY' to rotate API key.

  4. Click 'Save'.

  5. Repeat steps 2,3,4 for every API key that has not been rotated in the last 90 days.

Note: Do not set 'HTTP referrers' to wild-cards (* or *.[TLD] or .[TLD]/) allowing access to any/wide HTTP referrer(s)
Do not set 'IP addresses' and referrer to 'any host (0.0.0.0 or 0.0.0.0/0 or ::0)'

From Google Cloud CLI

There is not currently a way to regenerate and API key using gcloud commands. To 'regenerate' a key you will need to create a new one, duplicate the restrictions from the key being rotated, and delete the old key.

  1. List existing keys.

gcloud services api-keys list

  1. Note the 'UID' and restrictions of the key to regenerate.

  2. Run this command to create a new API key. is the display name of the new key.
    '
    gcloud alpha services api-keys create --display-name=""
    '
    Note the 'UID' of the newly created key

  3. Run the update command to add required restrictions.

Note - the restriction may vary for each key. Refer to this documentation for the appropriate flags.
https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/update

gcloud alpha services api-keys update

  1. Delete the old key.

gcloud alpha services api-keys delete

Ensure API Keys Are Rotated Every 90 Days (2024)
Top Articles
Ability to Pay Drives Hospital Length of Stay
Next Crypto Bull Run Prediction - In-Depth Market Analysis
Ron Martin Realty Cam
Custom Screensaver On The Non-touch Kindle 4
Elleypoint
Booknet.com Contract Marriage 2
Wild Smile Stapleton
Craigslistdaytona
Phillies Espn Schedule
Purple Crip Strain Leafly
Bros Movie Wiki
Aktuelle Fahrzeuge von Autohaus Schlögl GmbH & Co. KG in Traunreut
Wisconsin Women's Volleyball Team Leaked Pictures
Nioh 2: Divine Gear [Hands-on Experience]
Abortion Bans Have Delayed Emergency Medical Care. In Georgia, Experts Say This Mother’s Death Was Preventable.
Craigslist Southern Oregon Coast
Amih Stocktwits
Aps Day Spa Evesham
Marine Forecast Sandy Hook To Manasquan Inlet
Www.craigslist.com Savannah Ga
Anotherdeadfairy
Aliciabibs
Shoe Station Store Locator
Skymovieshd.ib
Masterbuilt Gravity Fan Not Working
Ultra Ball Pixelmon
Lindy Kendra Scott Obituary
Santa Barbara Craigs List
lol Did he score on me ?
Craigslist Free Stuff San Gabriel Valley
Wake County Court Records | NorthCarolinaCourtRecords.us
Grapes And Hops Festival Jamestown Ny
KITCHENAID Tilt-Head Stand Mixer Set 4.8L (Blue) + Balmuda The Pot (White) 5KSM175PSEIC | 31.33% Off | Central Online
Dynavax Technologies Corp (DVAX)
Emily Tosta Butt
The Wait Odotus 2021 Watch Online Free
Todd Gutner Salary
Walgreens On Secor And Alexis
Mathews Vertix Mod Chart
9:00 A.m. Cdt
Trending mods at Kenshi Nexus
This Doctor Was Vilified After Contracting Ebola. Now He Sees History Repeating Itself With Coronavirus
Tyco Forums
Headlining Hip Hopper Crossword Clue
Craigslist Chautauqua Ny
Sam's Club Fountain Valley Gas Prices
Autozone Battery Hold Down
Arnold Swansinger Family
Provincial Freeman (Toronto and Chatham, ON: Mary Ann Shadd Cary (October 9, 1823 – June 5, 1893)), November 3, 1855, p. 1
Craigslist Yard Sales In Murrells Inlet
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 5907

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.