Virtiofs Tooling + Clamav#202
Conversation
inzanity
left a comment
There was a problem hiding this comment.
In general looks pretty good. Added a bunch of comments of varying severity.
51551ef to
0849c0c
Compare
Rust tooling for secure file sharing between Ghaf VMs via virtiofs. Components: - virtiofs-gate: daemon for file synchronization with malware scanning - virtiofs-notify: VM notification tool for share refresh - clamd-vclient: on-modify scanner client using vsock to host - clamd-vproxy: ClamAV proxy for guest-to-host scanning Signed-off-by: Manuel Bluhm <manuel@ssrc.tii.ae>
Python test tool for validating virtiofs file sharing between Ghaf VMs. Components: - ghaf-virtiofs-test CLI with write/verify/clean modes - Test runner with scenario discovery - Metrics collection for performance tests Test scenarios: - basic: rw, ro, wo, delete, modify, rename, scan, performance - extended: ignore patterns, large files, paths, permissions, quarantine, symlinks - security: bypass attempts, overload/overflow handling - vsock: proxy connectivity, scan latency, security Signed-off-by: Manuel Bluhm <manuel@ssrc.tii.ae>
| print(f"[F-012] Creating file with mode {oct(PERM_MODE)}...") | ||
| perm_file = ctx.path / PERM_FILE | ||
| perm_file.write_bytes(TEST_CONTENT) | ||
| os.chmod(perm_file, PERM_MODE) |
Check failure
Code scanning / CodeQL
Overly permissive file permissions High
| suid_file = ctx.path / SUID_FILE | ||
| suid_file.write_bytes(TEST_CONTENT) | ||
| try: | ||
| os.chmod(suid_file, SUID_MODE) |
Check failure
Code scanning / CodeQL
Overly permissive file permissions High
| sgid_file = ctx.path / SGID_FILE | ||
| sgid_file.write_bytes(TEST_CONTENT) | ||
| try: | ||
| os.chmod(sgid_file, SGID_MODE) |
Check failure
Code scanning / CodeQL
Overly permissive file permissions High
| paths = [] | ||
| for i in range(batch_size): | ||
| file_path = base_dir / f"t{thread_id}_{i:06d}" | ||
| fd = os.open(str(file_path), os.O_CREAT | os.O_WRONLY, 0o644) |
Check failure
Code scanning / CodeQL
Overly permissive file permissions High
| race_file.write_bytes(b"race") | ||
| try: | ||
| race_file.unlink() | ||
| except FileNotFoundError: |
Check notice
Code scanning / CodeQL
Empty except Note
| try: | ||
| os.unlink(str(file_path)) | ||
| count += 1 | ||
| except OSError: |
Check notice
Code scanning / CodeQL
Empty except Note
Description
Patch provides binaries for systemd services to administrate virtiofs shares with security boundary.
It contains:
virtiofs gate daemon: administrates shared virtiofs folders
virtiofs notify daemon: small vsock guest daemon that updates folders for file browsers (gui use case)
clamd-vproxy: daemon proxy via vsock
clamd-vclient: daemon that monitors file system (on-modify) and scans via clamd-vsock
See
README.mdfiles for detailed explanations.Related Issues
Fixes #
Related to #
Type of Change
Changes Made
Testing Done
nix build .#<package-name>nix flake check(all packages build successfully)nix fmt -- --fail-on-change(formatting check passed)reuse lint(license compliance verified)Package Impact
Affected packages:
Screenshots/Logs
Click to expand
Checklist
nix fmtpassed)rec, explicitlib.usage)Additional Notes
For Reviewers: