Skip to contentSkip to conversation

fireflier (cool firewall program) policy files

DISCUSSION Luke Kenneth Casson Leighton 2 participants 2 messages Jun 6, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

fireflier is a client-server architecture firewall program that uses ip queueing to block packets until you've approved or rejected them.

only used it the once and love it already: you can set it to approve packets on a per-program-name basis as well which i persn'y really like.

my bug-bear with the program and the corresponding policy i had to create is that it demands to know the names of all programs it could possibly want to tell you about, and so it does a quite extensive directory search.

therefore i added the last two lines as an "afterthought".

l.

Signature · 9 lines
-- 
expecting email to be received and understood is a bit like
picking up the telephone and immediately dialing without
checking for a dial-tone; speaking immediately without listening
for either an answer or ring-tone; hanging up immediately and
believing that you have actually started a conversation.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:[email protected]"> [email protected] </a> <br />
# fireflier firewall
/usr/sbin/fireflierd		--	system_u:object_r:fireflier_exec_t
/etc/fireflier(/.*)?			system_u:object_r:fireflier_etc_t
/etc/fireflier/fireflier.conf	--	system_u:object_r:fireflier_conf_t
/var/lib/fireflier(/.*)?		system_u:object_r:fireflier_var_lib_t

#DESC FireFlier - Firewall Server
#
# Author: Luke Kenneth Casson Leighton <[email protected]> # X-Debian-Packages: fireflier-server, fireflier-client-kde #

daemon_domain(fireflier)

can_network(fireflier_t)
logdir_domain(fireflier)

type fireflier_conf_t, file_type, sysadmfile;
type fireflier_etc_t, file_type, sysadmfile;
type fireflier_var_lib_t, file_type, sysadmfile;

domain_auto_trans(initrc_t, fireflier_exec_t, fireflier_t)

#allow fireflier_t self:capability { net_admin net_bind_service }; file_type_auto_trans(fireflier_t, etc_t, fireflier_etc_t, file) file_type_auto_trans(fireflier_t, fireflier_etc_t, fireflier_conf_t, file) file_type_auto_trans(fireflier_t, var_run_t, fireflier_var_run_t, sock_file) file_type_auto_trans(fireflier_t, var_lib_t, fireflier_var_lib_t, file)

# startup script /etc/init.d/fireflier needs to read the config file
allow initrc_t fireflier_conf_t:file { read };

allow fireflier_t fireflier_t:unix_dgram_socket { getattr create connect write }; allow fireflier_t fireflier_t:netlink_socket { create bind write read getattr }; allow fireflier_t fireflier_t:unix_stream_socket { create connect }; allow fireflier_t port_t:tcp_socket { name_bind };

allow fireflier_t sbin_t:dir { search };
allow fireflier_t bin_t:dir { search };
allow fireflier_t iptables_exec_t:file { getattr execute execute_no_trans read }; allow fireflier_t var_lib_t:dir { search };
allow fireflier_t bin_t:lnk_file { read };
allow fireflier_t shell_exec_t:file { getattr execute execute_no_trans read };

allow fireflier_t fireflier_t:capability { net_admin net_raw };

allow fireflier_t etc_runtime_t:file { read getattr }; allow fireflier_t etc_t:file { read };
allow fireflier_t proc_t:file { read getattr };

allow fireflier_t fireflier_var_lib_t:dir { add_name search write };

allow fireflier_t fireflier_t:rawip_socket { create getopt setopt }; allow fireflier_t sysctl_modprobe_t:file { read };

allow fireflier_t insmod_exec_t:file { execute execute_no_trans };

# this is *sigh* to allow the daemon to read program names
# so that it can tell users what program is doing network access.
allow fireflier_t default_t:dir r_dir_perms;
allow fireflier_t default_t:notdevfile_class_set r_file_perms;
#1 lore raw
Quoted 7 lines · Luke Kenneth Casson Leighton

fireflier is a client-server architecture firewall program that uses ip queueing to block packets until you've approved or rejected them.

only used it the once and love it already: you can set it to approve packets on a per-program-name basis as well which i persn'y really like.

Quoted 6 lines

my bug-bear with the program and the corresponding policy i had to create is that it demands to know the names of all programs it could possibly want to tell you about, and so it does a quite extensive directory search.

therefore i added the last two lines as an "afterthought".

I've attached a version with some suggested changes.

Having two types fireflier_etc_t and fireflier_conf_t which are both writable by the daemon seems to provide no benefit.

Allowing iptables to be executed in the same domain is a bad idea, it should run in it's own domain (and fireflier_t can probably lose some permissions as a result).

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

#DESC FireFlier - Firewall Server
#
# Author: Luke Kenneth Casson Leighton <[email protected]> # X-Debian-Packages: fireflier-server, fireflier-client-kde #

daemon_domain(fireflier)

can_network(fireflier_t)
logdir_domain(fireflier)

type fireflier_conf_t, file_type, sysadmfile;
type fireflier_etc_t, file_type, sysadmfile;
type fireflier_var_lib_t, file_type, sysadmfile;

domain_auto_trans(initrc_t, fireflier_exec_t, fireflier_t)

#allow fireflier_t self:capability { net_admin net_bind_service }; file_type_auto_trans(fireflier_t, etc_t, fireflier_etc_t, file) file_type_auto_trans(fireflier_t, fireflier_etc_t, fireflier_conf_t, file) file_type_auto_trans(fireflier_t, var_run_t, fireflier_var_run_t, sock_file) file_type_auto_trans(fireflier_t, var_lib_t, fireflier_var_lib_t, file)

# startup script /etc/init.d/fireflier needs to read the config file
allow initrc_t fireflier_conf_t:file { getattr read };

allow fireflier_t self:unix_dgram_socket create_socket_perms; allow fireflier_t self:netlink_socket { create bind write read getattr }; allow fireflier_t self:unix_stream_socket create_stream_socket_perms; allow fireflier_t port_t:tcp_socket name_bind;

allow fireflier_t { sbin_t bin_t }:dir search; domain_auto_trans(fireflier_t, iptables_exec_t, iptables_t) allow fireflier_t var_lib_t:dir search;
allow fireflier_t bin_t:lnk_file read; can_exec(fireflier_t, shell_exec_t)

allow fireflier_t self:capability { net_admin net_raw };

allow fireflier_t etc_runtime_t:file { read getattr }; allow fireflier_t etc_t:file { getattr read }; allow fireflier_t proc_t:file { read getattr };

allow fireflier_t fireflier_var_lib_t:dir { add_name search write };

allow fireflier_t self:rawip_socket { create getopt setopt }; allow fireflier_t sysctl_modprobe_t:file { getattr read };

# this is *sigh* to allow the daemon to read program names
# so that it can tell users what program is doing network access.
allow fireflier_t exec_type:file { getattr read };