Skip to content

Commit

Permalink
Add the swtpm.if interface file for interactions with other domains
Browse files Browse the repository at this point in the history
All interface definitions were wrapped with ifndef using the ifndefy.py
script.

Resolves: RHEL-47274
  • Loading branch information
zpytela committed Aug 8, 2024
1 parent 627bb00 commit 0a4e2f7
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions policy/modules/contrib/swtpm.if
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 };
')
')

0 comments on commit 0a4e2f7

Please sign in to comment.