-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Document /run/qubes/policy.d/
#1427
Open
DemiMarie
wants to merge
1
commit into
QubesOS:main
Choose a base branch
from
DemiMarie:multiple-policy-dirs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,11 +86,12 @@ Disposable VMs are tightly integrated -- RPC to a DisposableVM is identical to R | |
|
||
### Policy files | ||
|
||
The dom0 directory `/etc/qubes/policy.d/` contains files that set policy for each available RPC action that a VM might call. | ||
The dom0 directories `/etc/qubes/policy.d/` and `/run/qubes/policy.d/` contain files that set policy for each available RPC action that a VM might call. | ||
For example, `/etc/qubes/policy.d/90-default.policy` contains the default policy settings. | ||
When making changes to existing policies it is recommended that you create a *new* policy file starting with a lower number, like `/etc/qubes/policy.d/30-user.policy`. | ||
You may keep your custom policies in one file like `/etc/qubes/policy.d/30-user.policy`, or you may choose to have multiple files, like `/etc/qubes/policy.d/10-copy.policy`, `/etc/qubes/policy.d/10-open.policy`. | ||
Together the contents of these files make up the RPC access policy database: the files are merged, with policies in lower number files overriding policies in higher numbered files. | ||
If there are entries in both `/run/qubes/policy.d/` and `/etc/qubes/policy.d/` with the same name, it isn't specified which takes precedence, so you should avoid this situation. | ||
|
||
Policies are defined in lines with the following format: | ||
|
||
|
@@ -103,7 +104,7 @@ You can specify the source and destination by name or by one of the reserved key | |
Service calls from dom0 are currently always allowed, and `@dispvm` means "new VM created for this particular request," so it is never a source of request.) | ||
Other methods using *tags* and *types* are also available (and discussed below). | ||
|
||
Whenever a RPC request for an action is received, the domain checks the first matching line of the files in `/etc/qubes/policy.d/` to determine access: | ||
Whenever a RPC request for an action is received, the domain checks the first matching line of the files in `/etc/qubes/policy.d/` and `/run/qubes/policy.d/` to determine access: | ||
whether to allow the request, what VM to redirect the execution to, and what user account the program should run under. | ||
Note that if the request is redirected (`target=` parameter), policy action remains the same -- even if there is another rule which would otherwise deny such request. | ||
If no policy rule is matched, the action is denied. | ||
|
@@ -112,6 +113,10 @@ In the target VM, a file in either of the following locations must exist, contai | |
- `/etc/qubes-rpc/RPC_ACTION_NAME` when you make it in the template qube; | ||
- `/usr/local/etc/qubes-rpc/RPC_ACTION_NAME` for making it only in an app qube. | ||
|
||
Files in `/run/qubes/policy.d/` are deleted when the system is rebooted. | ||
This is useful for temporary policy that contains the name or UUID of a disposable VM, which will not be meaningful after the system has rebooted. | ||
Such policy files can be created manually, but they are usually created automatically by a qrexec call to dom0. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Qrexec should be capitalized as it refers to the protocol and not to program (e.g. qrexec-client-vm). |
||
|
||
### Making an RPC call | ||
|
||
From outside of dom0, RPC calls take the following form: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
s/VM/qube/
, but then there are other places on this file to change it.