Skip to content

Commit f310410

Browse files
CLOUDP-329803: [AtlasCLI] Document secure credential storage (#4140)
1 parent a2e66ed commit f310410

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

SECURITY.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,47 @@
22

33
## Reporting a Vulnerability
44

5-
Any security concerns or vulnerabilities discovered in one of MongoDBs products or hosted services
5+
Any security concerns or vulnerabilities discovered in one of MongoDB's products or hosted services
66
can be responsibly disclosed by utilizing one of the methods described in our [create a vulnerability report](https://docs.mongodb.com/manual/tutorial/create-a-vulnerability-report/) docs page.
77

88
While we greatly appreciate community reports regarding security issues, at this time MongoDB does not provide compensation for vulnerability reports.
9+
10+
## Credential Storage
11+
12+
The MongoDB Atlas CLI uses a hybrid approach to store sensitive credentials, prioritizing security while maintaining compatibility across different environments and systems.
13+
14+
### Secure Storage (Preferred)
15+
16+
When available, the CLI uses your operating system's native keyring services to securely store sensitive credentials. This provides the highest level of security by leveraging OS-level encryption and access controls.
17+
18+
**Credentials stored securely include:**
19+
- API Keys (public and private)
20+
- Access Tokens
21+
- Refresh Tokens
22+
- Client ID and Client Secret
23+
24+
**Supported platforms:**
25+
- **macOS**: Uses Keychain Services for secure credential storage
26+
- **Windows**: Integrates with Windows Credential Manager
27+
- **Linux**: Works with desktop [Secret Service](https://specifications.freedesktop.org/secret-service-spec/latest/) dbus interface
28+
29+
### Insecure Storage (Fallback)
30+
31+
If the operating system's keyring services are unavailable, the CLI automatically falls back to storing credentials in a local configuration file (`config.toml`). This ensures the CLI remains functional even in restricted environments.
32+
33+
**Important security considerations for fallback storage:**
34+
- Credentials are stored in plain text in the configuration file
35+
36+
### Checking Your Storage Method
37+
38+
You can verify whether your CLI is using secure storage by running any `atlas` command. You'll see the message `Warning: Secure storage is not available, falling back to insecure storage`, when secure storage is not available.
39+
40+
### Technical Implementation
41+
42+
The CLI uses the [go-keyring](https://github.com/zalando/go-keyring) library to interface with OS keyring services. Each profile's credentials are stored under a service name prefixed with `atlascli_` (e.g., `atlascli_default` for the default profile).
43+
44+
For detailed information about how your operating system manages keyring encryption and security:
45+
46+
- **macOS Keychain**: [Apple Keychain Services Documentation](https://developer.apple.com/documentation/security/keychain_services)
47+
- **Windows Credential Manager**: [Windows Credential Manager Documentation](https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/)
48+
- **Linux GNOME Keyring**: [GNOME Keyring Documentation](https://wiki.gnome.org/Projects/GnomeKeyring)

0 commit comments

Comments
 (0)