1d8a7b7a3SRobert Watson /*- 2f6a41092SRobert Watson * Copyright (c) 1999-2002 Robert N. M. Watson 3f6a41092SRobert Watson * Copyright (c) 2001-2003 Networks Associates Technology, Inc. 4d8a7b7a3SRobert Watson * All rights reserved. 5d8a7b7a3SRobert Watson * 6d8a7b7a3SRobert Watson * This software was developed by Robert Watson for the TrustedBSD Project. 7d8a7b7a3SRobert Watson * 8dc858fcaSRobert Watson * This software was developed for the FreeBSD Project in part by Network 9dc858fcaSRobert Watson * Associates Laboratories, the Security Research Division of Network 10dc858fcaSRobert Watson * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), 11dc858fcaSRobert Watson * as part of the DARPA CHATS research program. 12d8a7b7a3SRobert Watson * 13d8a7b7a3SRobert Watson * Redistribution and use in source and binary forms, with or without 14d8a7b7a3SRobert Watson * modification, are permitted provided that the following conditions 15d8a7b7a3SRobert Watson * are met: 16d8a7b7a3SRobert Watson * 1. Redistributions of source code must retain the above copyright 17d8a7b7a3SRobert Watson * notice, this list of conditions and the following disclaimer. 18d8a7b7a3SRobert Watson * 2. Redistributions in binary form must reproduce the above copyright 19d8a7b7a3SRobert Watson * notice, this list of conditions and the following disclaimer in the 20d8a7b7a3SRobert Watson * documentation and/or other materials provided with the distribution. 21d8a7b7a3SRobert Watson * 22d8a7b7a3SRobert Watson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 23d8a7b7a3SRobert Watson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24d8a7b7a3SRobert Watson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25d8a7b7a3SRobert Watson * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 26d8a7b7a3SRobert Watson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27d8a7b7a3SRobert Watson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28d8a7b7a3SRobert Watson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29d8a7b7a3SRobert Watson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30d8a7b7a3SRobert Watson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31d8a7b7a3SRobert Watson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32d8a7b7a3SRobert Watson * SUCH DAMAGE. 33d8a7b7a3SRobert Watson * 34d8a7b7a3SRobert Watson * $FreeBSD$ 35d8a7b7a3SRobert Watson */ 36d8a7b7a3SRobert Watson 37d8a7b7a3SRobert Watson /* 38d8a7b7a3SRobert Watson * Developed by the TrustedBSD Project. 390164a499SRobert Watson * 400164a499SRobert Watson * Sample policy implementing no entry points; for performance measurement 410164a499SRobert Watson * purposes only. If you're looking for a stub policy to base new policies 420164a499SRobert Watson * on, try mac_stub. 43d8a7b7a3SRobert Watson */ 44d8a7b7a3SRobert Watson 45d8a7b7a3SRobert Watson #include <sys/types.h> 46d8a7b7a3SRobert Watson #include <sys/param.h> 47d8a7b7a3SRobert Watson #include <sys/acl.h> 48d8a7b7a3SRobert Watson #include <sys/conf.h> 49763bbd2fSRobert Watson #include <sys/extattr.h> 50d8a7b7a3SRobert Watson #include <sys/kernel.h> 51d8a7b7a3SRobert Watson #include <sys/mac.h> 52d8a7b7a3SRobert Watson #include <sys/mount.h> 53d8a7b7a3SRobert Watson #include <sys/proc.h> 54d8a7b7a3SRobert Watson #include <sys/systm.h> 55d8a7b7a3SRobert Watson #include <sys/sysproto.h> 56d8a7b7a3SRobert Watson #include <sys/sysent.h> 57d8a7b7a3SRobert Watson #include <sys/vnode.h> 58d8a7b7a3SRobert Watson #include <sys/file.h> 59d8a7b7a3SRobert Watson #include <sys/socket.h> 60d8a7b7a3SRobert Watson #include <sys/socketvar.h> 61d8a7b7a3SRobert Watson #include <sys/pipe.h> 6236422989SPoul-Henning Kamp #include <sys/sx.h> 63d8a7b7a3SRobert Watson #include <sys/sysctl.h> 64d8a7b7a3SRobert Watson 65d8a7b7a3SRobert Watson #include <fs/devfs/devfs.h> 66d8a7b7a3SRobert Watson 67d8a7b7a3SRobert Watson #include <net/bpfdesc.h> 68d8a7b7a3SRobert Watson #include <net/if.h> 69d8a7b7a3SRobert Watson #include <net/if_types.h> 70d8a7b7a3SRobert Watson #include <net/if_var.h> 71d8a7b7a3SRobert Watson 72d8a7b7a3SRobert Watson #include <netinet/in.h> 73d8a7b7a3SRobert Watson #include <netinet/ip_var.h> 74d8a7b7a3SRobert Watson 75d8a7b7a3SRobert Watson #include <vm/vm.h> 76d8a7b7a3SRobert Watson 770efd6615SRobert Watson #include <security/mac/mac_policy.h> 78d8a7b7a3SRobert Watson 79d8a7b7a3SRobert Watson SYSCTL_DECL(_security_mac); 80d8a7b7a3SRobert Watson 81d8a7b7a3SRobert Watson SYSCTL_NODE(_security_mac, OID_AUTO, none, CTLFLAG_RW, 0, 82d8a7b7a3SRobert Watson "TrustedBSD mac_none policy controls"); 83d8a7b7a3SRobert Watson 84eba0370dSRobert Watson static int mac_none_enabled = 1; 85d8a7b7a3SRobert Watson SYSCTL_INT(_security_mac_none, OID_AUTO, enabled, CTLFLAG_RW, 86d8a7b7a3SRobert Watson &mac_none_enabled, 0, "Enforce none policy"); 87d8a7b7a3SRobert Watson 885c8dd342SRobert Watson static struct mac_policy_ops mac_none_ops = 89d8a7b7a3SRobert Watson { 90d8a7b7a3SRobert Watson }; 91d8a7b7a3SRobert Watson 9278183ac2SRobert Watson MAC_POLICY_SET(&mac_none_ops, mac_none, "TrustedBSD MAC/None", 93740348c4SRobert Watson MPC_LOADTIME_FLAG_UNLOADOK, NULL); 94