-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/selinux,selinux: update mdp to enable policy capabilities
Presently mdp does not enable any SELinux policy capabilities in the dummy policy it generates. Thus, policies derived from it will by default lack various features commonly used in modern policies such as open permission, extended socket classes, network peer controls, etc. Split the policy capability definitions out into their own headers so that we can include them into mdp without pulling in other kernel headers and extend mdp generate policycap statements for the policy capabilities known to the kernel. Policy authors may wish to selectively remove some of these from the generated policy. Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
- Loading branch information
Stephen Smalley
authored and
Paul Moore
committed
Aug 18, 2020
1 parent
9123e3a
commit 339949b
Showing
5 changed files
with
47 additions
and
26 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,20 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _SELINUX_POLICYCAP_H_ | ||
#define _SELINUX_POLICYCAP_H_ | ||
|
||
/* Policy capabilities */ | ||
enum { | ||
POLICYDB_CAPABILITY_NETPEER, | ||
POLICYDB_CAPABILITY_OPENPERM, | ||
POLICYDB_CAPABILITY_EXTSOCKCLASS, | ||
POLICYDB_CAPABILITY_ALWAYSNETWORK, | ||
POLICYDB_CAPABILITY_CGROUPSECLABEL, | ||
POLICYDB_CAPABILITY_NNP_NOSUID_TRANSITION, | ||
POLICYDB_CAPABILITY_GENFS_SECLABEL_SYMLINKS, | ||
__POLICYDB_CAPABILITY_MAX | ||
}; | ||
#define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1) | ||
|
||
extern const char *selinux_policycap_names[__POLICYDB_CAPABILITY_MAX]; | ||
|
||
#endif /* _SELINUX_POLICYCAP_H_ */ |
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,18 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _SELINUX_POLICYCAP_NAMES_H_ | ||
#define _SELINUX_POLICYCAP_NAMES_H_ | ||
|
||
#include "policycap.h" | ||
|
||
/* Policy capability names */ | ||
const char *selinux_policycap_names[__POLICYDB_CAPABILITY_MAX] = { | ||
"network_peer_controls", | ||
"open_perms", | ||
"extended_socket_class", | ||
"always_check_network", | ||
"cgroup_seclabel", | ||
"nnp_nosuid_transition", | ||
"genfs_seclabel_symlinks" | ||
}; | ||
|
||
#endif /* _SELINUX_POLICYCAP_NAMES_H_ */ |
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