fix(iscsi): block device allowlist confinement#432
fix(iscsi): block device allowlist confinement#432ambient-code[bot] wants to merge 3 commits intomainfrom
Conversation
…rbitrary device exposure Block device paths passed via add_lun(is_block=True) were accepted without confinement. Add a block_device_allowlist config param that must be explicitly populated; resolved paths are checked against it. Also add @validate_call to all @export methods for input type validation. Closes #352 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The iSCSI driver depends on rtslib_fb which requires libudev, a Linux-only library. Add a module-level pytest.skip to prevent import errors on macOS CI runners. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI Fix: macOS test failuresRoot cause: The new Fix applied (commit if sys.platform != "linux":
pytest.skip("iSCSI driver requires Linux (libudev)", allow_module_level=True)This ensures the test module is cleanly skipped on non-Linux platforms rather than failing with an import error. Other CI observations:
|
| host: str = field(default="") | ||
| port: int = 3260 | ||
| remove_created_on_close: bool = False # Keep disk images persistent by default | ||
| block_device_allowlist: List[str] = field(default_factory=list) |
There was a problem hiding this comment.
I guess this parameter would need to be documented in the README.md of the driver.
There was a problem hiding this comment.
Good catch! I've added block_device_allowlist to both the config parameters table and the YAML example in the driver README (commit 9232932).
Add the new block_device_allowlist config parameter to the README config table and YAML example, as requested in PR review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
block_device_allowlistconfiguration parameter toISCSIdriver that must be explicitly populated to allow block device exposureos.path.realpath()to resolve symlinks before checking@validate_calldecorators to all 10@exportmethods for pydantic input type validationCloses #352
Test plan
make lint-fix)🤖 Generated with Claude Code