-
Notifications
You must be signed in to change notification settings - Fork 2.2k
docs(security): address documentation gaps for auth, credentials, and policies #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dknos
wants to merge
6
commits into
NVIDIA:main
Choose a base branch
from
dknos:docs/security-documentation-gaps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b551e10
docs(security): address documentation gaps for auth, credentials, and…
miyoungc 50e3ba0
docs(security): address CodeRabbit review feedback
miyoungc b10bfab
docs(security): address CodeRabbit formatting feedback
miyoungc ddbaf20
docs(network-policy): align H1 with title.page and rename Related Top…
invalid-email-address aa600f6
docs(network-policy): apply CodeRabbit style fixes
miyoungc 6b2c7ec
docs(network-policy): replace GitHub repo URL with official OpenShell…
miyoungc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| --- | ||
| title: | ||
| page: "Authentication Configuration" | ||
| nav: "Authentication" | ||
| description: | ||
| main: "Configure device authentication for the OpenClaw gateway, including the NEMOCLAW_DISABLE_DEVICE_AUTH build argument." | ||
| agent: "Documents the NEMOCLAW_DISABLE_DEVICE_AUTH build argument and device authentication configuration. Use when configuring gateway authentication, disabling device auth, or reviewing auth security implications." | ||
| keywords: ["nemoclaw authentication", "device auth disable build arg"] | ||
| topics: ["generative_ai", "ai_agents"] | ||
| tags: ["nemoclaw", "security", "authentication", "deployment"] | ||
| content: | ||
| type: reference | ||
| difficulty: intermediate | ||
| audience: ["developer", "engineer", "security_engineer"] | ||
| status: published | ||
| --- | ||
|
|
||
| <!-- | ||
| SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # Authentication Configuration | ||
|
|
||
| This page documents the device authentication settings for the OpenClaw gateway, including the `NEMOCLAW_DISABLE_DEVICE_AUTH` build argument and related security controls. | ||
|
|
||
| ## `NEMOCLAW_DISABLE_DEVICE_AUTH` | ||
|
|
||
| **Location**: Dockerfile build argument (line 59), propagated to `openclaw.json` as `dangerouslyDisableDeviceAuth`. | ||
| **Default**: `0` (device auth enabled — secure by default). | ||
|
|
||
| ### What It Does | ||
|
|
||
| When set to `1`, the OpenClaw gateway skips the OAuth 2.0 Device Authorization Grant flow. | ||
| Users are not prompted to authenticate via browser-based device code approval before accessing the gateway API. | ||
|
|
||
| The setting is baked into `openclaw.json` at image build time and verified by a SHA256 integrity hash at container startup. | ||
| It cannot be changed at runtime. | ||
|
|
||
| ### When to Disable (Set to `1`) | ||
|
|
||
| Disable device auth only when: | ||
|
|
||
| - The sandbox runs locally with no network exposure (single-user, localhost only). | ||
| - The environment is headless with no browser available to complete the device auth flow. | ||
| - The NemoClaw Docker sandbox is the only consumer (the default `nemoclaw onboard` flow handles this automatically). | ||
|
|
||
| ```console | ||
| $ docker build --build-arg NEMOCLAW_DISABLE_DEVICE_AUTH=1 -t nemoclaw-sandbox . | ||
| ``` | ||
|
|
||
| ### When to Keep Enabled (Default `0`) | ||
|
|
||
| Keep device auth enabled when: | ||
|
|
||
| - The gateway is network-accessible beyond localhost. | ||
| - Multiple users or external clients connect to the same instance. | ||
| - The sandbox is exposed via a tunnel (for example, cloudflared) or LAN binding. | ||
| - You need per-device audit trails. | ||
|
|
||
| ### Security Implications | ||
|
|
||
| | Setting | Risk | Use Case | | ||
| |---------|------|----------| | ||
| | `0` (enabled, default) | Requires browser-based approval; gateway generates per-device tokens | Multi-user, external access, production | | ||
| | `1` (disabled) | Anyone with network access to the gateway can use it without authentication | Single-user local/Docker, headless development | | ||
|
|
||
| :::{warning} | ||
| Disabling device auth on a network-accessible gateway creates an unauthenticated endpoint. | ||
| Combined with a cloudflared tunnel or LAN-bind changes in remote deployments, this results in a publicly reachable, unauthenticated dashboard. | ||
| ::: | ||
|
|
||
| ### Related Settings | ||
|
|
||
| `allowInsecureAuth` | ||
| : Derived automatically from the `CHAT_UI_URL` scheme at build time. | ||
| When the URL uses `http://` (local development), insecure auth is allowed. | ||
| When it uses `https://`, insecure auth is blocked. | ||
| See [Security Best Practices](../security/best-practices.md) for details. | ||
|
|
||
| `auth.token` | ||
| : A gateway bearer token generated at build time using `secrets.token_hex(32)`. | ||
| Unique per image build. | ||
|
|
||
| `trustedProxies` | ||
| : IPs allowed to set `X-Forwarded-For` headers. | ||
| Defaults to `127.0.0.1` and `::1`. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - [Security Best Practices](../security/best-practices.md) for the full gateway authentication controls reference. | ||
| - [Sandbox Hardening](sandbox-hardening.md) for container-level security measures. | ||
| - [Deploy to a Remote GPU Instance](deploy-to-remote-gpu.md) for remote deployment considerations. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| --- | ||
| title: | ||
| page: "Credential Storage Security" | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| nav: "Credential Storage" | ||
| description: | ||
| main: "Security guidance for the ~/.nemoclaw/credentials.json file, including file permissions, rotation, and best practices." | ||
| agent: "Documents security guidance for credential storage at ~/.nemoclaw/credentials.json. Use when reviewing credential security, file permissions, or key rotation practices." | ||
| keywords: ["nemoclaw credential storage", "credentials.json security permissions"] | ||
| topics: ["generative_ai", "ai_agents"] | ||
| tags: ["nemoclaw", "security", "credentials"] | ||
| content: | ||
| type: reference | ||
| difficulty: technical_beginner | ||
| audience: ["developer", "engineer", "security_engineer"] | ||
| status: published | ||
| --- | ||
|
|
||
| <!-- | ||
| SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # Credential Storage Security | ||
|
|
||
| NemoClaw stores API keys and tokens on disk at `~/.nemoclaw/credentials.json`. | ||
| This page covers the file layout, permission model, and best practices for securing, rotating, and auditing stored credentials. | ||
|
|
||
| ## Location | ||
|
|
||
| NemoClaw stores provider API keys and tokens at: | ||
|
|
||
| ```text | ||
| ~/.nemoclaw/credentials.json (mode 0600, owner-only read/write) | ||
| ``` | ||
|
|
||
| The directory `~/.nemoclaw/` is created with mode `0700` (owner-only access). | ||
|
|
||
| ## Plaintext Warning | ||
|
|
||
| Credentials are stored as plaintext JSON. | ||
| The file relies on Unix file permissions (`0600`) for access control. | ||
| There is no encryption at rest. | ||
|
|
||
| ```json | ||
| { | ||
| "NVIDIA_API_KEY": "nvapi-...", | ||
| "GITHUB_TOKEN": "ghp_...", | ||
| "ANTHROPIC_API_KEY": "sk-ant-..." | ||
| } | ||
| ``` | ||
|
|
||
| NemoClaw enforces `0600` permissions on every write (see `bin/lib/credentials.js`). | ||
| The CLI also rejects unsafe `HOME` directories (`/tmp`, `/var/tmp`, `/dev/shm`, `/`) to prevent credential storage in world-readable locations. | ||
|
|
||
| ## Security Recommendations | ||
|
|
||
| ### File Permissions | ||
|
|
||
| Verify that permissions are correct: | ||
|
|
||
| ```console | ||
| $ ls -la ~/.nemoclaw/credentials.json | ||
| # Expected: -rw------- 1 <user> <group> ... credentials.json | ||
| ``` | ||
|
|
||
| If permissions are wrong, fix them: | ||
|
|
||
| ```console | ||
| $ chmod 700 ~/.nemoclaw && chmod 600 ~/.nemoclaw/credentials.json | ||
| ``` | ||
|
|
||
| ### Do Not Commit to Version Control | ||
|
|
||
| Add `~/.nemoclaw/` to your global gitignore: | ||
|
|
||
| ```console | ||
| $ echo '.nemoclaw/' >> ~/.gitignore_global | ||
| $ git config --global core.excludesFile ~/.gitignore_global | ||
| ``` | ||
|
|
||
| ### Exclude from Backups and Cloud Sync | ||
|
|
||
| Prevent credential files from being copied to less-secure locations: | ||
|
|
||
| ```console | ||
| $ echo '.nemoclaw/' >> ~/.backupignore | ||
| ``` | ||
|
|
||
| If using Dropbox, iCloud, or similar cloud sync services, exclude the directory from syncing. | ||
|
|
||
| ### Use Environment Variables in CI/CD | ||
|
|
||
| For CI/CD pipelines, prefer environment variables over stored credentials. | ||
| NemoClaw checks environment variables first before reading `credentials.json` (see `bin/lib/credentials.js`): | ||
|
|
||
| ```console | ||
| $ export NVIDIA_API_KEY=nvapi-... | ||
| $ nemoclaw onboard | ||
| ``` | ||
|
|
||
| ### Rotate Keys Regularly | ||
|
|
||
| Use API keys with expiration where possible. | ||
| Rotate long-lived keys quarterly at minimum. | ||
|
|
||
| ## Credential Rotation | ||
|
|
||
| Re-run onboarding to update stored keys: | ||
|
|
||
| ```console | ||
| $ nemoclaw onboard | ||
| ``` | ||
|
|
||
| Or edit the file directly (permissions are preserved on save by the CLI): | ||
|
|
||
| ```console | ||
| $ vi ~/.nemoclaw/credentials.json | ||
| ``` | ||
|
|
||
| ## Deleting Credentials | ||
|
|
||
| Remove all stored credentials: | ||
|
|
||
| ```console | ||
| $ rm ~/.nemoclaw/credentials.json | ||
| ``` | ||
|
|
||
| Remove all NemoClaw configuration and credentials: | ||
|
|
||
| ```console | ||
| $ rm -rf ~/.nemoclaw/ | ||
| ``` | ||
|
|
||
| ## Audit | ||
|
|
||
| Check current file permissions and ownership: | ||
|
|
||
| ```console | ||
| $ ls -la ~/.nemoclaw/ | ||
| $ ls -la ~/.nemoclaw/credentials.json | ||
| ``` | ||
|
|
||
| Expected output: | ||
|
|
||
| ```text | ||
| drwx------ ... .nemoclaw/ | ||
| -rw------- ... credentials.json | ||
| ``` | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - [Architecture](../reference/architecture.md) for the full host-side state and config reference. | ||
| - [Security Best Practices](best-practices.md) for the complete security controls framework. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.