All of lore.kernel.org
 help / color / mirror / Atom feed
* ntp policy
@ 2005-09-05 14:07 Christopher J. PeBenito
  2005-09-07 12:16 ` Daniel J Walsh
  0 siblings, 1 reply; 10+ messages in thread
From: Christopher J. PeBenito @ 2005-09-05 14:07 UTC (permalink / raw)
  To: SELinux Mail List

While converting the ntpd policy over to a reference policy module, I
came across a few lines which bring up questions.

	# so the start script can change firewall entries
	allow initrc_t net_conf_t:file { getattr read ioctl };

This looks like a distro-specific access, or perhaps it just made its
way in by accident?

	# for cron jobs
	# system_crond_t is not right, cron is not doing what it should
	ifdef(`crond.te', `
	system_crond_entry(ntpd_exec_t, ntpd_t)
	')

It is unclear to me what the comment means.  Also, shouldn't this be
ntpdate_exec_t instead of ntpd_exec_t?

	can_udp_send(ntpd_t, sysadm_t)
	can_udp_send(sysadm_t, ntpd_t)

There is no comment for these.  Are they needed for sysadm to run
ntpdate?

	ifdef(`winbind.te', `
	allow ntpd_t winbind_var_run_t:dir r_dir_perms;
	allow ntpd_t winbind_var_run_t:sock_file rw_file_perms;
	')

Generally when using a sock_file, a domain is connecting/sending to
another domain over a unix domain socket; however, after doing a few
rule searches in apol, I find no evidence that ntpd_t connects/sends to
winbind_t.  Is there some other purpose for these rules, or am I missing
something?

-- 
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* ntp policy
@ 2002-03-20 14:55 Russell Coker
  2002-03-20 21:01 ` Stephen Smalley
  0 siblings, 1 reply; 10+ messages in thread
From: Russell Coker @ 2002-03-20 14:55 UTC (permalink / raw)
  To: SE Linux

[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

Here's my latest effort at a ntpd policy, first the file_contexts entries:
/var/lib/ntp(|/.*)              system_u:object_r:var_lib_ntp_t
/etc/ntp.conf                   system_u:object_r:etc_ntp_t
/usr/sbin/ntpd                  system_u:object_r:ntpd_exec_t
/var/log/ntpstats(|/.*)         system_u:object_r:var_log_ntp_t
/var/log/ntpd                   system_u:object_r:var_log_ntp_t

I've attached the ntp.te file.

Note that I'm using my version of uses_shlib that is as follows:
define(`uses_shlib',`
allow $1 ld_so_t:file rx_file_perms;
allow $1 ld_so_t:file execute_no_trans;
allow $1 ld_so_t:lnk_file r_file_perms;
allow $1 shlib_t:file rx_file_perms;
allow $1 shlib_t:lnk_file r_file_perms;
allow $1 ld_so_cache_t:file r_file_perms;
allow $1 lib_t:dir r_dir_perms;
')

-- 
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

[-- Attachment #2: ntp.te --]
[-- Type: text/plain, Size: 1441 bytes --]

#
# Author:  Russell Coker <russell@coker.com.au>
#

#################################
#
# Rules for the ntpd_t domain.
#
type ntpd_t, domain, privlog;
type ntpd_exec_t, file_type, sysadmfile, exec_type;
type var_lib_ntp_t, file_type, sysadmfile;
type var_log_ntp_t, file_type, sysadmfile;
type etc_ntp_t, file_type, sysadmfile;

role system_r types ntpd_t;

# Inherit and use descriptors from init.
allow ntpd_t init_t:fd inherit_fd_perms;

allow ntpd_t init_t:process sigchld;

uses_shlib(ntpd_t)
allow ntpd_t root_t:dir r_dir_perms;

# Create pid file.
type var_run_ntp_t, file_type, sysadmfile, pidfile;
file_type_auto_trans(ntpd_t, var_run_t, var_run_ntp_t)
file_type_auto_trans(ntpd_t, var_log_t, var_log_ntp_t)

allow ntpd_t { var_lib_t usr_t }:dir r_dir_perms;
allow ntpd_t usr_t:file r_file_perms;
allow ntpd_t null_device_t:chr_file rw_file_perms;
allow ntpd_t { var_lib_ntp_t var_log_ntp_t }:dir rw_dir_perms;
allow ntpd_t { var_lib_ntp_t var_log_ntp_t }:file rw_file_perms;

allow ntpd_t self:capability { sys_time net_bind_service ipc_lock };

allow ntpd_t etc_t:dir r_dir_perms;
allow ntpd_t etc_t:lnk_file r_file_perms;
allow ntpd_t etc_ntp_t:file rw_file_perms;

# Use the network.
can_network(ntpd_t)
allow ntpd_t domain:packet_socket recvfrom;
allow ntpd_t self:unix_dgram_socket create_socket_perms;

allow ntpd_t self:process fork;

domain_auto_trans(initrc_t, ntpd_exec_t, ntpd_t)

allow ntpd_t fs_t:filesystem getattr;

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

end of thread, other threads:[~2005-09-07 13:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-05 14:07 ntp policy Christopher J. PeBenito
2005-09-07 12:16 ` Daniel J Walsh
2005-09-07 13:21   ` Christopher J. PeBenito
2005-09-07 13:27     ` Daniel J Walsh
  -- strict thread matches above, loose matches on Subject: below --
2002-03-20 14:55 Russell Coker
2002-03-20 21:01 ` Stephen Smalley
2002-03-20 21:06   ` Stephen Smalley
2002-03-20 22:00   ` Russell Coker
2002-03-21 19:15     ` Stephen Smalley
2002-03-21 22:05       ` Russell Coker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.