Postman Secrets Management Guide
Problem statement
The Postman desktop application and cloud platform allow developers to design, test, and document APIs.
API testing is done using Postman Collections: files that contain the request(s) format and URL(s) to call a specific API. Collections may also contain secrets that are needed to call the API, such as API keys, OAuth tokens, etc. These secrets need to be handled with care, in order to avoid:
Developers sharing a Collection with each other, with or without realizing that it contains sensitive secrets.
Developers pushing a Collection to a code repository, with or without realizing that it contains sensitive secrets.
Sensitive/production secrets getting mistakenly uploaded to the Postman cloud platform.
Recommendations
The following recommendations can help prevent such issues:
Improving developers' usage of Postman:
Developers should store secrets in Postman environment variables, instead of directly embedding them in the Collection’s request or code, in order to properly separate code/logic from secrets.
Developers should leverage the “initial” and "current“ value functionality in order to avoid mistakenly sharing their own API key when sharing a Collection file.
The "current” value should be used to store the developer’s own/private secrets, as "current“ values do not get shared as part of a Postman Collection or Environment and are not synced to Postman cloud.
More details are available at How to Use API Keys in Postman | Postman Blog .
Developers should leverage the “secrets” variable type, in order to explicitly flag secrets in their Collections.
Such secrets will also be masked when displayed on-screen.
More details are available at Introducing the Secret Variable Type in Postman | Postman Blog
Setting up an "approved“ Postman workspace with secrets scanning:
Provide developers with one or a few "approved“/official Postman cloud workspace(s) that they are expected join and use, when using Postman.
To ensure that there is a central location for all of the organization’s Postman Collections.
Configure Postman’s token scanner functionality to enable Custom Alerts, in order to have it scan for your own organization’s secrets, within Postman Collections.
More details are available at Secret Scanner | Postman Learning Center .
Being able to detect Postman secrets on employee laptops:
To better understand usage and risk, consider leveraging existing endpoint security software to scan company-issued laptops for:
Secrets embedded in Postman Collection files and Postman Environment files.
Postman app installs that are not logged into the approved Postman workspace(s) within Postman cloud.