Skip to content

Commit e2a416d

Browse files
authored
Merge pull request #2327 from atlanhq/agents-security
security: add security guidelines for agents (atlan-java)
2 parents 777f702 + 9e88464 commit e2a416d

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Security
2+
3+
> Follow these security guidelines for every change to the Atlan Java SDK.
4+
5+
### Contact
6+
7+
- **Security Team:** #bu-security-and-it on Slack
8+
9+
### Quickstart for Agents
10+
11+
atlan-java is Atlan's Java SDK (multi-module Gradle, Kotlin DSL). Modules:
12+
13+
- `sdk/` — Core Java SDK client (`AtlanClient`, `HttpClient`); API key auth via `Authorization: Bearer` header; `HttpURLConnectionClient` for HTTP transport; WireMock for unit tests.
14+
- `package-toolkit/runtime/` — Utilities for custom packages including S3 (`S3Utils`), GCS, ADLS connectors, CSV/Excel processing.
15+
- `package-toolkit/config/` — Pkl language support for package configuration.
16+
- `integration-tests/` — E2E tests against live Atlan environment using `ATLAN_BASE_URL` and `ATLAN_API_KEY` env vars.
17+
18+
Review every change for:
19+
20+
- **API key logging**`AtlanClient` holds the API key and sets it as `Authorization: Bearer <key>` on every HTTP request; the key must never appear in log output, SLF4J messages, or exception `getMessage()` results; when logging `HttpClient` errors, strip the `Authorization` header value from the logged request details; `ATLAN_API_KEY` read from environment for integration tests must similarly not be logged.
21+
- **TLS certificate verification**`HttpURLConnectionClient` must not disable hostname verification (`HttpsURLConnection.setDefaultHostnameVerifier(...)` with an always-true lambda) or bypass certificate validation via a trust-all `SSLContext`; if custom CA bundles are needed for corporate proxies, accept the CA certificate path, not a bypass flag.
22+
- **Package-toolkit S3/GCS/ADLS credential logging**`S3Utils` and equivalent GCS/ADLS utilities accept access keys, secret keys, and service account credentials; these must not be logged; use `@ToString(exclude=...)` Lombok annotations or equivalent to exclude credential fields from `toString()`.
23+
- **Pkl config secrets**`package-toolkit/config/` uses Pkl to define package configuration schemas; if any Pkl config field represents a secret (password, API key, token), mark it as sensitive and ensure it is excluded from serialization outputs used for logging or UI display.
24+
- **Dependency version pinning** — all direct dependencies in `sdk/build.gradle.kts` and `package-toolkit/*/build.gradle.kts` must use explicit version strings; avoid dynamic version ranges (`+`, `latest.release`) which allow supply-chain substitution.
25+
26+
### Security Invariants
27+
28+
- **[MUST]** API key (`ATLAN_API_KEY`, `apiKey`) must never appear in log output or exception messages.
29+
- **[MUST]** TLS certificate verification and hostname verification must not be disabled.
30+
- **[MUST]** S3/GCS/ADLS credential values must not be logged — use `@ToString(exclude=...)`.
31+
- **[MUST]** All direct dependencies must use explicit version pins — no dynamic version ranges.
32+
33+
### Data Classification
34+
35+
- **CONFIDENTIAL:** `ATLAN_API_KEY`, S3 secret access key, GCS service account JSON, ADLS client secret
36+
- **INTERNAL:** `ATLAN_BASE_URL`, workspace IDs, asset GUIDs, object storage bucket names
37+
- **PUBLIC:** SDK version, asset type names, API endpoint names
38+
39+
### Review Checklist
40+
41+
- [ ] `ATLAN_API_KEY` / `apiKey` absent from all log output and exception messages
42+
- [ ] No `trustAllCerts`, `setDefaultHostnameVerifier(always-true)`, or bypass `SSLContext`
43+
- [ ] S3/GCS/ADLS credential fields excluded from `toString()` via Lombok or equivalent
44+
- [ ] Pkl config secret fields marked sensitive and excluded from log serialization
45+
- [ ] All `build.gradle.kts` dependencies use explicit version pins (no `+` or `latest.release`)

CLAUDE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,32 @@ cp .env.example .env
8181
# Edit .env with your ATLAN_BASE_URL and ATLAN_API_KEY
8282
export $(cat .env | xargs)
8383
```
84+
85+
## Security
86+
87+
> Follow these security guidelines for every change to the Atlan Java SDK.
88+
89+
### Contact
90+
91+
- **Security Team:** #bu-security-and-it on Slack
92+
93+
### Quickstart for Agents
94+
95+
This multi-module Gradle project provides the Atlan Java SDK (`sdk/`) and package-toolkit (`package-toolkit/`). The SDK uses `HttpURLConnection`-based HTTP client with API key auth. The package-toolkit supports S3, GCS, and ADLS object storage connectors. Review every change for:
96+
97+
- **API key logging** — the `apiKey` / `token` used for Atlan API auth must never appear in log output or error messages; log only the base URL and HTTP status codes.
98+
- **TLS verification** — HTTP connections to the Atlan API must use TLS with certificate verification; `trustAllCerts` or disabling hostname verification is not permitted.
99+
- **Package-toolkit credential handling** — S3/GCS/ADLS credentials used in package-toolkit runtime must not be logged; use credential-aware `toString()` that excludes secret fields.
100+
101+
### Security Invariants
102+
103+
- **[MUST]** `apiKey` / `token` must never appear in log output or error messages.
104+
- **[MUST]** TLS certificate verification must not be disabled.
105+
- **[MUST]** Cloud storage credentials (S3 secret key, GCS service account, ADLS client secret) must not be logged.
106+
107+
### Review Checklist
108+
109+
- [ ] `apiKey` / `token` absent from all log output and exceptions
110+
- [ ] No `trustAllCerts` or hostname verification bypass
111+
- [ ] S3/GCS/ADLS credential values absent from all log output
112+
- [ ] All dependencies in `build.gradle.kts` use explicit version pins

0 commit comments

Comments
 (0)