-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the swtpm.if interface file for interactions with other domains
All interface definitions were wrapped with ifndef using the ifndefy.py script. Resolves: RHEL-47274
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
## <summary>policy for swtpm</summary> | ||
|
||
######################################## | ||
## <summary> | ||
## Execute TEMPLATE in the swtpm domin. | ||
## </summary> | ||
## <param name="domain"> | ||
## <summary> | ||
## Domain allowed to transition. | ||
## </summary> | ||
## </param> | ||
# | ||
ifndef(`swtpm_domtrans',` | ||
interface(`swtpm_domtrans',` | ||
gen_require(` | ||
type swtpm_t, swtpm_exec_t; | ||
') | ||
|
||
corecmd_search_bin($1) | ||
domtrans_pattern($1, swtpm_exec_t, swtpm_t) | ||
') | ||
') | ||
|
||
######################################## | ||
## <summary> | ||
## Execute swtpm in the swtpm domain, and | ||
## allow the specified role the swtpm domain. | ||
## </summary> | ||
## <param name="domain"> | ||
## <summary> | ||
## Domain allowed to transition | ||
## </summary> | ||
## </param> | ||
## <param name="role"> | ||
## <summary> | ||
## The role to be allowed the swtpm domain. | ||
## </summary> | ||
## </param> | ||
# | ||
ifndef(`swtpm_run',` | ||
interface(`swtpm_run',` | ||
gen_require(` | ||
type swtpm_t; | ||
attribute_role swtpm_roles; | ||
') | ||
|
||
swtpm_domtrans($1) | ||
roleattribute $2 swtpm_roles; | ||
') | ||
') | ||
|
||
######################################## | ||
## <summary> | ||
## Role access for swtpm | ||
## </summary> | ||
## <param name="role"> | ||
## <summary> | ||
## Role allowed access | ||
## </summary> | ||
## </param> | ||
## <param name="domain"> | ||
## <summary> | ||
## User domain for the role | ||
## </summary> | ||
## </param> | ||
# | ||
ifndef(`swtpm_role',` | ||
interface(`swtpm_role',` | ||
gen_require(` | ||
type swtpm_t; | ||
attribute_role swtpm_roles; | ||
') | ||
|
||
roleattribute $1 swtpm_roles; | ||
|
||
swtpm_domtrans($2) | ||
|
||
ps_process_pattern($2, swtpm_t) | ||
allow $2 swtpm_t:process { signull signal sigkill }; | ||
') | ||
') |