miru system user and needs specific file system
permissions in the two cases where it touches files on your devices:
- Configs — writes config instances to disk when it deploys a release
- Data uploads — reads files to upload them to your bucket
Configs
Default config path During installation, the agent creates and owns/srv/miru. The directory is owned by the miru user and group (miru:miru), with mode 0755. The agent creates configs inside it with mode 0644 and subdirectories with mode 0755.
Deploying configs to
/srv/miru requires no additional configuration. The agent holds write access and all applications can read the configs.
/srv/miru is world-readable. For stricter security configurations, consider using a custom config path./etc/myapp/configs/mobility.json/home/myapp/configs/communication.yaml/var/lib/myapp/configs/safety.yaml
Required permissions
To write to a given file, themiru user requires specific permissions to
- The file itself
- The directories along the path to the file
/var/lib/myapp/configs/planning.yaml as an example. The
required read and write permissions to grant the miru user access to this file are
shown in the table below.
To write to a given file, the
miru user requires the following Unix permissions:
-
Read (
r) and write (w) access to the file itselfr(read) is required to read the file contents.w(write) is required to write the file contents.
If the file does not yet exist, you can ignore this permission. The agent will create it with the appropriate permissions. -
Read (
r), write (w), and execute (x) access to the file’s parent directoryr(read) is required to scan files within the directory.w(write) is required to create/replace directory entries (e.g., temp file + rename for atomic writes).x(execute/search) is required to access files within the directory.
-
Execute (
x) access to all directories along the path to the filex(execute) is required to access directories within the path to the file.
Many directories, such as/var/lib, are world-readable by default and need no special permissions. Other directories, such as/home/myapp, will not grantmiruuser access by default and must be specifically configured.
Data uploads
To upload files from disk, the agent reads the files matched by a file rule’ssource.glob and streams them to
your bucket.
You must grant the required permissions outlined below. Otherwise, the agent will receive a permission denied error from the operating system.
Required permissions
To read a file for upload, themiru user requires specific permissions to
- The file itself
- The directories along the path to the file
source.glob is /var/log/robot/*.log, matching the
file /var/log/robot/app.log. The required permissions to grant the miru user access
to this file are shown in the table below.
To read a given file, the
miru user requires the following Unix permissions:
-
Read (
r) access to the file itselfr(read) is required to read the file contents for upload.
-
Read (
r) and execute (x) access to the file’s parent directoryr(read) is required to list the directory and match files against the glob.x(execute/search) is required to open files within the directory.
-
Execute (
x) access to all directories along the path to the filex(execute) is required to traverse directories within the path to the file.
Many directories, such as/var/log, are world-readable and executable by default and need no special permissions. Others, such as/home/myapp, will not grantmiruuser access by default and must be specifically configured.
miru user does not need write access to the source
files, unless the rule also deletes them, covered next.
Deleting local files
If a file rule has aretention block,
the agent removes each matching file once its retention guarantee ends. Deleting a file
requires write (w) access to its parent directory (to remove the directory
entry), so grant the miru user r, w, and x on the directory in that case:
To grant these permissions, follow the instructions in Granting access.
Granting access
There are two common methods for granting a user (themiru user) access to a given path:
- Standard Unix permissions - basic owner/group/other mode bits on a file or directory
- ACLs - per-user or per-group access rules beyond mode bits
miru user or group the
required permissions.
Standard Unix permissions
For standard Unix permissions, there are three approaches, in order of preference:- Add
miruto a group that already has access - Grant the
mirugroup the appropriate permissions - Transfer ownership to the
miruuser
miru to that group is the least
invasive option.
We recommend starting there. Otherwise, grant the miru group access directly.
Add miru to an existing group
Add themiru user to a group that already has the required access, so it inherits that
group’s permissions without touching the path:
Set the group or owner
If no group already grants the access you need, set the path’s group tomiru
(recommended) or transfer ownership to miru.
Files
- Group access
- Transfer ownership
Replace
path="/path/to/file.json" with the actual file path- Group access
- Transfer ownership
Replace
path="/path/to/dir" with the actual directory pathACLs
When you cannot change the ownership or the group of a path (e.g., a directory shared between multiple services), use POSIX Access Control Lists (ACLs) for fine-grained permission control. ACLs require theacl package. If setfacl is not available, install it with:
miru user access to a file.
Replace
/path/to/file.json with the actual file pathmiru user access to a directory.
Replace
/path/to/dir with the actual directory path
