Check ID:
Provider: MongoDB Atlas
Service:
Severity: HIGH
Categories:
Resource type:
organizations_service_account_secrets_expirationProvider: MongoDB Atlas
Service:
organizationsSeverity: HIGH
Categories:
secretsResource type:
NotDefinedWhat this check verifies
MongoDB Atlas organization settingmaxServiceAccountSecretValidityInHours caps the lifetime of new Admin API service account secrets. Evaluation focuses on whether a limit is configured and whether it is at or below the defined policy threshold (default 8 hours).
Risk
Overlong or unset lifetimes for Admin API service account secrets expand the attack window. If leaked, an adversary can maintain API access to:- Exfiltrate data (confidentiality)
- Alter org or project configs (integrity)
- Disable services or change access controls (availability)
Recommendation
Set a strict cap viamaxServiceAccountSecretValidityInHours to 8 hours or less. Apply least privilege to service accounts, automate secret rotation/revocation, and monitor usage. Store secrets in a secure vault and limit where they can be used e.g., network allowlisting as part of defense in depth.
Remediation
- CLI
- Terraform
- Dashboard steps
References
- https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/2025-03-12/operation/operation-getorganizationsettings#operation-getorganizationsettings-200-body-application-vnd-atlas-2023-01-01-json-maxserviceaccountsecretvalidityinhours
- https://mongodb.prakticum-team.ru/docs/atlas/tutorial/activity-feed/
Where this check fires
This check runs on every scheduled scan against your MongoDB Atlas account. Findings appear at Cloud Security → Findings filterable byCheck ID = organizations_service_account_secrets_expiration. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to MongoDB Atlas checks