xref: /freebsd/contrib/openbsm/bin/auditd/auditd.h (revision bb97b41819ea5a5e5315006cdad6902bfa2b7eb6)
1ca0716f5SRobert Watson /*
2ca0716f5SRobert Watson  * Copyright (c) 2005 Apple Computer, Inc.
3ca0716f5SRobert Watson  * All rights reserved.
4ca0716f5SRobert Watson  *
5ca0716f5SRobert Watson  * @APPLE_BSD_LICENSE_HEADER_START@
6ca0716f5SRobert Watson  *
7ca0716f5SRobert Watson  * Redistribution and use in source and binary forms, with or without
8ca0716f5SRobert Watson  * modification, are permitted provided that the following conditions
9ca0716f5SRobert Watson  * are met:
10ca0716f5SRobert Watson  *
11ca0716f5SRobert Watson  * 1.  Redistributions of source code must retain the above copyright
12ca0716f5SRobert Watson  *     notice, this list of conditions and the following disclaimer.
13ca0716f5SRobert Watson  * 2.  Redistributions in binary form must reproduce the above copyright
14ca0716f5SRobert Watson  *     notice, this list of conditions and the following disclaimer in the
15ca0716f5SRobert Watson  *     documentation and/or other materials provided with the distribution.
16ca0716f5SRobert Watson  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
17ca0716f5SRobert Watson  *     its contributors may be used to endorse or promote products derived
18ca0716f5SRobert Watson  *     from this software without specific prior written permission.
19ca0716f5SRobert Watson  *
20ca0716f5SRobert Watson  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
21ca0716f5SRobert Watson  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22ca0716f5SRobert Watson  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23ca0716f5SRobert Watson  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
24ca0716f5SRobert Watson  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25ca0716f5SRobert Watson  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26ca0716f5SRobert Watson  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27ca0716f5SRobert Watson  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28ca0716f5SRobert Watson  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29ca0716f5SRobert Watson  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30ca0716f5SRobert Watson  *
31ca0716f5SRobert Watson  * @APPLE_BSD_LICENSE_HEADER_END@
32ca0716f5SRobert Watson  *
33bb97b418SRobert Watson  * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#6 $
34ca0716f5SRobert Watson  */
35ca0716f5SRobert Watson 
36ca0716f5SRobert Watson #ifndef _AUDITD_H_
37ca0716f5SRobert Watson #define	_AUDITD_H_
38ca0716f5SRobert Watson 
39ca0716f5SRobert Watson #include <sys/types.h>
40ca0716f5SRobert Watson #include <sys/queue.h>
41ca0716f5SRobert Watson #include <syslog.h>
42ca0716f5SRobert Watson 
43ca0716f5SRobert Watson #define	MAX_DIR_SIZE	255
44ca0716f5SRobert Watson #define	AUDITD_NAME	"auditd"
45ca0716f5SRobert Watson 
4623bf6e20SRobert Watson /*
4723bf6e20SRobert Watson  * If defined, then the audit daemon will attempt to chown newly created logs
4823bf6e20SRobert Watson  * to this group.  Otherwise, they will be the default for the user running
4923bf6e20SRobert Watson  * auditd, likely the audit group.
5023bf6e20SRobert Watson  */
5123bf6e20SRobert Watson #define	AUDIT_REVIEW_GROUP	"audit"
5223bf6e20SRobert Watson 
53ca0716f5SRobert Watson #define	POSTFIX_LEN		16
54ca0716f5SRobert Watson #define	NOT_TERMINATED	".not_terminated"
55ca0716f5SRobert Watson 
56ca0716f5SRobert Watson struct dir_ent {
57ca0716f5SRobert Watson 	char			*dirname;
58ca0716f5SRobert Watson 	char			 softlim;
59ca0716f5SRobert Watson 	TAILQ_ENTRY(dir_ent)	 dirs;
60ca0716f5SRobert Watson };
61ca0716f5SRobert Watson 
62ca0716f5SRobert Watson #define	HARDLIM_ALL_WARN	"allhard"
63ca0716f5SRobert Watson #define	SOFTLIM_ALL_WARN	"allsoft"
64bb97b418SRobert Watson #define	AUDITOFF_WARN		"auditoff"
65ca0716f5SRobert Watson #define	EBUSY_WARN		"ebusy"
66ca0716f5SRobert Watson #define	GETACDIR_WARN		"getacdir"
67ca0716f5SRobert Watson #define	HARDLIM_WARN		"hard"
68ca0716f5SRobert Watson #define	NOSTART_WARN		"nostart"
69ca0716f5SRobert Watson #define	POSTSIGTERM_WARN	"postsigterm"
70ca0716f5SRobert Watson #define	SOFTLIM_WARN		"soft"
71ca0716f5SRobert Watson #define	TMPFILE_WARN		"tmpfile"
72ca0716f5SRobert Watson 
73ca0716f5SRobert Watson #define	AUDITWARN_SCRIPT	"/etc/security/audit_warn"
74ca0716f5SRobert Watson #define	AUDITD_PIDFILE		"/var/run/auditd.pid"
75ca0716f5SRobert Watson 
76ca0716f5SRobert Watson int	audit_warn_allhard(int count);
77ca0716f5SRobert Watson int	audit_warn_allsoft(void);
78ca0716f5SRobert Watson int	audit_warn_auditoff(void);
79ca0716f5SRobert Watson int	audit_warn_ebusy(void);
80ca0716f5SRobert Watson int	audit_warn_getacdir(char *filename);
81ca0716f5SRobert Watson int	audit_warn_hard(char *filename);
82ca0716f5SRobert Watson int	audit_warn_nostart(void);
83ca0716f5SRobert Watson int	audit_warn_postsigterm(void);
84ca0716f5SRobert Watson int	audit_warn_soft(char *filename);
85ca0716f5SRobert Watson int	audit_warn_tmpfile(void);
86ca0716f5SRobert Watson 
87ca0716f5SRobert Watson #endif /* !_AUDITD_H_ */
88