xref: /freebsd/usr.sbin/setfmac/setfsmac.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
198359716SRobert Watson.\" Copyright (c) 2003, 2004 Networks Associates Technology, Inc.
26cc0c637SChris Costello.\" All rights reserved.
36cc0c637SChris Costello.\"
46cc0c637SChris Costello.\" This software was developed for the FreeBSD Project by Chris Costello
56cc0c637SChris Costello.\" at Safeport Network Services and Network Associates Labs, the
66cc0c637SChris Costello.\" Security Research Division of Network Associates, Inc. under
76cc0c637SChris Costello.\" DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
86cc0c637SChris Costello.\" DARPA CHATS research program.
96cc0c637SChris Costello.\"
106cc0c637SChris Costello.\" Redistribution and use in source and binary forms, with or without
116cc0c637SChris Costello.\" modification, are permitted provided that the following conditions
126cc0c637SChris Costello.\" are met:
136cc0c637SChris Costello.\" 1. Redistributions of source code must retain the above copyright
146cc0c637SChris Costello.\"    notice, this list of conditions and the following disclaimer.
156cc0c637SChris Costello.\" 2. Redistributions in binary form must reproduce the above copyright
166cc0c637SChris Costello.\"    notice, this list of conditions and the following disclaimer in the
176cc0c637SChris Costello.\"    documentation and/or other materials provided with the distribution.
186cc0c637SChris Costello.\"
196cc0c637SChris Costello.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
206cc0c637SChris Costello.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
216cc0c637SChris Costello.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
226cc0c637SChris Costello.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
236cc0c637SChris Costello.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
246cc0c637SChris Costello.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
256cc0c637SChris Costello.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
266cc0c637SChris Costello.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
276cc0c637SChris Costello.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
286cc0c637SChris Costello.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
296cc0c637SChris Costello.\" SUCH DAMAGE.
306cc0c637SChris Costello.\"
3198359716SRobert Watson.Dd February 17, 2004
326cc0c637SChris Costello.Dt SETFSMAC 8
33*aa12cea2SUlrich Spörlein.Os
346cc0c637SChris Costello.Sh NAME
356cc0c637SChris Costello.Nm setfsmac
366cc0c637SChris Costello.Nd set MAC label for a file hierarchy
376cc0c637SChris Costello.Sh SYNOPSIS
386cc0c637SChris Costello.Nm
3998359716SRobert Watson.Op Fl ehqvx
405234638eSRuslan Ermilov.Oo Fl f Ar specfile Oc ...
415234638eSRuslan Ermilov.Oo Fl s Ar specfile Oc ...
425234638eSRuslan Ermilov.Ar
436cc0c637SChris Costello.Sh DESCRIPTION
446cc0c637SChris CostelloThe
456cc0c637SChris Costello.Nm
466cc0c637SChris Costelloutility accepts a list of specification files as input and sets the MAC
476cc0c637SChris Costellolabels on the specified file system hierarchies.
485234638eSRuslan ErmilovPath names specified will be visited in order as given on the command
496cc0c637SChris Costelloline, and each tree will be traversed in pre-order.
506cc0c637SChris Costello(Generally, it will not be very useful to use relative paths instead of
516cc0c637SChris Costelloabsolute paths.)
526cc0c637SChris CostelloMultiple entries matching a single file will be combined and applied in
536cc0c637SChris Costelloa single transaction.
546cc0c637SChris Costello.Pp
556cc0c637SChris CostelloThe following options are available:
566cc0c637SChris Costello.Bl -tag -width indent
576cc0c637SChris Costello.It Fl e
586cc0c637SChris CostelloTreat any file systems encountered which do not support MAC labelling as
596cc0c637SChris Costelloerrors, instead of warning and skipping them.
606cc0c637SChris Costello.It Fl f Ar specfile
616cc0c637SChris CostelloApply the specifications in
626cc0c637SChris Costello.Ar specfile
636cc0c637SChris Costelloto the specified paths.
646cc0c637SChris Costello.\" XXX
656cc0c637SChris Costello.Bf -emphasis
666cc0c637SChris CostelloNOTE: Only the first entry for each file is applied;
676cc0c637SChris Costelloall others are disregarded and silently dropped.
686cc0c637SChris Costello.Ef
696cc0c637SChris CostelloMultiple
706cc0c637SChris Costello.Fl f
716cc0c637SChris Costelloarguments may be specified to include multiple
726cc0c637SChris Costellospecification files.
736cc0c637SChris Costello.It Fl h
746cc0c637SChris CostelloWhen a symbolic link is encountered, change the label of the link rather
756cc0c637SChris Costellothan the file the link points to.
7698359716SRobert Watson.It Fl q
7798359716SRobert WatsonDo not print non-fatal warnings during execution.
786cc0c637SChris Costello.It Fl s Ar specfile
796cc0c637SChris CostelloApply the specifications in
806cc0c637SChris Costello.Ar specfile ,
816cc0c637SChris Costellobut assume the specification format is compatible with the SELinux
826cc0c637SChris Costello.Ar specfile
836cc0c637SChris Costelloformat.
846cc0c637SChris Costello.\" XXX
856cc0c637SChris Costello.Bf -emphasis
866cc0c637SChris CostelloNOTE: Only the first entry for each file is applied;
876cc0c637SChris Costelloall others are disregarded and silently dropped.
886cc0c637SChris Costello.Ef
896cc0c637SChris CostelloThe prefix
905234638eSRuslan Ermilov.Dq Li sebsd/
916cc0c637SChris Costellowill be automatically prepended to the labels in
926cc0c637SChris Costello.Ar specfile .
936cc0c637SChris CostelloLabels matching
945234638eSRuslan Ermilov.Dq Li <<none>>
956cc0c637SChris Costellowill be explicitly not relabeled.
966cc0c637SChris CostelloThis permits SEBSD to reuse existing SELinux policy specification files.
976cc0c637SChris Costello.It Fl v
986cc0c637SChris CostelloIncrease the degree of verbosity.
996cc0c637SChris Costello.It Fl x
1006cc0c637SChris CostelloDo not recurse into new file systems when traversing them.
1016cc0c637SChris Costello.El
10203b920e1SChris Costello.Sh FILES
1035234638eSRuslan Ermilov.Bl -tag -width ".Pa /usr/share/security/lomac-policy.contexts" -compact
10403b920e1SChris Costello.It Pa /usr/share/security/lomac-policy.contexts
10503b920e1SChris CostelloSample specfile containing LOMAC policy entries.
10603b920e1SChris Costello.El
10703b920e1SChris Costello.Sh EXAMPLES
10803b920e1SChris CostelloSee
10903b920e1SChris Costello.Sx FILES .
1106cc0c637SChris Costello.Sh SEE ALSO
1116cc0c637SChris Costello.Xr mac 3 ,
1126cc0c637SChris Costello.Xr mac_set_file 3 ,
1136cc0c637SChris Costello.Xr mac_set_link 3 ,
1146cc0c637SChris Costello.Xr mac 4 ,
1156cc0c637SChris Costello.Xr re_format 7 ,
1166cc0c637SChris Costello.Xr getfmac 8 ,
1176cc0c637SChris Costello.Xr setfmac 8 ,
1186cc0c637SChris Costello.Xr mac 9
11959a3c79dSRuslan Ermilov.Sh AUTHORS
12059a3c79dSRuslan ErmilovThis software was contributed to the
12159a3c79dSRuslan Ermilov.Fx
12259a3c79dSRuslan ErmilovProject by Network Associates Labs,
12359a3c79dSRuslan Ermilovthe Security Research Division of Network Associates
12459a3c79dSRuslan ErmilovInc.
12559a3c79dSRuslan Ermilovunder DARPA/SPAWAR contract N66001-01-C-8035
12659a3c79dSRuslan Ermilov.Pq Dq CBOSS ,
12759a3c79dSRuslan Ermilovas part of the DARPA CHATS research program.
128