-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Draft: feat: add network isolation controls for high-compliance deployments #10676
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
Draft: feat: add network isolation controls for high-compliance deployments #10676
Conversation
Add support for disabling PyPI version checks via environment variable. This is useful for air-gapped or network-isolated deployments where external network access is restricted. When LANGFLOW_DISABLE_VERSION_CHECK=true, skip the PyPI version check in fetch_latest_version() and return None immediately.
Add security control for remote component indices via environment variable. When custom component indices are specified via HTTP/HTTPS URLs, they are now blocked by default unless explicitly allowed. Set LANGFLOW_ALLOW_REMOTE_COMPONENT_INDEX=true to permit loading component indices from remote URLs. This prevents unauthorized component loading in security-sensitive or compliance-restricted environments.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThese changes add environment variable-based configuration controls and disable flags across multiple components. Store interactions, version checking, and remote component index loading are now conditionally disabled based on environment variables. Database pool settings are made configurable through environment variables with new defaults. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/backend/base/langflow/services/store/service.py(2 hunks)src/backend/base/langflow/utils/version.py(2 hunks)src/lfx/src/lfx/interface/components.py(1 hunks)src/lfx/src/lfx/services/settings/base.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/backend/base/langflow/services/store/service.py (1)
src/backend/tests/unit/api/v2/test_mcp_servers_file.py (1)
settings_service(96-97)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
- GitHub Check: Lint Backend / Run Mypy (3.11)
- GitHub Check: Lint Backend / Run Mypy (3.10)
- GitHub Check: Lint Backend / Run Mypy (3.12)
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Run Frontend Tests / Determine Test Suites and Shard Distribution
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Test Starter Templates
- GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
- GitHub Check: Optimize new Python code in this PR
- GitHub Check: Run Ruff Check and Format
- GitHub Check: Update Component Index
🔇 Additional comments (3)
src/backend/base/langflow/utils/version.py (1)
78-80: LGTM! Clean implementation of version check disable flag.The environment variable guard is correctly implemented with case-insensitive comparison and early return, consistent with the function's existing error handling pattern.
src/lfx/src/lfx/interface/components.py (1)
92-98: LGTM! Well-implemented security control.The remote component index guard follows security best practices with a secure default (opt-in) and clear error messaging. The placement correctly prevents the httpx fetch before authorization.
src/backend/base/langflow/services/store/service.py (1)
117-119: Verify consistency with early return in__init__.This defensive check is good, but it's only present in
check_api_key. Consider whether other public methods should have similar guards, especially given the early return in__init__(lines 85-89) that leaves attributes uninitialized.
6cd8e08 to
9d21efc
Compare
Respect the store=false setting to disable Langflow Store integration: - Created DisabledStoreService with no-op implementations of all methods - Updated StoreServiceFactory to return DisabledStoreService when store=false - Changed logger.error to logger.warning in component index security check This prevents AttributeError crashes and provides clean polymorphic behavior when the store is disabled via settings.
b1872a5 to
18b39d9
Compare
Add environment variable to skip NVIDIA model fetching at startup: - Check LANGFLOW_SKIP_NVIDIA_FETCH before calling get_available_models() - Prevents timeout when network policies block integrate.api.nvidia.com - Component remains available with empty model list when disabled - Logs info message when model fetching is skipped This is useful in network-isolated deployments where external API calls are blocked by firewall or network policy rules.
Summary
Add environment variable controls for network isolation in high-compliance, air-gapped, or security-restricted deployments.
Changes
LANGFLOW_DISABLE_VERSION_CHECKto skip PyPI version checksLANGFLOW_ALLOW_REMOTE_COMPONENT_INDEXto block remote component indices by defaultstore=falsesettingLANGFLOW_DB_POOL_SIZE,LANGFLOW_DB_MAX_OVERFLOW,LANGFLOW_DB_POOL_TIMEOUT)Motivation
Organizations with strict network policies need controls to:
Backward Compatibility
All changes are opt-in via environment variables. Default behavior is unchanged.
Summary by CodeRabbit
New Features
Security Improvements
Configuration
✏️ Tip: You can customize this high-level summary in your review settings.