Skip to content

Commit

Permalink
Introduce new boolean unconfined_dyntrans_all.
Browse files Browse the repository at this point in the history
Default value is set to off. If the boolean is turned on, there is
possible using setcon to dyntrans to any process type which is part of
domain attribute.
  • Loading branch information
wrabcak committed Mar 20, 2019
1 parent f0a193b commit 2d537ca
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions policy/modules/kernel/domain.if
Original file line number Diff line number Diff line change
Expand Up @@ -1789,3 +1789,21 @@ interface(`domain_noatsecure_all_domains',`

allow $1 domain:process { noatsecure };
')

######################################
## <summary>
## Allow domain dyntransition to all domains in domain attribute.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`domain_dyntrans',`
gen_require(`
attribute domain;
')

dyntrans_pattern($1, domain)
')
11 changes: 11 additions & 0 deletions policy/modules/roles/unconfineduser.te
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ gen_tunable(unconfined_mozilla_plugin_transition, false)
## </desc>
gen_tunable(unconfined_login, true)

## <desc>
## <p>
## Allow a unconfined user to dynamically transition to a new context using setcon.
## </p>
## </desc>
gen_tunable(unconfined_dyntrans_all, false)

# usage in this module of types created by these
# calls is not correct, however we dont currently
# have another method to add access to these types
Expand Down Expand Up @@ -106,6 +113,10 @@ tunable_policy(`unconfined_login',`
allow unconfined_t unconfined_login_domain:process sigchld;
')

tunable_policy(`unconfined_dyntrans_all',`
domain_dyntrans(unconfined_t)
')

optional_policy(`
gen_require(`
type unconfined_t;
Expand Down

0 comments on commit 2d537ca

Please sign in to comment.