Best practices for managing secret API keys (2024)

Learn how to manage secret API keys and handle key leaks.

Secret API keys are a form of account credentials, like a username and password. If bad actors obtain a secret key, they can use it to harm your business and other parties in the Stripe ecosystem.

Stripe users own the responsibility of keeping secret API keys safe. Here are some best practices for how to do that, including by using Stripe-offered security features.

Protecting against key leakage Best practices for managing secret API keys (1)

  • Use secure key management systems (KMS) to store secret keys. When you create a secret live mode key from the Stripe Dashboard, it is only revealed once. Immediately copy the key to a KMS, which is designed to handle sensitive information with encryption and access controls. Make sure you don’t leave a copy of the key in the local file.
  • Grant access only to those who need it. Define a clear policy on which users have permission to create, update or read keys. Limit the access only to those who need it. Audit the access periodically to avoid excess privilege on keys.
  • Don’t share secret keys using insecure means. Don’t share keys in emails, chat messages, or customer support messages. Stripe never asks you for your secret API key.
  • Don’t store keys in source code repositories (such as GitHub). Bad actors might scan public source repositories for leaked keys. Even if the source repository is private, it could be shared with team members on their development environments.
  • Don’t embed secret keys in applications. Bad actors can exploit secret keys by matching a certain string pattern in the application. Avoid embedding keys in applications such as client tools, SDKs, and mobile apps.
  • Exercise your ability to roll your API Keys. Defining and exercising a process for rolling keys helps you understand where your keys are being used and prepares your organization in the event your API key is leaked. By having key rolling processes in place you’ll be prepared to respond to a key leak event with a minimum of impact on your business.
  • Audit API request logs to monitor suspicious activities. We recommend that you regularly audit or monitor API request logs to proactively identify misused API keys. Make sure your developers aren’t using live mode keys when a test mode key is appropriate. Learn more at test mode versus live mode.
  • Regular training and updating documentation. Maintain up-to-date documentation about how to handle secret API keys within your organization and host regular training sessions to make sure best practices are followed.

Adopt security features to protect your integration Best practices for managing secret API keys (2)

  • Use restricted API keys. Restricted API keys can customize read or write access to specific API resources. With restricted keys, especially when giving access to third parties, you can allow only the minimum access to resources required and limit the risk of keys.
  • Limit the IP addresses that can send API requests. You can configure your API key so that only requests from designated IP addresses are allowed. We recommended this if your service has stable egress IP ranges and a change management process for updating the allowlist when those egress ranges change.

Handle leaked secret API keys Best practices for managing secret API keys (3)

If you identified a secret key leak, such as if a key is accidentally published to GitHub, immediately roll the key from Stripe Dashboard and replace your integration with the new key. If you detected abnormal behaviors without confirming that the API key is leaked, we recommended that you roll the API keys proactively while investigating the root cause in parallel.

If Stripe detects that a live mode secret API key has been exposed, we will immediately notify you and request that you roll the key. It’s crucial for businesses to act promptly to reduce potential damages and financial losses caused by unauthorized use of the leaked key. Depending on the imposed risk and activity on the account, we might decide to roll the key on your behalf. In this case you will receive notifications about any action taken.

Stripe doesn’t guarantee that we will detect all leaked keys. You’re responsible for following the best practices to prevent potential key leaks and ensure your integration with Stripe is secure.

Best practices for managing secret API keys (2024)
Top Articles
What is a Cryptocurrency Wallet and How Do They Work?
What is Financial Inclusion? – Banking Scenario | Business Correspondent | Business Facilitator Model
Ups Customer Center Locations
Ups Dropoff Location Near Me
Archived Obituaries
Erika Kullberg Wikipedia
Jonathon Kinchen Net Worth
Free Atm For Emerald Card Near Me
Georgia Vehicle Registration Fees Calculator
Sam's Club Gas Price Hilliard
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Nikki Catsouras Head Cut In Half
Strange World Showtimes Near Amc Braintree 10
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Scholarships | New Mexico State University
6th gen chevy camaro forumCamaro ZL1 Z28 SS LT Camaro forums, news, blog, reviews, wallpapers, pricing – Camaro5.com
Mini Handy 2024: Die besten Mini Smartphones | Purdroid.de
Unlv Mid Semester Classes
979-200-6466
Northeastern Nupath
Watch The Lovely Bones Online Free 123Movies
Morristown Daily Record Obituary
A Person That Creates Movie Basis Figgerits
Nsa Panama City Mwr
Certain Red Dye Nyt Crossword
MyCase Pricing | Start Your 10-Day Free Trial Today
Trivago Myrtle Beach Hotels
Jesus Calling Feb 13
Pokémon Unbound Starters
Select The Best Reagents For The Reaction Below.
Vlacs Maestro Login
My Dog Ate A 5Mg Flexeril
DIY Building Plans for a Picnic Table
Helloid Worthington Login
Why Are The French So Google Feud Answers
3 Bedroom 1 Bath House For Sale
Joplin Pets Craigslist
Why Gas Prices Are So High (Published 2022)
Craigslist Summersville West Virginia
Tokyo Spa Memphis Reviews
B.C. lightkeepers' jobs in jeopardy as coast guard plans to automate 2 stations
Scarlet Maiden F95Zone
Honkai Star Rail Aha Stuffed Toy
Tropical Smoothie Address
855-539-4712
Rite Aid | Employee Benefits | Login / Register | Benefits Account Manager
18 Seriously Good Camping Meals (healthy, easy, minimal prep! )
Definition of WMT
Cars & Trucks near Old Forge, PA - craigslist
Bones And All Showtimes Near Emagine Canton
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5491

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.