FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora SELinux Support

 
 
LinkBack Thread Tools
 
Old 12-19-2009, 08:51 AM
Dominick Grift
 
Default DenyHosts policy

Attached is DenyHosts modules Based on the Fedora 12 DenyHosts package.

Maintained here: git clone git://82.197.205.60/selinux-modules.git

/etc/rc.d/init.d/denyhosts -- gen_context(system_ubject_r:denyhosts_initrc_exe c_t, s0)

/usr/bin/denyhosts.py -- gen_context(system_ubject_r:denyhosts_exec_t, s0)

/var/lib/denyhosts(/.*)? gen_context(system_ubject_r:denyhosts_var_lib_t, s0)
/var/lock/subsys/denyhosts -- gen_context(system_ubject_r:denyhosts_var_lock_t , s0)
/var/log/denyhosts(/.*)? gen_context(system_ubject_r:denyhosts_var_log_t, s0)
## <summary>Deny Hosts.</summary>
## <desc>
## <p>
## DenyHosts is a script intended to be run by Linux
## system administrators to help thwart SSH server attacks
## (also known as dictionary based attacks and brute force
## attacks).
## </p>
## </desc>

########################################
## <summary>
## Execute a domain transition to run denyhosts.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`denyhosts_domtrans', `
gen_require(`
type denyhosts_t, denyhosts_exec_t;
')

domtrans_pattern($1, denyhosts_exec_t, denyhosts_t)
')

########################################
## <summary>
## Execute ksmtuned server in the ksmtuned domain.
## </summary>
## <param name="domain">
## <summary>
## The type of the process performing this action.
## </summary>
## </param>
#
interface(`denyhosts_initrc_domtrans', `
gen_require(`
type denyhosts_initrc_exec_t;
')

init_labeled_script_domtrans($1, denyhosts_initrc_exec_t)
')

########################################
## <summary>
## All of the rules required to administrate
## an denyhosts environment.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`denyhosts_admin', `
gen_require(`
type denyhosts_t, denyhosts_var_lib_t, denyhosts_var_lock_t;
type denyhosts_var_log_t;
')

allow $1 denyhosts_trocess { ptrace signal_perms getattr };
read_files_pattern($1, denyhosts_t, denyhosts_t)

files_list_pids($1)
admin_pattern($1, denyhosts_var_run_t)

logging_search_logs($1)
admin_pattern($1, denyhosts_var_log_t)

files_search_locks($1)
admin_pattern($1, denyhosts_var_lock_t)

denyhosts_initrc_domtrans($1)
domain_system_change_exemption($1)
role_transition $2 denyhosts_initrc_exec_t system_r;
allow $2 system_r;

kernel_search_proc($1)
allow $1 denyhosts_t:dir list_dir_perms;
ps_process_pattern($1, denyhosts_t)
read_lnk_files_pattern($1, denyhosts_t, denyhosts_t)
')

policy_module(denyhosts, 1.0.0)

########################################
#
# DenyHosts personal declarations.
#

type denyhosts_t;
type denyhosts_exec_t;
init_daemon_domain(denyhosts_t, denyhosts_exec_t)

type denyhosts_initrc_exec_t;
init_script_file(denyhosts_initrc_exec_t)

type denyhosts_var_lib_t;
files_type(denyhosts_var_lib_t)

type denyhosts_var_lock_t;
files_lock_file(denyhosts_var_lock_t)

type denyhosts_var_log_t;
logging_log_file(denyhosts_var_log_t)

########################################
#
# DenyHosts personal policy.
#

allow denyhosts_t self:netlink_route_socket create_netlink_socket_perms;
allow denyhosts_t self:tcp_socket create_socket_perms;
allow denyhosts_t self:udp_socket create_socket_perms;

manage_files_pattern(denyhosts_t, denyhosts_var_lib_t, denyhosts_var_lib_t)
files_var_lib_filetrans(denyhosts_t, denyhosts_var_lib_t, file)

manage_dirs_pattern(denyhosts_t, denyhosts_var_lock_t, denyhosts_var_lock_t)
manage_files_pattern(denyhosts_t, denyhosts_var_lock_t, denyhosts_var_lock_t)
files_lock_filetrans(denyhosts_t, denyhosts_var_lock_t, { dir file })

append_files_pattern(denyhosts_t, denyhosts_var_log_t, denyhosts_var_log_t)
create_files_pattern(denyhosts_t, denyhosts_var_log_t, denyhosts_var_log_t)
read_files_pattern(denyhosts_t, denyhosts_var_log_t, denyhosts_var_log_t)
setattr_files_pattern(denyhosts_t, denyhosts_var_log_t, denyhosts_var_log_t)
logging_log_filetrans(denyhosts_t, denyhosts_var_log_t, file)

corecmd_list_bin(denyhosts_t)
corecmd_read_bin_symlinks(denyhosts_t)

corenet_all_recvfrom_unlabeled(denyhosts_t)
corenet_all_recvfrom_netlabel(denyhosts_t)
corenet_tcp_sendrecv_generic_if(denyhosts_t)
corenet_tcp_sendrecv_generic_node(denyhosts_t)
corenet_tcp_bind_generic_node(denyhosts_t)
corenet_sendrecv_smtp_client_packets(denyhosts_t)
corenet_tcp_connect_smtp_port(denyhosts_t)

dev_read_urand(denyhosts_t)

# /etc/hosts.deny
files_rw_etc_files(denyhosts_t)

kernel_read_system_state(denyhosts_t)

# /var/log/secure
logging_read_generic_logs(denyhosts_t)

miscfiles_read_localization(denyhosts_t)

sysnet_read_config(denyhosts_t)

optional_policy(`
cron_system_entry(denyhosts_t, denyhosts_exec_t)
')
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 12-21-2009, 10:57 AM
Miroslav Grepl
 
Default DenyHosts policy

On 12/19/2009 10:51 AM, Dominick Grift wrote:

Attached is DenyHosts modules Based on the Fedora 12 DenyHosts package.

Maintained here: git clone git://82.197.205.60/selinux-modules.git




--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list

From denyhosts.te:

# /etc/hosts.deny
files_rw_etc_files(denyhosts_t)

Dominick,
I believe we shouldn't add this permission to denyhosts.

Dan,
maybe other candidate for system_conf_t type as well as sysctl.conf.

Regards,
Miroslav



--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 12-21-2009, 11:43 AM
Dominick Grift
 
Default DenyHosts policy

On Mon, Dec 21, 2009 at 12:57:49PM +0100, Miroslav Grepl wrote:
> On 12/19/2009 10:51 AM, Dominick Grift wrote:
> >Attached is DenyHosts modules Based on the Fedora 12 DenyHosts package.
> >
> >Maintained here: git clone git://82.197.205.60/selinux-modules.git
> >
> >
> >
> >--
> >fedora-selinux-list mailing list
> >fedora-selinux-list@redhat.com
> >https://www.redhat.com/mailman/listinfo/fedora-selinux-list
> From denyhosts.te:
>
> # /etc/hosts.deny
> files_rw_etc_files(denyhosts_t)
>
> Dominick,
> I believe we shouldn't add this permission to denyhosts.
>
> Dan,
> maybe other candidate for system_conf_t type as well as sysctl.conf.

Agreed. Same could be said for /var/log/secure being generic var_log_t?
>
> Regards,
> Miroslav
>
--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 12-22-2009, 02:33 PM
Daniel J Walsh
 
Default DenyHosts policy

On 12/21/2009 07:43 AM, Dominick Grift wrote:
> On Mon, Dec 21, 2009 at 12:57:49PM +0100, Miroslav Grepl wrote:
>> On 12/19/2009 10:51 AM, Dominick Grift wrote:
>>> Attached is DenyHosts modules Based on the Fedora 12 DenyHosts package.
>>>
>>> Maintained here: git clone git://82.197.205.60/selinux-modules.git
>>>
>>>
>>>
>>> --
>>> fedora-selinux-list mailing list
>>> fedora-selinux-list@redhat.com
>>> https://www.redhat.com/mailman/listinfo/fedora-selinux-list
>> From denyhosts.te:
>>
>> # /etc/hosts.deny
>> files_rw_etc_files(denyhosts_t)
>>
>> Dominick,
>> I believe we shouldn't add this permission to denyhosts.
>>
>> Dan,
>> maybe other candidate for system_conf_t type as well as sysctl.conf.
>
> Agreed. Same could be said for /var/log/secure being generic var_log_t?
>>
>> Regards,
>> Miroslav
>>
>>
>>
>> --
>> fedora-selinux-list mailing list
>> fedora-selinux-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-selinux-list
Would net_conf_t make more sense?

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 12-22-2009, 02:35 PM
Daniel J Walsh
 
Default DenyHosts policy

On 12/21/2009 07:43 AM, Dominick Grift wrote:
> On Mon, Dec 21, 2009 at 12:57:49PM +0100, Miroslav Grepl wrote:
>> On 12/19/2009 10:51 AM, Dominick Grift wrote:
>>> Attached is DenyHosts modules Based on the Fedora 12 DenyHosts package.
>>>
>>> Maintained here: git clone git://82.197.205.60/selinux-modules.git
>>>
>>>
>>>
>>> --
>>> fedora-selinux-list mailing list
>>> fedora-selinux-list@redhat.com
>>> https://www.redhat.com/mailman/listinfo/fedora-selinux-list
>> From denyhosts.te:
>>
>> # /etc/hosts.deny
>> files_rw_etc_files(denyhosts_t)
>>
>> Dominick,
>> I believe we shouldn't add this permission to denyhosts.
>>
>> Dan,
>> maybe other candidate for system_conf_t type as well as sysctl.conf.
>
> Agreed. Same could be said for /var/log/secure being generic var_log_t?
>>
>> Regards,
>> Miroslav
>>
>>
>>
>> --
>> fedora-selinux-list mailing list
>> fedora-selinux-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-selinux-list

sysnet_manage_config(denyhosts_t)
sysnet_etc_filetrans_config(denyhosts_t)

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 

Thread Tools




All times are GMT. The time now is 07:05 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org