nepenthes policy
Hi,
attached you can find a reference policy for <subj>
"Nepenthes is a low interaction honeypot like honeyd or mwcollect. Low Interaction Honeypots emulate known vulnerabilities to collect information about potential attacks. Nepenthes is designed to emulate vulnerabilties worms use to spread, and to capture these worms."
http://nepenthes.sf.net
cheers,
peter
Signature · 4 lines
petre rodan <[email protected]> Developer, Hardened Gentoo Linux
#
# /etc # /etc/nepenthes(/.*)? gen_context(system_u:object_r:nepenthes_etc_t,s0)
#
# /usr # /usr/sbin/nepenthes -- gen_context(system_u:object_r:nepenthes_exec_t,s0)
#
# /var # /var/lib/cache/nepenthes(/.*)? gen_context(system_u:object_r:nepenthes_var_lib_t,s0) /var/lib/nepenthes(/.*)? gen_context(system_u:object_r:nepenthes_var_lib_t,s0) /var/log/nepenthes(/.*)? gen_context(system_u:object_r:nepenthes_var_log_t,s0)
## <summary>nepenthes low interaction honeypot</summary>
policy_module(nepenthes,1.0.0)
########################################
#
# Declarations
#
type nepenthes_t;
type nepenthes_exec_t;init_daemon_domain(nepenthes_t,nepenthes_exec_t)
type nepenthes_etc_t;files_type(nepenthes_etc_t)
type nepenthes_var_lib_t;files_type(nepenthes_var_lib_t)
type nepenthes_var_log_t;logging_log_file(nepenthes_var_log_t)
########################################
#
# nepenthes local policy #
allow nepenthes_t self:capability { chown dac_override net_bind_service setgid setuid }; allow nepenthes_t self:process { getcap setcap };
allow nepenthes_t self:tcp_socket create_stream_socket_perms;
allow nepenthes_t self:udp_socket create_socket_perms;
allow nepenthes_t self:unix_stream_socket { connect create };
allow nepenthes_t nepenthes_etc_t:dir r_dir_perms; allow nepenthes_t nepenthes_etc_t:file r_file_perms; allow nepenthes_t nepenthes_etc_t:lnk_file { getattr read }; allow nepenthes_t nepenthes_var_lib_t:dir rw_dir_perms; allow nepenthes_t nepenthes_var_lib_t:file create_file_perms; allow nepenthes_t nepenthes_var_log_t:dir rw_dir_perms; allow nepenthes_t nepenthes_var_log_t:file create_file_perms;
corenet_non_ipsec_sendrecv(nepenthes_t)corenet_tcp_bind_all_nodes(nepenthes_t)corenet_tcp_bind_all_ports(nepenthes_t)corenet_tcp_bind_inaddr_any_node(nepenthes_t)corenet_tcp_connect_all_ports(nepenthes_t)corenet_tcp_sendrecv_all_if(nepenthes_t)corenet_tcp_sendrecv_all_nodes(nepenthes_t)corenet_tcp_sendrecv_all_ports(nepenthes_t)corenet_udp_bind_all_nodes(nepenthes_t)corenet_udp_bind_all_ports(nepenthes_t)corenet_udp_bind_inaddr_any_node(nepenthes_t)corenet_udp_sendrecv_all_if(nepenthes_t)corenet_udp_sendrecv_all_nodes(nepenthes_t)corenet_udp_sendrecv_all_ports(nepenthes_t)
files_list_var_lib(nepenthes_t)files_read_etc_files(nepenthes_t)files_read_usr_files(nepenthes_t)files_search_pids(nepenthes_t)libs_use_ld_so(nepenthes_t)libs_use_shared_libs(nepenthes_t)logging_search_logs(nepenthes_t)miscfiles_read_localization(nepenthes_t)sysnet_read_config(nepenthes_t)
Quoted 7 lines · Petre Rodan
attached you can find a reference policy for <subj>
"Nepenthes is a low interaction honeypot like honeyd or mwcollect. Low Interaction Honeypots emulate known vulnerabilities to collect information about potential attacks. Nepenthes is designed to emulate vulnerabilties worms use to spread, and to capture these worms."
http://nepenthes.sf.net
Why not use honeypot_t?
Having one set of policy for all honeypot programs should work reasonably well. When we get the MCS changes as recently discussed merged it will be possible to isolate multiple instances of a single honeypot program (or multiple programs that perform the honeypot function) by categories.
Signature · 9 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 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Hi Russell,
Quoted 6 lines · Russell Coker
Quoted 5 lines
"Nepenthes is a low interaction honeypot like honeyd or mwcollect. Low Interaction Honeypots emulate known vulnerabilities to collect information about potential attacks. Nepenthes is designed to emulate vulnerabilties worms use to spread, and to capture these worms."
http://nepenthes.sf.net
Quoted 7 lines
Why not use
honeypot_t?Having one set of policy for all honeypot programs should work reasonably well.
When we get the MCS changes as recently discussed merged it will be
possible to isolate multiple instances of a single honeypot program (or multiple programs that perform the honeypot function) by categories.
I almost agree with your idea, but I think it be wiser to wait for another honeypot policy and decide at that point if it makes sense merging them into honeypot_t. for the time being I do not see another honeypot-related policy in cvs. specialized honeypots (ie spam traps) would need far less privileges then what we have now for nepenthes.
cheers,
peter
Signature · 4 lines
petre rodan <[email protected]> Developer, Hardened Gentoo Linux
Quoted 10 lines · Petre Rodan
Quoted 7 lines
Why not use
honeypot_t?Having one set of policy for all honeypot programs should work reasonably well.
When we get the MCS changes as recently discussed merged it will be
possible to isolate multiple instances of a single honeypot program (or multiple programs that perform the honeypot function) by categories.I almost agree with your idea, but I think it be wiser to wait for another honeypot policy and decide at that point if it makes sense merging them
Of course changing the names of domains is a minor pain and rarely gets done. More generally anything that involves removing lines from a .te file will take a lot of work to get accepted. It's best to do it right the first time.
Quoted 3 lines
into
honeypot_t. for the time being I do not see another honeypot-related policy in cvs. specialized honeypots (ie spam traps) would need far less privileges then what we have now for nepenthes.
Spam traps generally are not referred to as honeypots. When talking about a honeypot you are generally talking about a program to simulate a vulnerable system. Honeyd is almost synonymous with the term honeypot, it would be best to have a policy that supports nepenthes and honeyd and then for every new honeypot a decision would be made as to whether it should run in the same domain or a different one.
Why do you think that another honeypot policy won't be written? Surely it's inevitable that the most popular program which provides this service (honeyd) will get policy support.
Signature · 9 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 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Hi Russell,
Quoted 8 lines · Russell Coker
Honeyd is almost synonymous with the term honeypot, it would be best to have a policy that supports nepenthes and honeyd and then for every new honeypot a decision would be made as to whether it should run in the same domain or a different one.
Why do you think that another honeypot policy won't be written? Surely it's inevitable that the most popular program which provides this service (honeyd) will get policy support.
I said that a comparable policy is not on the horizon just yet, so I'm not sure it's a good thing to assume that future policies will look like what we have for nepenthes now. I'll have a look at honeyd maybe I can come up with a generic policy that would support both.
thanks for the feedback.
cheers,
peter
Signature · 4 lines
petre rodan <[email protected]> Developer, Hardened Gentoo Linux
Hi Russell,
Quoted 9 lines · Russell Coker
Quoted 8 lines · Petre Rodan
Quoted 7 lines
Why not use
honeypot_t?Having one set of policy for all honeypot programs should work reasonably well.
When we get the MCS changes as recently discussed merged it will be
possible to isolate multiple instances of a single honeypot program (or multiple programs that perform the honeypot function) by categories.
Quoted 6 lines
Quoted 2 lines
I almost agree with your idea, but I think it be wiser to wait for another honeypot policy and decide at that point if it makes sense merging them
Of course changing the names of domains is a minor pain and rarely gets done. More generally anything that involves removing lines from a .te file will take a lot of work to get accepted. It's best to do it right the first time.
I made a honeyd policy, hereby attached.
IMHO there is no reason to merge the two, because:
- rules differ a great deal between the two. similarities between the programs really end at their role
- having different policies for the two enables easier maintenance on the long run
- easier audit of the policy since it is clear which honeypot needs what
PS the honeyd policy will need tweaking, since I did not test all possible configurations and the internal webserver was unusable in my install. any feedback is appreciated.
bye,
peter
Signature · 4 lines
petre rodan <[email protected]> Developer, Hardened Gentoo Linux
#
# /etc # /etc/honeyd.conf -- gen_context(system_u:object_r:honeyd_etc_t,s0)
#
# /usr # /usr/bin/honeydctl -- gen_context(system_u:object_r:honeyd_ctl_exec_t,s0) /usr/sbin/honeyd -- gen_context(system_u:object_r:honeyd_exec_t,s0) /usr/share/honeyd(/.*)? gen_context(system_u:object_r:honeyd_data_t,s0) /usr/share/honeyd/scripts(/.*)?/.*.sh -- gen_context(system_u:object_r:honeyd_script_exec_t,s0) /usr/share/honeyd/scripts(/.*)?/.*.pl -- gen_context(system_u:object_r:honeyd_script_exec_t,s0) /usr/share/honeyd/webserver/htdocs(/.*) gen_context(system_u:object_r:honeyd_rwdata_t,s0)
#
# /var # /var/run/honeyd.pid -- gen_context(system_u:object_r:honeyd_var_run_t,s0) /var/run/honeyd.sock -s gen_context(system_u:object_r:honeyd_var_run_t,s0)
## <summary>honeyd honeypot</summary>
########################################
## <summary>
## Execute honeydctl in the honeyd_ctl domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`honeyd_domtrans_ctl',`
gen_require(`
type honeyd_ctl_t, honeyd_ctl_exec_t;
')
domain_auto_trans($1, honeyd_ctl_exec_t, honeyd_ctl_t)
allow honeyd_ctl_t $1:fd use;
allow honeyd_ctl_t $1:fifo_file { read write };
allow honeyd_ctl_t $1:process sigchld;')
########################################
## <summary>
## Allow the specified role the honeyd_ctl_t domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="role">
## <summary>
## The role to be allowed the honeyd_ctl domain.
## </summary>
## </param>
## <param name="terminal">
## <summary>
## The type of the terminal allow the honeyd_ctl domain to use.
## </summary>
## </param>
#
template(honeyd_run_ctl',
gen_require(`
type honeyd_ctl_t;
')
role $2 types honeyd_ctl_t;
honeyd_domtrans_ctl($1)
allow honeyd_ctl_t $3:chr_file { getattr read write ioctl };')
policy_module(honeyd,1.0.0)
########################################
#
# Declarations
#
type honeyd_t;
type honeyd_exec_t;init_daemon_domain(honeyd_t,honeyd_exec_t)
type honeyd_etc_t;files_type(honeyd_etc_t)
type honeyd_ctl_t;
type honeyd_ctl_exec_t;domain_type(honeyd_ctl_t)domain_entry_file(honeyd_ctl_t,honeyd_ctl_exec_t)
type honeyd_data_t;files_type(honeyd_data_t)
type honeyd_rwdata_t;files_type(honeyd_rwdata_t)
type honeyd_script_t;
type honeyd_script_exec_t; domain_type(honeyd_script_t) domain_entry_file(honeyd_script_t,honeyd_script_exec_t)
type honeyd_script_tmp_t;files_tmp_file(honeyd_script_tmp_t)
type honeyd_var_run_t;files_pid_file(honeyd_var_run_t)
########################################
#
# honeyd local policy #
allow honeyd_t self:capability { net_bind_service net_raw setgid setuid sys_resource }; allow honeyd_t self:packet_socket { bind create getopt ioctl read setopt }; allow honeyd_t self:process { setrlimit setsched };
allow honeyd_t self:rawip_socket create_socket_perms;
allow honeyd_t self:tcp_socket create_stream_socket_perms;
allow honeyd_t self:udp_socket create_socket_perms;
allow honeyd_t honeyd_data_t:dir r_dir_perms; allow honeyd_t honeyd_data_t:file r_file_perms; allow honeyd_t honeyd_etc_t:file r_file_perms; allow honeyd_t honeyd_rwdata_t:dir rw_dir_perms; allow honeyd_t honeyd_rwdata_t:file create_file_perms; allow honeyd_t honeyd_var_run_t:file create_file_perms; allow honeyd_t honeyd_var_run_t:sock_file create_file_perms;
kernel_read_kernel_sysctls(honeyd_t)
corenet_non_ipsec_sendrecv(honeyd_t)corenet_raw_send_generic_if(honeyd_t)corenet_raw_send_generic_node(honeyd_t)corenet_tcp_bind_http_port(honeyd_t)corenet_tcp_bind_inaddr_any_node(honeyd_t)corenet_tcp_connect_all_ports(honeyd_t)corenet_tcp_sendrecv_all_if(honeyd_t)corenet_tcp_sendrecv_all_nodes(honeyd_t)corenet_tcp_sendrecv_all_ports(honeyd_t)corenet_udp_sendrecv_all_if(honeyd_t)corenet_udp_sendrecv_all_nodes(honeyd_t)corenet_udp_sendrecv_all_ports(honeyd_t)
corecmd_exec_shell(honeyd_t) corecmd_getattr_bin_files(honeyd_t) corecmd_read_bin_symlinks(honeyd_t) corecmd_search_sbin(honeyd_t) files_pid_filetrans(honeyd_t,honeyd_var_run_t,{ file sock_file }) files_read_etc_files(honeyd_t) files_read_usr_files(honeyd_t) files_search_pids(honeyd_t)libs_use_ld_so(honeyd_t)libs_use_shared_libs(honeyd_t) logging_search_logs(honeyd_t) logging_send_syslog_msg(honeyd_t) miscfiles_read_localization(honeyd_t) sysnet_read_config(honeyd_t)
########################################
#
# honeydctl local policy #
allow honeyd_ctl_t self:process signal;
allow honeyd_ctl_t honeyd_t:unix_stream_socket connectto; allow honeyd_ctl_t honeyd_var_run_t:sock_file write;
files_read_etc_files(honeyd_ctl_t)libs_use_ld_so(honeyd_ctl_t)libs_use_shared_libs(honeyd_ctl_t)
########################################
#
# local policy for the honeyd scripts #
domain_auto_trans(honeyd_t,honeyd_script_exec_t,honeyd_script_t)
allow honeyd_script_t self:fifo_file rw_file_perms;
allow honeyd_script_t honeyd_t:fd use;
allow honeyd_script_t honeyd_t:packet_socket { read write }; allow honeyd_script_t honeyd_t:process sigchld;
allow honeyd_script_t honeyd_t:rawip_socket { read write }; allow honeyd_script_t honeyd_t:udp_socket { read write }; allow honeyd_script_t honeyd_t:unix_stream_socket rw_socket_perms;
allow honeyd_script_t honeyd_data_t:dir r_dir_perms; allow honeyd_script_t honeyd_data_t:file r_file_perms; allow honeyd_script_t honeyd_script_tmp_t:file create_file_perms;
corecmd_exec_bin(honeyd_script_t) files_read_etc_files(honeyd_script_t) files_tmp_filetrans(honeyd_script_t, honeyd_script_tmp_t, file) libs_use_ld_so(honeyd_script_t) libs_use_shared_libs(honeyd_script_t) miscfiles_read_localization(honeyd_script_t)
Index: policy/modules/system/userdomain.te
===================================================================
RCS file: /cvsroot/serefpolicy/refpolicy/policy/modules/system/userdomain.te,v retrieving revision 1.88
modules/system/userdomain.te +4 -0
@@ -228,6 +228,10 @@ ') optional_policy(` + honeyd_domtrans_ctl(sysadm_t,sysadm_r,admin_terminal) + ') + + optional_policy(` clock_run(sysadm_t,sysadm_r,admin_terminal) ')