Chris PeBenito e181fe
Chris PeBenito 21673b
policy_module(corenetwork, 1.13.6)
Chris PeBenito 960373
Chris PeBenito fd89e1
########################################
Chris PeBenito fd89e1
#
Chris PeBenito fd89e1
# Declarations
Chris PeBenito fd89e1
#
Chris PeBenito fd89e1
Chris PeBenito 2f8eec
attribute client_packet_type;
Chris PeBenito b4cd15
attribute netif_type;
Chris PeBenito b4cd15
attribute node_type;
Chris PeBenito a013b5
attribute packet_type;
Chris PeBenito b4cd15
attribute port_type;
Chris PeBenito b4cd15
attribute reserved_port_type;
Chris PeBenito e99359
attribute rpc_port_type;
Chris PeBenito 2f8eec
attribute server_packet_type;
Chris PeBenito b4cd15
Chris PeBenito b518fc
attribute corenet_unconfined_type;
Chris PeBenito b518fc
Chris PeBenito 05a5cd
type ppp_device_t;
Chris PeBenito c9428d
dev_node(ppp_device_t)
Chris PeBenito 05a5cd
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# tun_tap_device_t is the type of /dev/net/tun/* and /dev/net/tap/*
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type tun_tap_device_t;
Chris PeBenito c9428d
dev_node(tun_tap_device_t)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito c89024
# Ports and packets
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito 35a4b3
# client_packet_t is the default type of IPv4 and IPv6 client packets.
Chris PeBenito c89024
#
Chris PeBenito 35a4b3
type client_packet_t, packet_type, client_packet_type;
Chris PeBenito c89024
Chris PeBenito c89024
#
Chris PeBenito 190066
# The netlabel_peer_t is used by the kernel's NetLabel subsystem for network
Chris PeBenito 190066
# connections using NetLabel which do not carry full SELinux contexts.
Chris PeBenito 190066
#
Chris PeBenito 190066
type netlabel_peer_t;
Chris PeBenito 190066
sid netmsg gen_context(system_u:object_r:netlabel_peer_t,mls_systemhigh)
Chris PeBenito 190066
Chris PeBenito 190066
#
Chris PeBenito b4cd15
# port_t is the default type of INET port numbers.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type port_t, port_type;
Chris PeBenito e02c61
sid port gen_context(system_u:object_r:port_t,s0)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# reserved_port_t is the type of INET port numbers below 1024.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type reserved_port_t, port_type, reserved_port_type;
Chris PeBenito b4cd15
Chris PeBenito 35a4b3
#
Chris PeBenito 495df4
# hi_reserved_port_t is the type of INET port numbers between 600-1023.
Chris PeBenito 495df4
#
Chris PeBenito 495df4
type hi_reserved_port_t, port_type, reserved_port_type, rpc_port_type;
Chris PeBenito 495df4
Chris PeBenito 495df4
#
Chris PeBenito 35a4b3
# server_packet_t is the default type of IPv4 and IPv6 server packets.
Chris PeBenito 35a4b3
#
Chris PeBenito 35a4b3
type server_packet_t, packet_type, server_packet_type;
Chris PeBenito 35a4b3
Chris PeBenito 0907bd
network_port(afs_bos, udp,7007,s0)
Chris PeBenito 0907bd
network_port(afs_fs, tcp,2040,s0, udp,7000,s0, udp,7005,s0)
Chris PeBenito 0907bd
network_port(afs_ka, udp,7004,s0)
Chris PeBenito 0907bd
network_port(afs_pt, udp,7002,s0)
Chris PeBenito 0907bd
network_port(afs_vl, udp,7003,s0)
Chris PeBenito 80348b
network_port(agentx, udp,705,s0, tcp,705,s0)
Chris PeBenito 0d0d2b
network_port(amanda, udp,10080,s0, tcp,10080,s0, udp,10081,s0, tcp,10081,s0, tcp,10082,s0, tcp,10083,s0)
Chris PeBenito 0907bd
network_port(amavisd_recv, tcp,10024,s0)
Chris PeBenito 0907bd
network_port(amavisd_send, tcp,10025,s0)
Chris PeBenito 495df4
network_port(aol, udp,5190,s0, tcp,5190,s0, udp,5191,s0, tcp,5191,s0, udp,5192,s0, tcp,5192,s0, udp,5193,s0, tcp,5193,s0) 
Chris PeBenito c412be
network_port(apcupsd, tcp,3551,s0, udp,3551,s0)
Chris PeBenito 32f27a
network_port(asterisk, tcp,1720,s0, udp,2427,s0, udp,2727,s0, udp,4569,s0)
Chris PeBenito 06099d
network_port(audit, tcp,60,s0)
Chris PeBenito 2705f9
network_port(auth, tcp,113,s0)
Chris PeBenito 465510
network_port(bgp, tcp,179,s0, udp,179,s0, tcp,2605,s0, udp,2605,s0)
Chris PeBenito 34e722
type biff_port_t, port_type, reserved_port_type; dnl network_port(biff) # no defined portcon in current strict
Chris PeBenito 339235
network_port(certmaster, tcp,51235,s0)
Chris PeBenito a51379
network_port(chronyd, udp,323,s0)
Chris PeBenito 0907bd
network_port(clamd, tcp,3310,s0)
Chris PeBenito 0907bd
network_port(clockspeed, udp,4041,s0)
Chris PeBenito fa45da
network_port(cluster, tcp,5149,s0, udp,5149,s0, tcp,40040,s0, tcp,50006,s0, udp,50006,s0, tcp,50007,s0, udp,50007,s0, tcp,50008,s0, udp,50008,s0)
Dominick Grift 1031ee
network_port(cobbler, tcp,25151,s0)
Chris PeBenito 19b555
network_port(comsat, udp,512,s0)
Chris PeBenito 0907bd
network_port(cvs, tcp,2401,s0, udp,2401,s0)
Chris PeBenito edb7b9
network_port(cyphesis, tcp,6767,s0, tcp,6769,s0, udp,32771,s0)
Chris PeBenito 0d0d2b
network_port(dbskkd, tcp,1178,s0)
Chris PeBenito edb7b9
network_port(dcc, udp,6276,s0, udp,6277,s0)
Chris PeBenito 9de7c1
network_port(dccm, tcp,5679,s0, udp,5679,s0)
Chris PeBenito 0d0d2b
network_port(dhcpc, udp,68,s0)
Chris PeBenito 99282e
network_port(dhcpd, udp,67,s0, tcp,647,s0, udp,647,s0, tcp,847,s0, udp,847,s0, tcp,7911,s0)
Chris PeBenito 0d0d2b
network_port(dict, tcp,2628,s0)
Chris PeBenito 710791
network_port(distccd, tcp,3632,s0)
Chris PeBenito 0d0d2b
network_port(dns, udp,53,s0, tcp,53,s0)
Chris PeBenito 0d0d2b
network_port(fingerd, tcp,79,s0)
Chris PeBenito 21673b
network_port(ftp, tcp,21,s0, tcp,990,s0, udp,990,s0)
Chris PeBenito edb7b9
network_port(ftp_data, tcp,20,s0)
Chris PeBenito 710791
network_port(gatekeeper, udp,1718,s0, udp,1719,s0, tcp,1721,s0, tcp,7000,s0)
Chris PeBenito 0907bd
network_port(giftd, tcp,1213,s0)
Chris PeBenito d2acef
network_port(git, tcp,9418,s0, udp,9418,s0)
Chris PeBenito 0907bd
network_port(gopher, tcp,70,s0, udp,70,s0)
Chris PeBenito cca4a2
network_port(gpsd, tcp,2947,s0)
Chris PeBenito aa8300
network_port(hddtemp, tcp,7634,s0)
Chris PeBenito 0d0d2b
network_port(howl, tcp,5335,s0, udp,5353,s0)
Chris PeBenito 495df4
network_port(hplip, tcp,1782,s0, tcp,2207,s0, tcp,2208,s0, tcp, 8290,s0, tcp,50000,s0, tcp,50002,s0, tcp,8292,s0, tcp,9100,s0, tcp,9101,s0, tcp,9102,s0, tcp,9220,s0, tcp,9221,s0, tcp,9222,s0, tcp,9280,s0, tcp,9281,s0, tcp,9282,s0, tcp,9290,s0, tcp,9291,s0, tcp,9292,s0)
Chris PeBenito edb7b9
network_port(http, tcp,80,s0, tcp,443,s0, tcp,488,s0, tcp,8008,s0, tcp,8009,s0, tcp,8443,s0) #8443 is mod_nss default port
Chris PeBenito edb7b9
network_port(http_cache, tcp,3128,s0, udp,3130,s0, tcp,8080,s0, tcp,8118,s0) # 8118 is for privoxy
Chris PeBenito 4093c2
network_port(i18n_input, tcp,9010,s0)
Chris PeBenito 0907bd
network_port(imaze, tcp,5323,s0, udp,5323,s0)
Chris PeBenito 495df4
network_port(inetd_child, tcp,1,s0, udp,1,s0, tcp,7,s0, udp,7,s0, tcp,9,s0, udp,9,s0, tcp,13,s0, udp,13,s0, tcp,19,s0, udp,19,s0, tcp,37,s0, udp,37,s0, tcp,512,s0, tcp,543,s0, tcp,544,s0, tcp,891,s0, udp,891,s0, tcp,892,s0, udp,892,s0, tcp,2105,s0, tcp,5666,s0)
Chris PeBenito 0d0d2b
network_port(innd, tcp,119,s0)
Chris PeBenito edb7b9
network_port(ipmi, udp,623,s0, udp,664,s0)
Chris PeBenito 0d0d2b
network_port(ipp, tcp,631,s0, udp,631,s0)
Chris PeBenito 495df4
network_port(ipsecnat, tcp,4500,s0, udp,4500,s0)
Chris PeBenito 0907bd
network_port(ircd, tcp,6667,s0)
Chris PeBenito 0907bd
network_port(isakmp, udp,500,s0)
Chris PeBenito d9845a
network_port(iscsi, tcp,3260,s0)
Chris PeBenito e0ed76
network_port(isns, tcp,3205,s0, udp,3205,s0)
Chris PeBenito 0907bd
network_port(jabber_client, tcp,5222,s0, tcp,5223,s0)
Chris PeBenito 0907bd
network_port(jabber_interserver, tcp,5269,s0)
Chris PeBenito edb7b9
network_port(kerberos, tcp,88,s0, udp,88,s0, tcp,750,s0, udp,750,s0)
Chris PeBenito 0d0d2b
network_port(kerberos_admin, tcp,464,s0, udp,464,s0, tcp,749,s0)
Chris PeBenito 0d0d2b
network_port(kerberos_master, tcp,4444,s0, udp,4444,s0)
Chris PeBenito edb7b9
network_port(kismet, tcp,2501,s0)
Chris PeBenito 8f800d
network_port(kprop, tcp,754,s0)
Chris PeBenito 0d0d2b
network_port(ktalkd, udp,517,s0, udp,518,s0)
Chris PeBenito 495df4
network_port(ldap, tcp,389,s0, udp,389,s0, tcp,636,s0, udp,636,s0, tcp,3268,s0)
Chris PeBenito a5e213
network_port(lmtp, tcp,24,s0, udp,24,s0)
Chris PeBenito edb7b9
type lrrd_port_t, port_type; dnl network_port(lrrd_port_t) # no defined portcon
Chris PeBenito 0d0d2b
network_port(mail, tcp,2000,s0)
Chris PeBenito 04d286
network_port(memcache, tcp,11211,s0, udp,11211,s0)
Chris PeBenito 8242f5
network_port(mmcc, tcp,5050,s0, udp,5050,s0)
Chris PeBenito 0907bd
network_port(monopd, tcp,1234,s0)
Chris PeBenito 495df4
network_port(msnp, tcp,1863,s0, udp,1863,s0)
Chris PeBenito ce6fee
network_port(munin, tcp,4949,s0, udp,4949,s0)
Chris PeBenito 495df4
network_port(mysqld, tcp,1186,s0, tcp,3306,s0)
Chris PeBenito 495df4
portcon tcp 63132-63163 gen_context(system_u:object_r:mysqld_port_t, s0)
Chris PeBenito 0907bd
network_port(nessus, tcp,1241,s0)
Chris PeBenito fa45da
network_port(netsupport, tcp,5405,s0, udp,5405,s0)
Chris PeBenito 697489
network_port(nmbd, udp,137,s0, udp,138,s0)
Chris PeBenito b11a75
network_port(ntp, udp,123,s0)
Chris PeBenito d6d16b
network_port(ocsp, tcp,9080,s0)
Chris PeBenito 6b19be
network_port(openvpn, tcp,1194,s0, udp,1194,s0)
Chris PeBenito 77f6e2
network_port(pegasus_http, tcp,5988,s0)
Chris PeBenito 77f6e2
network_port(pegasus_https, tcp,5989,s0)
Chris PeBenito a46b60
network_port(pgpkeyserver, udp, 11371,s0, tcp,11371,s0)
Chris PeBenito edb7b9
network_port(pingd, tcp,9125,s0)
Chris PeBenito 0907bd
network_port(pop, tcp,106,s0, tcp,109,s0, tcp,110,s0, tcp,143,s0, tcp,220,s0, tcp,993,s0, tcp,995,s0, tcp,1109,s0)
Chris PeBenito 0d0d2b
network_port(portmap, udp,111,s0, tcp,111,s0)
Chris PeBenito edb7b9
network_port(postfix_policyd, tcp,10031,s0)
Chris PeBenito 0d0d2b
network_port(postgresql, tcp,5432,s0)
Chris PeBenito 0907bd
network_port(postgrey, tcp,60000,s0)
Chris PeBenito 339235
network_port(prelude, tcp,4690,s0, udp,4690,s0)
Chris PeBenito 0d0d2b
network_port(printer, tcp,515,s0)
Chris PeBenito 0907bd
network_port(ptal, tcp,5703,s0)
Chris PeBenito edb7b9
network_port(pulseaudio, tcp,4713,s0)
Craig Grube e87791
network_port(puppet, tcp, 8140, s0)
Chris PeBenito 0d0d2b
network_port(pxe, udp,4011,s0)
Chris PeBenito 0907bd
network_port(pyzor, udp,24441,s0)
Chris PeBenito 0d0d2b
network_port(radacct, udp,1646,s0, udp,1813,s0)
Chris PeBenito 0d0d2b
network_port(radius, udp,1645,s0, udp,1812,s0)
Chris PeBenito f3fcad
network_port(radsec, tcp,2083,s0)
Chris PeBenito 0907bd
network_port(razor, tcp,2703,s0)
Chris PeBenito fa45da
network_port(ricci, tcp,11111,s0, udp,11111,s0)
Chris PeBenito fa45da
network_port(ricci_modcluster, tcp,16851,s0, udp,16851,s0)
Chris PeBenito 710791
network_port(rlogind, tcp,513,s0)
Chris PeBenito 0907bd
network_port(rndc, tcp,953,s0)
Chris PeBenito a71e13
network_port(router, udp,520,s0, udp,521,s0, tcp,521,s0)
Chris PeBenito 0d0d2b
network_port(rsh, tcp,514,s0)
Chris PeBenito 0d0d2b
network_port(rsync, tcp,873,s0, udp,873,s0)
Chris PeBenito 6a2975
network_port(rwho, udp,513,s0)
Chris PeBenito 9b1907
network_port(sap, tcp,9875,s0, udp,9875,s0)
Chris PeBenito 32f27a
network_port(sip, tcp,5060,s0, udp,5060,s0, tcp,5061,s0, udp,5061,s0)
Chris PeBenito a71e13
network_port(smbd, tcp,137-139,s0, tcp,445,s0)
Chris PeBenito 0d0d2b
network_port(smtp, tcp,25,s0, tcp,465,s0, tcp,587,s0)
Chris PeBenito 0d0d2b
network_port(snmp, udp,161,s0, udp,162,s0, tcp,199,s0)
Chris PeBenito edb7b9
type socks_port_t, port_type; dnl network_port(socks) # no defined portcon
Chris PeBenito edb7b9
network_port(soundd, tcp,8000,s0, tcp,9433,s0, tcp, 16001, s0)
Chris PeBenito 0907bd
network_port(spamd, tcp,783,s0)
Chris PeBenito 06625d
network_port(speech, tcp,8036,s0)
Chris PeBenito edb7b9
network_port(squid, udp,3401,s0, tcp,3401,s0, udp,4827,s0, tcp,4827,s0) # snmp and htcp
Chris PeBenito 0d0d2b
network_port(ssh, tcp,22,s0)
Chris PeBenito 19b555
type stunnel_port_t, port_type; dnl network_port(stunnel) # no defined portcon in current strict
Chris PeBenito 0d0d2b
network_port(swat, tcp,901,s0)
Chris PeBenito 0d0d2b
network_port(syslogd, udp,514,s0)
Chris PeBenito 0d0d2b
network_port(telnetd, tcp,23,s0)
Chris PeBenito 0d0d2b
network_port(tftp, udp,69,s0)
Chris PeBenito 0c54fc
network_port(tor, tcp,9001,s0, tcp,9030,s0, tcp,9050,s0)
Chris PeBenito c89024
network_port(traceroute, udp,64000,s0, udp,64001,s0, udp,64002,s0, udp,64003,s0, udp,64004,s0, udp,64005,s0, udp,64006,s0, udp,64007,s0, udp,64008,s0, udp,64009,s0, udp,64010,s0)
Chris PeBenito 0907bd
network_port(transproxy, tcp,8081,s0)
Chris PeBenito e526fc
network_port(ups, tcp,3493,s0)
Chris PeBenito 710791
type utcpserver_port_t, port_type; dnl network_port(utcpserver) # no defined portcon
Chris PeBenito 0907bd
network_port(uucpd, tcp,540,s0)
Chris PeBenito 45b975
network_port(varnishd, tcp,6081,s0, tcp,6082,s0)
Chris PeBenito 3079cb
network_port(virt, tcp,16509,s0, udp,16509,s0, tcp,16514,s0, udp,16514,s0)
Chris PeBenito 3079cb
network_port(virt_migration, tcp,49152,s0)
Chris PeBenito 0d0d2b
network_port(vnc, tcp,5900,s0)
Chris PeBenito 495df4
network_port(wccp, udp,2048,s0)
Chris PeBenito cdac98
network_port(whois, tcp,43,s0, udp,43,s0)
Chris PeBenito 495df4
network_port(xdmcp, udp,177,s0, tcp,177,s0)
Chris PeBenito a3cf80
network_port(xen, tcp,8002,s0)
Chris PeBenito cdf98f
network_port(xfs, tcp,7100,s0)
Chris PeBenito 495df4
network_port(xserver, tcp, 6000, s0, tcp,6001,s0, tcp,6002,s0, tcp,6003,s0, tcp,6004,s0, tcp,6005,s0, tcp,6006,s0, tcp,6007,s0, tcp,6008,s0, tcp,6009,s0, tcp,6010,s0, tcp,6011,s0, tcp,6012,s0, tcp,6013,s0, tcp,6014,s0, tcp,6015,s0, tcp,6016,s0, tcp,6017,s0, tcp,6018,s0, tcp,6019,s0, tcp,6020,s0)
Chris PeBenito 465510
network_port(zebra, tcp,2600,s0, tcp,2601,s0, tcp,2602,s0, tcp,2603,s0, tcp,2604,s0, tcp,2606,s0, udp,2600,s0, udp,2601,s0, udp,2602,s0, udp,2603,s0, udp,2604,s0, udp,2606,s0)
Chris PeBenito 0907bd
network_port(zope, tcp,8021,s0)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
# Defaults for reserved ports.  Earlier portcon entries take precedence;
Chris PeBenito 6d788d
# these entries just cover any remaining reserved ports not otherwise declared.
Chris PeBenito 495df4
Chris PeBenito 495df4
portcon tcp 600-1023 gen_context(system_u:object_r:hi_reserved_port_t, s0)
Chris PeBenito 495df4
portcon udp 600-1023 gen_context(system_u:object_r:hi_reserved_port_t, s0)
Chris PeBenito 495df4
portcon tcp 1-599 gen_context(system_u:object_r:reserved_port_t, s0)
Chris PeBenito 495df4
portcon udp 1-599 gen_context(system_u:object_r:reserved_port_t, s0)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# Network nodes
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# node_t is the default type of network nodes.
Chris PeBenito b4cd15
# The node_*_t types are used for specific network
Chris PeBenito b4cd15
# nodes in net_contexts or net_contexts.mls.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type node_t, node_type;
Chris PeBenito e070dd
sid node gen_context(system_u:object_r:node_t,s0 - mls_systemhigh)
Chris PeBenito b4cd15
Chris PeBenito c12621
# network_node examples:
Chris PeBenito c12621
#network_node(lo, s0 - mls_systemhigh, 127.0.0.1, 255.255.255.255)
Chris PeBenito c12621
#network_node(multicast, s0 - mls_systemhigh, ff00::, ff00::)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito e37158
# Network Interfaces
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# netif_t is the default type of network interfaces.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type netif_t, netif_type;
Chris PeBenito e070dd
sid netif gen_context(system_u:object_r:netif_t,s0 - mls_systemhigh)
Chris PeBenito b4cd15
Chris PeBenito 49317e
build_option(`enable_mls',`
Chris PeBenito 3f67f7
network_interface(lo, lo, s0 - mls_systemhigh)
Chris PeBenito 6b19be
',`
Chris PeBenito c8d4c3
typealias netif_t alias { lo_netif_t netif_lo_t };
Chris PeBenito bf080a
')
Chris PeBenito b518fc
Chris PeBenito b518fc
########################################
Chris PeBenito b518fc
#
Chris PeBenito b518fc
# Unconfined access to this module
Chris PeBenito b518fc
#
Chris PeBenito b518fc
Chris PeBenito b518fc
allow corenet_unconfined_type node_type:node *;
Chris PeBenito b518fc
allow corenet_unconfined_type netif_type:netif *;
Chris PeBenito a013b5
allow corenet_unconfined_type packet_type:packet *;
Chris PeBenito b518fc
allow corenet_unconfined_type port_type:tcp_socket { send_msg recv_msg name_connect };
Chris PeBenito b518fc
allow corenet_unconfined_type port_type:udp_socket { send_msg recv_msg };
Chris PeBenito b518fc
Chris PeBenito b518fc
# Bind to any network address.
Chris PeBenito b518fc
allow corenet_unconfined_type port_type:{ tcp_socket udp_socket } name_bind;
Chris PeBenito d9845a
allow corenet_unconfined_type node_type:{ tcp_socket udp_socket rawip_socket } node_bind;