SELinux-Refpolicy Archive on lore.kernel.org
 help / Atom feed
* [PATCH] Add hostapd service module
@ 2019-01-26 18:37 Alexander Miroshnichenko
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Miroshnichenko @ 2019-01-26 18:37 UTC (permalink / raw)
  To: selinux-refpolicy; +Cc: Alexander Miroshnichenko

Add a SELinux Reference Policy module for the hostapd
IEEE 802.11 wireless LAN Host AP daemon.
---
 policy/modules/services/hostapd.fc |  7 ++++
 policy/modules/services/hostapd.if |  1 +
 policy/modules/services/hostapd.te | 56 ++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+)
 create mode 100644 policy/modules/services/hostapd.fc
 create mode 100644 policy/modules/services/hostapd.if
 create mode 100644 policy/modules/services/hostapd.te

diff --git a/policy/modules/services/hostapd.fc b/policy/modules/services/hostapd.fc
new file mode 100644
index 00000000..83583a77
--- /dev/null
+++ b/policy/modules/services/hostapd.fc
@@ -0,0 +1,7 @@
+/usr/sbin/hostapd               --      gen_context(system_u:object_r:hostapd_exec_t,s0)
+
+/var/run/hostapd(/.*)?          gen_context(system_u:object_r:hostapd_var_run_t,s0)
+
+/etc/hostapd(/.*)?          gen_context(system_u:object_r:hostapd_conf_t,s0)
+
+/run/hostapd.pid                --      gen_context(system_u:object_r:hostapd_var_run_t,s0)
diff --git a/policy/modules/services/hostapd.if b/policy/modules/services/hostapd.if
new file mode 100644
index 00000000..fce874d2
--- /dev/null
+++ b/policy/modules/services/hostapd.if
@@ -0,0 +1 @@
+## <summary>IEEE 802.11 wireless LAN Host AP daemon.</summary>
diff --git a/policy/modules/services/hostapd.te b/policy/modules/services/hostapd.te
new file mode 100644
index 00000000..2db1e7de
--- /dev/null
+++ b/policy/modules/services/hostapd.te
@@ -0,0 +1,56 @@
+policy_module(hostapd, 1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type hostapd_t;
+type hostapd_exec_t;
+init_daemon_domain(hostapd_t, hostapd_exec_t)
+
+type hostapd_var_run_t;
+files_pid_file(hostapd_var_run_t)
+
+type hostapd_conf_t;
+files_type(hostapd_conf_t)
+
+########################################
+#
+# hostapd local policy
+#
+
+allow hostapd_t self:capability { fsetid chown net_admin net_raw dac_read_search dac_override };
+allow hostapd_t self:fifo_file rw_fifo_file_perms;
+allow hostapd_t self:unix_stream_socket create_stream_socket_perms;
+allow hostapd_t self:netlink_socket create_socket_perms;
+allow hostapd_t self:netlink_generic_socket create_socket_perms;
+allow hostapd_t self:netlink_route_socket create_netlink_socket_perms;
+allow hostapd_t self:packet_socket create_socket_perms;
+
+manage_dirs_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+manage_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+manage_lnk_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+manage_sock_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+files_pid_filetrans(hostapd_t, hostapd_var_run_t, { dir file lnk_file sock_file })
+
+read_files_pattern(hostapd_t, hostapd_conf_t, hostapd_conf_t)
+
+kernel_read_system_state(hostapd_t)
+kernel_read_network_state(hostapd_t)
+kernel_request_load_module(hostapd_t)
+kernel_rw_net_sysctls(hostapd_t)
+dev_rw_sysfs(hostapd_t)
+
+dev_read_rand(hostapd_t)
+dev_read_urand(hostapd_t)
+dev_read_sysfs(hostapd_t)
+dev_rw_wireless(hostapd_t)
+
+domain_use_interactive_fds(hostapd_t)
+
+auth_use_nsswitch(hostapd_t)
+
+logging_send_syslog_msg(hostapd_t)
+
+miscfiles_read_localization(hostapd_t)
-- 
2.19.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add hostapd service module
  2019-01-29 19:01 Alexander Miroshnichenko
@ 2019-01-29 23:42 ` Chris PeBenito
  0 siblings, 0 replies; 3+ messages in thread
From: Chris PeBenito @ 2019-01-29 23:42 UTC (permalink / raw)
  To: Alexander Miroshnichenko, selinux-refpolicy

On 1/29/19 2:01 PM, Alexander Miroshnichenko wrote:
> Add a SELinux Reference Policy module for the hostapd
> IEEE 802.11 wireless LAN Host AP daemon.
> ---
>   policy/modules/services/hostapd.fc |  7 ++++
>   policy/modules/services/hostapd.if |  1 +
>   policy/modules/services/hostapd.te | 56 ++++++++++++++++++++++++++++++
>   3 files changed, 64 insertions(+)
>   create mode 100644 policy/modules/services/hostapd.fc
>   create mode 100644 policy/modules/services/hostapd.if
>   create mode 100644 policy/modules/services/hostapd.te
> 
> diff --git a/policy/modules/services/hostapd.fc b/policy/modules/services/hostapd.fc
> new file mode 100644
> index 00000000..83583a77
> --- /dev/null
> +++ b/policy/modules/services/hostapd.fc
> @@ -0,0 +1,7 @@
> +/usr/sbin/hostapd               --      gen_context(system_u:object_r:hostapd_exec_t,s0)
> +
> +/var/run/hostapd(/.*)?          gen_context(system_u:object_r:hostapd_var_run_t,s0)
> +
> +/etc/hostapd(/.*)?          gen_context(system_u:object_r:hostapd_conf_t,s0)
> +
> +/run/hostapd.pid                --      gen_context(system_u:object_r:hostapd_var_run_t,s0)
> diff --git a/policy/modules/services/hostapd.if b/policy/modules/services/hostapd.if
> new file mode 100644
> index 00000000..fce874d2
> --- /dev/null
> +++ b/policy/modules/services/hostapd.if
> @@ -0,0 +1 @@
> +## <summary>IEEE 802.11 wireless LAN Host AP daemon.</summary>
> diff --git a/policy/modules/services/hostapd.te b/policy/modules/services/hostapd.te
> new file mode 100644
> index 00000000..2db1e7de
> --- /dev/null
> +++ b/policy/modules/services/hostapd.te
> @@ -0,0 +1,56 @@
> +policy_module(hostapd, 1.0.0)
> +
> +########################################
> +#
> +# Declarations
> +#
> +
> +type hostapd_t;
> +type hostapd_exec_t;
> +init_daemon_domain(hostapd_t, hostapd_exec_t)
> +
> +type hostapd_var_run_t;
> +files_pid_file(hostapd_var_run_t)
> +
> +type hostapd_conf_t;
> +files_type(hostapd_conf_t)
> +
> +########################################
> +#
> +# hostapd local policy
> +#
> +
> +allow hostapd_t self:capability { fsetid chown net_admin net_raw dac_read_search dac_override };
> +allow hostapd_t self:fifo_file rw_fifo_file_perms;
> +allow hostapd_t self:unix_stream_socket create_stream_socket_perms;
> +allow hostapd_t self:netlink_socket create_socket_perms;
> +allow hostapd_t self:netlink_generic_socket create_socket_perms;
> +allow hostapd_t self:netlink_route_socket create_netlink_socket_perms;
> +allow hostapd_t self:packet_socket create_socket_perms;
> +
> +manage_dirs_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
> +manage_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
> +manage_lnk_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
> +manage_sock_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
> +files_pid_filetrans(hostapd_t, hostapd_var_run_t, { dir file lnk_file sock_file })
> +
> +read_files_pattern(hostapd_t, hostapd_conf_t, hostapd_conf_t)
> +
> +kernel_read_system_state(hostapd_t)
> +kernel_read_network_state(hostapd_t)
> +kernel_request_load_module(hostapd_t)
> +kernel_rw_net_sysctls(hostapd_t)
> +dev_rw_sysfs(hostapd_t)
> +
> +dev_read_rand(hostapd_t)
> +dev_read_urand(hostapd_t)
> +dev_read_sysfs(hostapd_t)
> +dev_rw_wireless(hostapd_t)
> +
> +domain_use_interactive_fds(hostapd_t)
> +
> +auth_use_nsswitch(hostapd_t)
> +
> +logging_send_syslog_msg(hostapd_t)
> +
> +miscfiles_read_localization(hostapd_t)

Merged.

-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Add hostapd service module
@ 2019-01-29 19:01 Alexander Miroshnichenko
  2019-01-29 23:42 ` Chris PeBenito
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Miroshnichenko @ 2019-01-29 19:01 UTC (permalink / raw)
  To: selinux-refpolicy; +Cc: Alexander Miroshnichenko

Add a SELinux Reference Policy module for the hostapd
IEEE 802.11 wireless LAN Host AP daemon.
---
 policy/modules/services/hostapd.fc |  7 ++++
 policy/modules/services/hostapd.if |  1 +
 policy/modules/services/hostapd.te | 56 ++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+)
 create mode 100644 policy/modules/services/hostapd.fc
 create mode 100644 policy/modules/services/hostapd.if
 create mode 100644 policy/modules/services/hostapd.te

diff --git a/policy/modules/services/hostapd.fc b/policy/modules/services/hostapd.fc
new file mode 100644
index 00000000..83583a77
--- /dev/null
+++ b/policy/modules/services/hostapd.fc
@@ -0,0 +1,7 @@
+/usr/sbin/hostapd               --      gen_context(system_u:object_r:hostapd_exec_t,s0)
+
+/var/run/hostapd(/.*)?          gen_context(system_u:object_r:hostapd_var_run_t,s0)
+
+/etc/hostapd(/.*)?          gen_context(system_u:object_r:hostapd_conf_t,s0)
+
+/run/hostapd.pid                --      gen_context(system_u:object_r:hostapd_var_run_t,s0)
diff --git a/policy/modules/services/hostapd.if b/policy/modules/services/hostapd.if
new file mode 100644
index 00000000..fce874d2
--- /dev/null
+++ b/policy/modules/services/hostapd.if
@@ -0,0 +1 @@
+## <summary>IEEE 802.11 wireless LAN Host AP daemon.</summary>
diff --git a/policy/modules/services/hostapd.te b/policy/modules/services/hostapd.te
new file mode 100644
index 00000000..2db1e7de
--- /dev/null
+++ b/policy/modules/services/hostapd.te
@@ -0,0 +1,56 @@
+policy_module(hostapd, 1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type hostapd_t;
+type hostapd_exec_t;
+init_daemon_domain(hostapd_t, hostapd_exec_t)
+
+type hostapd_var_run_t;
+files_pid_file(hostapd_var_run_t)
+
+type hostapd_conf_t;
+files_type(hostapd_conf_t)
+
+########################################
+#
+# hostapd local policy
+#
+
+allow hostapd_t self:capability { fsetid chown net_admin net_raw dac_read_search dac_override };
+allow hostapd_t self:fifo_file rw_fifo_file_perms;
+allow hostapd_t self:unix_stream_socket create_stream_socket_perms;
+allow hostapd_t self:netlink_socket create_socket_perms;
+allow hostapd_t self:netlink_generic_socket create_socket_perms;
+allow hostapd_t self:netlink_route_socket create_netlink_socket_perms;
+allow hostapd_t self:packet_socket create_socket_perms;
+
+manage_dirs_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+manage_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+manage_lnk_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+manage_sock_files_pattern(hostapd_t, hostapd_var_run_t, hostapd_var_run_t)
+files_pid_filetrans(hostapd_t, hostapd_var_run_t, { dir file lnk_file sock_file })
+
+read_files_pattern(hostapd_t, hostapd_conf_t, hostapd_conf_t)
+
+kernel_read_system_state(hostapd_t)
+kernel_read_network_state(hostapd_t)
+kernel_request_load_module(hostapd_t)
+kernel_rw_net_sysctls(hostapd_t)
+dev_rw_sysfs(hostapd_t)
+
+dev_read_rand(hostapd_t)
+dev_read_urand(hostapd_t)
+dev_read_sysfs(hostapd_t)
+dev_rw_wireless(hostapd_t)
+
+domain_use_interactive_fds(hostapd_t)
+
+auth_use_nsswitch(hostapd_t)
+
+logging_send_syslog_msg(hostapd_t)
+
+miscfiles_read_localization(hostapd_t)
-- 
2.19.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-26 18:37 [PATCH] Add hostapd service module Alexander Miroshnichenko
2019-01-29 19:01 Alexander Miroshnichenko
2019-01-29 23:42 ` Chris PeBenito

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org selinux-refpolicy@archiver.kernel.org
	public-inbox-index selinux-refpolicy


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/ public-inbox