-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from fishilico/vagrant-fixes
Allow using sysadm_u with Vagrantfile configuration
- Loading branch information
Showing
2 changed files
with
39 additions
and
15 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; SELinux policy module for running virtual machines with Vagrant | ||
|
||
; Vagrant performs "ssh sudo ..." without allocating a pseudo-terminal. | ||
; This leads sudo to directly using sshd pipes, as well as other processes | ||
; spawned from the provision scripts. Define an attribute for those processes. | ||
(typeattribute vagrant_provisioning_cmd_type) | ||
(typeattributeset vagrant_provisioning_cmd_type ( | ||
load_policy_t | ||
semanage_t | ||
setfiles_t | ||
sudodomain | ||
)) | ||
(allow vagrant_provisioning_cmd_type sshd_t (fifo_file (append getattr ioctl read write))) | ||
|
||
; "vagrant rsync" makes Vagrant invoke "sudo rsync" without a shell which would | ||
; make sudo transition out of sysadm_sudo_t. | ||
; Therefore add a transition from sysadm_sudo_t to sysadm_t through rsync_exec_t | ||
(optional sysadm_sudo_rsync_transition | ||
(allow sysadm_t rsync_exec_t (file (entrypoint))) | ||
(typetransition sysadm_sudo_t rsync_exec_t process sysadm_t) | ||
) |