All notable changes to the RustFS NixOS module will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Following community feedback on Issue #9, additional improvements aligned with Nix best practices:
- Removed redundant manual
stripcommand andbinutilsdependency - Nix automatically strips binaries by default
- Allows packages to use
dontStripfor debugging when needed
- Added clear documentation explaining pre-compiled binaries from GitHub releases
- Makes it obvious why
sourceProvenance = [ sourceTypes.binaryNativeCode ]is declared
- Changed from
serviceConfig.Environmentlist toenvironmentattribute set - More idiomatic Nix style following nixpkgs conventions
- Better integration with override system
- Follows patterns from minio and other modules
- Eliminated
pkgs.writeShellScriptwrapper for credential loading - Uses systemd's
%dplaceholder for credentials directory - Cleaner implementation:
RUSTFS_ACCESS_KEY = "file:%d/access-key" - Direct binary execution without wrapper script
- Changed
logDirectorydefault from"/var/log/rustfs"tonull - Logs written to systemd journal by default
- View logs with:
journalctl -u rustfs -f - File logging still available when explicitly configured
- Automatic log rotation and unified log management
- Comprehensive security documentation in
docs/SECURITY.md - Migration guide for users upgrading from insecure configuration in
docs/MIGRATION.md - Example configurations with sops-nix integration
- Support for both file-based and sops-nix/agenix secret management
- Systemd LoadCredential for secure secret passing
- Extensive systemd security hardening:
CapabilityBoundingSet = ""PrivateDevices = truePrivateTmp = truePrivateUsers = trueProtectSystem = "strict"ProtectHome = trueProtectKernelTunables = trueProtectKernelModules = trueProtectKernelLogs = trueProtectClock = trueProtectControlGroups = trueProtectHostname = trueProtectProc = "invisible"ProcSubset = "pid"RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ]RestrictNamespaces = trueRestrictRealtime = trueRestrictSUIDSGID = trueSystemCallArchitectures = "native"SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ]MemoryDenyWriteExecute = trueLockPersonality = trueNoNewPrivileges = trueUMask = "0077"
ReadWritePathsconfiguration for explicit write access- Resource limits:
LimitNOFILE = 1048576,LimitNPROC = 32768 - Improved restart configuration with
RestartSec = "10s" - Timeout configurations:
TimeoutStartSec = "60s",TimeoutStopSec = "30s" - Automatic directory creation with secure permissions via
systemd.tmpfiles.rules - Detailed option descriptions with examples
- Security checklist in documentation
- Log rotation example configuration
- BREAKING: Removed
services.rustfs.accessKeyoption (security risk) - BREAKING: Removed
services.rustfs.secretKeyoption (security risk) - BREAKING:
accessKeyFileis now required instead of optional - BREAKING:
secretKeyFileis now required instead of optional - Default
volumeschanged from"/tmp/rustfs"to"/var/lib/rustfs"(persistent storage) - Console now defaults to localhost-only binding (
127.0.0.1:9001) - Improved logging output to separate stdout and stderr streams
- Enhanced documentation with security focus
- Updated examples to demonstrate secure configurations
- Service now explicitly grants write access only to required directories
accessKeyoption (removed, useaccessKeyFile)secretKeyoption (removed, usesecretKeyFile)
- Direct secret configuration options (must use file-based secrets)
- Secrets no longer stored in Nix store (world-readable)
- Secrets no longer passed via environment variables
- Service can no longer access user home directories
- Service can no longer modify system files outside designated paths
- Service cannot spawn arbitrary processes or modify system configuration
- Console no longer exposed to public network by default
- Secrets are now passed via systemd LoadCredential (never in Nix store)
- Service runs as unprivileged
rustfsuser (not root) - Comprehensive systemd sandboxing enabled
- System calls restricted to safe subset
- All capabilities dropped
- Prevents privilege escalation
- Memory execution protection
- Network address family restrictions
- Filesystem isolation with explicit write paths
Users upgrading from previous versions must:
- Move secrets from
accessKey/secretKeyto file-based configuration - Update to use
accessKeyFileandsecretKeyFileoptions - Consider using sops-nix or agenix for secret management
- Review firewall rules (console now localhost-only by default)
- Update volume paths from
/tmpto persistent storage
See docs/MIGRATION.md for detailed migration instructions.
- NixOS: 23.11 or later recommended
- Systemd: 252 or later (for all security features)
- RustFS: Compatible with current RustFS binary
- Issue #9 - Original security concerns
- docs/SECURITY.md - Complete security documentation
- docs/MIGRATION.md - Migration guide
- docs/IMPROVEMENTS.md - Technical implementation details