Follow these security guidelines for every change to the pyatlan SDK.
- Security Team: #bu-security-and-it on Slack
atlan-python (pyatlan) is Atlan's Python SDK, providing typed wrappers around the Atlan REST API. Key modules:
pyatlan/client/atlan.pyβAtlanClient(PydanticBaseSettings); initialised withbase_urlandapi_key; useshttpxwithPyatlanSyncTransport/ async variant; supports impersonation viaImpersonationClient.pyatlan/client/transport.pyβPyatlanSyncTransportand async variant wraphttpx.HTTPTransportwith retry logic;trust_env=Trueby default to respectHTTPS_PROXYenv.pyatlan/client/credential.pyβ manages credential objects (Vault-stored secrets).pyatlan/client/token.pyβ manages API tokens (long-lived service account keys).pyatlan/cache/β caches for tags, groups, roles, custom metadata.
Review every change for:
- API key logging β
AtlanClientholdsapi_key(set asAuthorization: Bearer <key>on every request); it must never appear in log output, error messages, or exception tracebacks; wrap allhttpxerror handling to stripAuthorizationfrom logged request details; theapi_keyfield must be excluded from any Pydantic modeldict()/model_dump()used for logging. - Impersonation token safety β
ImpersonationClientgenerates short-lived impersonation JWTs; these tokens must not be logged; the target user's identity (email/username) may be logged but not the token value. - TLS verification β
PyatlanSyncTransportmust never passverify=Falsetohttpx.HTTPTransport; if users need to use custom CA bundles, accept a path to the bundle, not aFalseflag. base_urlvalidation βbase_urlis validated asHttpUrlvia Pydantic; ensure validation rejects non-HTTPS URLs in production builds (theHttpUrltype allows HTTP by default β add a validator if HTTPS is required).- Proxy credential exposure β
trust_env=TruemeansHTTPS_PROXYis honoured; proxy credentials embedded in the URL (e.g.,http://user:pass@proxy) must not be echoed in log output; strip credentials from proxy URLs before logging. - Credential object sensitivity β
CredentialClientreturns objects withusernameand potentiallypasswordfields; these must not be logged; use repr/str exclusion for credential model classes.
- [MUST]
api_keymust never appear in log output, error messages, or exception tracebacks. - [MUST] Impersonation JWT values must not be logged.
- [MUST]
verify=Falsemust not be used in any httpx transport. - [MUST]
base_urlmust be validated as HTTPS. - [MUST] All direct dependency versions in
pyproject.tomlpinned exactly.
- CONFIDENTIAL:
api_key, impersonation tokens, credential object passwords, service account secrets - INTERNAL:
base_url, user email addresses, workspace IDs, asset GUIDs - PUBLIC: SDK version, API endpoint names, asset type names
-
api_keyabsent from all log output and exception messages;Authorizationheader stripped from error logs - Impersonation JWT token values absent from all log output
-
verify=Falsenot present in anyhttpx.HTTPTransportor client config -
base_urlvalidated as HTTPS (not just HTTP-or-HTTPS via PydanticHttpUrl) - Proxy URLs stripped of credentials before logging
-
CredentialClientresponse objects not logged withpasswordfield - All direct dependencies in
pyproject.tomlpinned exactly