* Copyright 2004-2018,2021-23 Red Hat Inc.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
* Steve Grubb <sgrubb@redhat.com>
* Rickard E. (Rik) Faith <faith@redhat.com>
*/
#ifndef _LIBAUDIT_H_
#define _LIBAUDIT_H_
#include <asm/types.h>
#include <stdint.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/audit.h>
#include <stdarg.h>
#include <syslog.h>
#ifndef __attr_access
# define __attr_access(x)
#endif
#ifndef __attr_dealloc
# define __attr_dealloc(dealloc, argno)
# define __attr_dealloc_free
#endif
#ifdef __cplusplus
extern "C" {
#endif
* 1000 - 1099 are for commanding the audit system
* 1100 - 1199 user space trusted application messages
* 1200 - 1299 messages internal to the audit daemon
* 1300 - 1399 audit event messages
* 1400 - 1499 kernel SE Linux use
* 1500 - 1599 AppArmor events
* 1600 - 1699 kernel crypto events
* 1700 - 1799 kernel anomaly records
* 1800 - 1899 kernel integrity labels and related events
* 1800 - 1999 future kernel use
* 2001 - 2099 unused (kernel)
* 2100 - 2199 user space anomaly records
* 2200 - 2299 user space actions taken in response to anomalies
* 2300 - 2399 user space generated LSPP events
* 2400 - 2499 user space crypto events
* 2500 - 2599 user space virtualization management events
* 2600 - 2999 future user space (maybe integrity labels and related events)
*/
#define AUDIT_FIRST_USER_MSG 1100
#define AUDIT_LAST_USER_MSG 1199
#define AUDIT_USER_AUTH 1100
#define AUDIT_USER_ACCT 1101
#define AUDIT_USER_MGMT 1102
#define AUDIT_CRED_ACQ 1103
#define AUDIT_CRED_DISP 1104
#define AUDIT_USER_START 1105
#define AUDIT_USER_END 1106
#define AUDIT_USER_AVC 1107
#define AUDIT_USER_CHAUTHTOK 1108
#define AUDIT_USER_ERR 1109
#define AUDIT_CRED_REFR 1110
#define AUDIT_USYS_CONFIG 1111
#define AUDIT_USER_LOGIN 1112
#define AUDIT_USER_LOGOUT 1113
#define AUDIT_ADD_USER 1114
#define AUDIT_DEL_USER 1115
#define AUDIT_ADD_GROUP 1116
#define AUDIT_DEL_GROUP 1117
#define AUDIT_DAC_CHECK 1118
#define AUDIT_CHGRP_ID 1119
#define AUDIT_TEST 1120
#define AUDIT_TRUSTED_APP 1121
#define AUDIT_USER_SELINUX_ERR 1122
#define AUDIT_USER_CMD 1123
#define AUDIT_USER_TTY 1124
#define AUDIT_CHUSER_ID 1125
#define AUDIT_GRP_AUTH 1126
#define AUDIT_SYSTEM_BOOT 1127
#define AUDIT_SYSTEM_SHUTDOWN 1128
#define AUDIT_SYSTEM_RUNLEVEL 1129
#define AUDIT_SERVICE_START 1130
#define AUDIT_SERVICE_STOP 1131
#define AUDIT_GRP_MGMT 1132
#define AUDIT_GRP_CHAUTHTOK 1133
#define AUDIT_MAC_CHECK 1134
#define AUDIT_ACCT_LOCK 1135
#define AUDIT_ACCT_UNLOCK 1136
#define AUDIT_USER_DEVICE 1137
#define AUDIT_SOFTWARE_UPDATE 1138
#define AUDIT_FIRST_DAEMON 1200
#define AUDIT_LAST_DAEMON 1299
#define AUDIT_DAEMON_RECONFIG 1204
#define AUDIT_DAEMON_ROTATE 1205
#define AUDIT_DAEMON_RESUME 1206
#define AUDIT_DAEMON_ACCEPT 1207
#define AUDIT_DAEMON_CLOSE 1208
#define AUDIT_DAEMON_ERR 1209
#define AUDIT_FIRST_EVENT 1300
#define AUDIT_LAST_EVENT 1399
#define AUDIT_FIRST_SELINUX 1400
#define AUDIT_LAST_SELINUX 1499
#define AUDIT_FIRST_APPARMOR 1500
#define AUDIT_LAST_APPARMOR 1599
#ifndef AUDIT_AA
#define AUDIT_AA 1500
#define AUDIT_APPARMOR_AUDIT 1501
#define AUDIT_APPARMOR_ALLOWED 1502
#define AUDIT_APPARMOR_DENIED 1503
#define AUDIT_APPARMOR_HINT 1504
#define AUDIT_APPARMOR_STATUS 1505
#define AUDIT_APPARMOR_ERROR 1506
#define AUDIT_APPARMOR_KILL 1507
#endif
#define AUDIT_FIRST_KERN_CRYPTO_MSG 1600
#define AUDIT_LAST_KERN_CRYPTO_MSG 1699
#define AUDIT_FIRST_KERN_ANOM_MSG 1700
#define AUDIT_LAST_KERN_ANOM_MSG 1799
#define AUDIT_INTEGRITY_FIRST_MSG 1800
#define AUDIT_INTEGRITY_LAST_MSG 1899
#ifndef AUDIT_INTEGRITY_DATA
#define AUDIT_INTEGRITY_DATA 1800
#define AUDIT_INTEGRITY_METADATA 1801
#define AUDIT_INTEGRITY_STATUS 1802
#define AUDIT_INTEGRITY_HASH 1803
#define AUDIT_INTEGRITY_PCR 1804
#define AUDIT_INTEGRITY_RULE 1805
#endif
#ifndef AUDIT_INTEGRITY_EVM_XATTR
#define AUDIT_INTEGRITY_EVM_XATTR 1806
#endif
#ifndef AUDIT_INTEGRITY_POLICY_RULE
#define AUDIT_INTEGRITY_POLICY_RULE 1807
#endif
#define AUDIT_FIRST_ANOM_MSG 2100
#define AUDIT_LAST_ANOM_MSG 2199
#define AUDIT_ANOM_LOGIN_FAILURES 2100
#define AUDIT_ANOM_LOGIN_TIME 2101
#define AUDIT_ANOM_LOGIN_SESSIONS 2102
#define AUDIT_ANOM_LOGIN_ACCT 2103
#define AUDIT_ANOM_LOGIN_LOCATION 2104
#define AUDIT_ANOM_MAX_DAC 2105
#define AUDIT_ANOM_MAX_MAC 2106
#define AUDIT_ANOM_AMTU_FAIL 2107
#define AUDIT_ANOM_RBAC_FAIL 2108
#define AUDIT_ANOM_RBAC_INTEGRITY_FAIL 2109
#define AUDIT_ANOM_CRYPTO_FAIL 2110
#define AUDIT_ANOM_ACCESS_FS 2111
#define AUDIT_ANOM_EXEC 2112
#define AUDIT_ANOM_MK_EXEC 2113
#define AUDIT_ANOM_ADD_ACCT 2114
#define AUDIT_ANOM_DEL_ACCT 2115
#define AUDIT_ANOM_MOD_ACCT 2116
#define AUDIT_ANOM_ROOT_TRANS 2117
#define AUDIT_ANOM_LOGIN_SERVICE 2118
#define AUDIT_ANOM_LOGIN_ROOT 2119
#define AUDIT_ANOM_ORIGIN_FAILURES 2120
#define AUDIT_ANOM_SESSION 2121
#define AUDIT_FIRST_ANOM_RESP 2200
#define AUDIT_LAST_ANOM_RESP 2299
#define AUDIT_RESP_ANOMALY 2200
#define AUDIT_RESP_ALERT 2201
#define AUDIT_RESP_KILL_PROC 2202
#define AUDIT_RESP_TERM_ACCESS 2203
#define AUDIT_RESP_ACCT_REMOTE 2204
#define AUDIT_RESP_ACCT_LOCK_TIMED 2205
#define AUDIT_RESP_ACCT_UNLOCK_TIMED 2206
#define AUDIT_RESP_ACCT_LOCK 2207
#define AUDIT_RESP_TERM_LOCK 2208
#define AUDIT_RESP_SEBOOL 2209
#define AUDIT_RESP_EXEC 2210
#define AUDIT_RESP_SINGLE 2211
#define AUDIT_RESP_HALT 2212
#define AUDIT_RESP_ORIGIN_BLOCK 2213
#define AUDIT_RESP_ORIGIN_BLOCK_TIMED 2214
#define AUDIT_RESP_ORIGIN_UNBLOCK_TIMED 2215
#define AUDIT_FIRST_USER_LSPP_MSG 2300
#define AUDIT_LAST_USER_LSPP_MSG 2399
#define AUDIT_USER_ROLE_CHANGE 2300
#define AUDIT_ROLE_ASSIGN 2301
#define AUDIT_ROLE_REMOVE 2302
#define AUDIT_LABEL_OVERRIDE 2303
#define AUDIT_LABEL_LEVEL_CHANGE 2304
#define AUDIT_USER_LABELED_EXPORT 2305
#define AUDIT_USER_UNLABELED_EXPORT 2306
#define AUDIT_DEV_ALLOC 2307
#define AUDIT_DEV_DEALLOC 2308
#define AUDIT_FS_RELABEL 2309
#define AUDIT_USER_MAC_POLICY_LOAD 2310
#define AUDIT_ROLE_MODIFY 2311
#define AUDIT_USER_MAC_CONFIG_CHANGE 2312
#define AUDIT_USER_MAC_STATUS 2313
#define AUDIT_FIRST_CRYPTO_MSG 2400
#define AUDIT_CRYPTO_TEST_USER 2400
#define AUDIT_CRYPTO_PARAM_CHANGE_USER 2401
#define AUDIT_CRYPTO_LOGIN 2402
#define AUDIT_CRYPTO_LOGOUT 2403
#define AUDIT_CRYPTO_KEY_USER 2404
#define AUDIT_CRYPTO_FAILURE_USER 2405
#define AUDIT_CRYPTO_REPLAY_USER 2406
#define AUDIT_CRYPTO_SESSION 2407
TLS session establishment */
#define AUDIT_CRYPTO_IKE_SA 2408
IKE SA */
#define AUDIT_CRYPTO_IPSEC_SA 2409
IPSEC SA */
#define AUDIT_LAST_CRYPTO_MSG 2499
#define AUDIT_FIRST_VIRT_MSG 2500
#define AUDIT_VIRT_CONTROL 2500
#define AUDIT_VIRT_RESOURCE 2501
#define AUDIT_VIRT_MACHINE_ID 2502
#define AUDIT_VIRT_INTEGRITY_CHECK 2503
#define AUDIT_VIRT_CREATE 2504
#define AUDIT_VIRT_DESTROY 2505
#define AUDIT_VIRT_MIGRATE_IN 2506
#define AUDIT_VIRT_MIGRATE_OUT 2507
#define AUDIT_LAST_VIRT_MSG 2599
#ifndef AUDIT_FIRST_USER_MSG2
#define AUDIT_FIRST_USER_MSG2 2100
#define AUDIT_LAST_USER_MSG2 2999
#endif
#ifndef AUDIT_SET_FEATURE
#define AUDIT_SET_FEATURE 1018
#endif
#ifndef AUDIT_GET_FEATURE
#define AUDIT_GET_FEATURE 1019
#endif
#ifndef AUDIT_MMAP
#define AUDIT_MMAP 1323
#endif
#ifndef AUDIT_NETFILTER_PKT
#define AUDIT_NETFILTER_PKT 1324
#endif
#ifndef AUDIT_NETFILTER_CFG
#define AUDIT_NETFILTER_CFG 1325
#endif
#ifndef AUDIT_SECCOMP
#define AUDIT_SECCOMP 1326
#endif
#ifndef AUDIT_PROCTITLE
#define AUDIT_PROCTITLE 1327
#endif
#undef AUDIT_FEATURE_CHANGE
#ifndef AUDIT_FEATURE_CHANGE
#define AUDIT_FEATURE_CHANGE 1328
#endif
#ifndef AUDIT_REPLACE
#define AUDIT_REPLACE 1329
#endif
#ifndef AUDIT_KERN_MODULE
#define AUDIT_KERN_MODULE 1330
#endif
#ifndef AUDIT_FANOTIFY
#define AUDIT_FANOTIFY 1331
#endif
#ifndef AUDIT_TIME_INJOFFSET
#define AUDIT_TIME_INJOFFSET 1332
#endif
#ifndef AUDIT_TIME_ADJNTPVAL
#define AUDIT_TIME_ADJNTPVAL 1333
#endif
#ifndef AUDIT_BPF
#define AUDIT_BPF 1334
#endif
#ifndef AUDIT_EVENT_LISTENER
#define AUDIT_EVENT_LISTENER 1335
#endif
#ifndef AUDIT_URINGOP
#define AUDIT_URINGOP 1336
#endif
#ifndef AUDIT_OPENAT2
#define AUDIT_OPENAT2 1337
#endif
#ifndef AUDIT_DM_CTRL
#define AUDIT_DM_CTRL 1338
#endif
#ifndef AUDIT_DM_EVENT
#define AUDIT_DM_EVENT 1339
#endif
#ifndef AUDIT_MAC_CALIPSO_ADD
#define AUDIT_MAC_CALIPSO_ADD 1418
#endif
#ifndef AUDIT_MAC_CALIPSO_DEL
#define AUDIT_MAC_CALIPSO_DEL 1419
#endif
#ifndef AUDIT_ANOM_LINK
#define AUDIT_ANOM_LINK 1702
#endif
#ifndef AUDIT_ANOM_CREAT
#define AUDIT_ANOM_CREAT 1703
#endif
#define AUDIT_KEY_SEPARATOR 0x01
#ifndef AUDIT_FILTER_FS
#define AUDIT_FILTER_FS 0x06
#endif
#ifndef AUDIT_FILTER_URING_EXIT
#define AUDIT_FILTER_URING_EXIT 0x07
#endif
#ifndef AUDIT_FILTER_EXCLUDE
#define AUDIT_FILTER_EXCLUDE AUDIT_FILTER_TYPE
#endif
#define AUDIT_FILTER_MASK 0x07
#define AUDIT_FILTER_UNSET 0x80
#ifndef AUDIT_STATUS_LOST
#define AUDIT_STATUS_LOST 0x0040
#endif
#ifndef AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT
#define AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT 0x00000001
#endif
#ifndef AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME
#define AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME 0x00000002
#endif
#ifndef AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH
#define AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH 0x00000004
#endif
#ifndef AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND
#define AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND 0x00000008
#endif
#ifndef AUDIT_FEATURE_BITMAP_SESSIONID_FILTER
#define AUDIT_FEATURE_BITMAP_SESSIONID_FILTER 0x00000010
#endif
#ifndef AUDIT_FEATURE_BITMAP_LOST_RESET
#define AUDIT_FEATURE_BITMAP_LOST_RESET 0x00000020
#endif
#ifndef AUDIT_FEATURE_BITMAP_FILTER_FS
#define AUDIT_FEATURE_BITMAP_FILTER_FS 0x00000040
#endif
#ifndef AUDIT_OBJ_UID
#define AUDIT_OBJ_UID 109
#endif
#ifndef AUDIT_OBJ_GID
#define AUDIT_OBJ_GID 110
#endif
#ifndef AUDIT_FIELD_COMPARE
#define AUDIT_FIELD_COMPARE 111
#endif
#ifndef AUDIT_EXE
#define AUDIT_EXE 112
#endif
#ifndef AUDIT_SADDR_FAM
#define AUDIT_SADDR_FAM 113
#endif
#ifndef AUDIT_SESSIONID
#define AUDIT_SESSIONID 25
#endif
#ifndef AUDIT_FSTYPE
#define AUDIT_FSTYPE 26
#endif
#ifndef AUDIT_COMPARE_UID_TO_OBJ_UID
#define AUDIT_COMPARE_UID_TO_OBJ_UID 1
#endif
#ifndef AUDIT_COMPARE_GID_TO_OBJ_GID
#define AUDIT_COMPARE_GID_TO_OBJ_GID 2
#endif
#ifndef AUDIT_COMPARE_EUID_TO_OBJ_UID
#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
#endif
#ifndef AUDIT_COMPARE_EGID_TO_OBJ_GID
#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4
#endif
#ifndef AUDIT_COMPARE_AUID_TO_OBJ_UID
#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5
#endif
#ifndef AUDIT_COMPARE_SUID_TO_OBJ_UID
#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6
#endif
#ifndef AUDIT_COMPARE_SGID_TO_OBJ_GID
#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
#endif
#ifndef AUDIT_COMPARE_FSUID_TO_OBJ_UID
#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
#endif
#ifndef AUDIT_COMPARE_FSGID_TO_OBJ_GID
#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
#endif
#ifndef AUDIT_COMPARE_UID_TO_AUID
#define AUDIT_COMPARE_UID_TO_AUID 10
#endif
#ifndef AUDIT_COMPARE_UID_TO_EUID
#define AUDIT_COMPARE_UID_TO_EUID 11
#endif
#ifndef AUDIT_COMPARE_UID_TO_FSUID
#define AUDIT_COMPARE_UID_TO_FSUID 12
#endif
#ifndef AUDIT_COMPARE_UID_TO_SUID
#define AUDIT_COMPARE_UID_TO_SUID 13
#endif
#ifndef AUDIT_COMPARE_AUID_TO_FSUID
#define AUDIT_COMPARE_AUID_TO_FSUID 14
#endif
#ifndef AUDIT_COMPARE_AUID_TO_SUID
#define AUDIT_COMPARE_AUID_TO_SUID 15
#endif
#ifndef AUDIT_COMPARE_AUID_TO_EUID
#define AUDIT_COMPARE_AUID_TO_EUID 16
#endif
#ifndef AUDIT_COMPARE_EUID_TO_SUID
#define AUDIT_COMPARE_EUID_TO_SUID 17
#endif
#ifndef AUDIT_COMPARE_EUID_TO_FSUID
#define AUDIT_COMPARE_EUID_TO_FSUID 18
#endif
#ifndef AUDIT_COMPARE_SUID_TO_FSUID
#define AUDIT_COMPARE_SUID_TO_FSUID 19
#endif
#ifndef AUDIT_COMPARE_GID_TO_EGID
#define AUDIT_COMPARE_GID_TO_EGID 20
#endif
#ifndef AUDIT_COMPARE_GID_TO_FSGID
#define AUDIT_COMPARE_GID_TO_FSGID 21
#endif
#ifndef AUDIT_COMPARE_GID_TO_SGID
#define AUDIT_COMPARE_GID_TO_SGID 22
#endif
#ifndef AUDIT_COMPARE_EGID_TO_FSGID
#define AUDIT_COMPARE_EGID_TO_FSGID 23
#endif
#ifndef AUDIT_COMPARE_EGID_TO_SGID
#define AUDIT_COMPARE_EGID_TO_SGID 24
#endif
#ifndef AUDIT_COMPARE_SGID_TO_FSGID
#define AUDIT_COMPARE_SGID_TO_FSGID 25
#endif
#ifndef EM_ARM
#define EM_ARM 40
#endif
#ifndef EM_AARCH64
#define EM_AARCH64 183
#endif
#ifndef AUDIT_ARCH_AARCH64
#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
#endif
#ifndef AUDIT_ARCH_PPC64LE
#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
#endif
#define AUDIT_INTERP_SEPARATOR 0x1D
struct audit_sig_info {
uid_t uid;
pid_t pid;
char ctx[0];
};
#define MAX_AUDIT_MESSAGE_LENGTH 8970
struct audit_message {
struct nlmsghdr nlh;
char data[MAX_AUDIT_MESSAGE_LENGTH];
};
struct daemon_conf;
struct audit_reply {
int type;
int len;
struct nlmsghdr *nlh;
struct audit_message msg;
* the following should be valid for any packet. */
union {
struct audit_status *status;
struct audit_rule_data *ruledata;
struct audit_login *login;
char *message;
struct nlmsgerr *error;
struct audit_sig_info *signal_info;
struct daemon_conf *conf;
#ifdef AUDIT_FEATURE_VERSION
struct audit_features *features;
#endif
};
};
* added to it, it must go at the end and the version number bumped.
* This MUST BE fixed size for compatibility. If you are going to add
* new member then add them into _structure_ part.
*/
struct audit_dispatcher_header {
uint32_t ver;
uint32_t hlen;
uint32_t type;
uint32_t size;
};
#define AUDISP_PROTOCOL_VER 0
#define AUDISP_PROTOCOL_VER2 1
typedef enum {
MACH_X86=0,
MACH_86_64,
MACH_IA64,
MACH_PPC64,
MACH_PPC,
MACH_S390X,
MACH_S390,
MACH_ALPHA,
MACH_ARM,
MACH_AARCH64,
MACH_PPC64LE,
MACH_IO_URING
} machine_t;
typedef enum {
FAIL_IGNORE=0,
FAIL_LOG,
FAIL_TERMINATE
} auditfail_t;
typedef enum { MSG_STDERR, MSG_SYSLOG, MSG_QUIET } message_t;
typedef enum { DBG_NO, DBG_YES } debug_message_t;
void set_aumessage_mode(message_t mode, debug_message_t debug);
typedef enum { GET_REPLY_BLOCKING=0, GET_REPLY_NONBLOCKING } reply_t;
extern int audit_open(void);
extern void audit_close(int fd);
extern int audit_get_reply(int fd, struct audit_reply *rep, reply_t block,
int peek);
extern uid_t audit_getloginuid(void);
extern int audit_setloginuid(uid_t uid);
extern uint32_t audit_get_session(void);
extern int audit_detect_machine(void);
extern int audit_determine_machine(const char *arch);
extern char *audit_format_signal_info(char *buf, int len, char *op,
struct audit_reply *rep, char *res)
__attr_access ((__write_only__, 1, 2));
extern int audit_name_to_field(const char *field);
extern const char *audit_field_to_name(int field);
extern int audit_name_to_syscall(const char *sc, int machine);
extern const char *audit_syscall_to_name(int sc, int machine);
extern const char *audit_uringop_to_name(int uringop);
extern int audit_name_to_uringop(const char *uringop);
extern int audit_name_to_flag(const char *flag);
extern const char *audit_flag_to_name(int flag);
extern int audit_name_to_action(const char *action);
extern const char *audit_action_to_name(int action);
extern int audit_name_to_msg_type(const char *msg_type);
extern const char *audit_msg_type_to_name(int msg_type);
extern int audit_name_to_machine(const char *machine);
extern const char *audit_machine_to_name(int machine);
extern unsigned int audit_machine_to_elf(int machine);
extern int audit_elf_to_machine(unsigned int elf);
extern const char *audit_operator_to_symbol(int op);
extern int audit_name_to_errno(const char *error);
extern const char *audit_errno_to_name(int error);
extern int audit_name_to_ftype(const char *name);
extern const char *audit_ftype_to_name(int ftype);
extern int audit_name_to_fstype(const char *name);
extern const char *audit_fstype_to_name(int fstype);
extern void audit_number_to_errmsg(int errnumber, const char *opt);
extern int audit_request_status(int fd);
extern int audit_is_enabled(int fd);
extern int get_auditfail_action(auditfail_t *failmode);
extern int audit_request_features(int fd);
extern uint32_t audit_get_features(void);
typedef enum { WAIT_NO, WAIT_YES } rep_wait_t;
extern int audit_set_pid(int fd, uint32_t pid, rep_wait_t wmode);
extern int audit_set_enabled(int fd, uint32_t enabled);
extern int audit_set_failure(int fd, uint32_t failure);
extern int audit_set_rate_limit(int fd, uint32_t limit);
extern int audit_set_backlog_limit(int fd, uint32_t limit);
int audit_set_backlog_wait_time(int fd, uint32_t bwt);
int audit_reset_lost(int fd);
int audit_reset_backlog_wait_time_actual(int fd);
extern int audit_set_feature(int fd, unsigned feature, unsigned value,
unsigned lock);
extern int audit_set_loginuid_immutable(int fd);
extern int audit_request_rules_list_data(int fd);
extern int audit_request_signal_info(int fd);
extern int audit_update_watch_perms(struct audit_rule_data *rule, int perms);
extern int audit_add_watch(struct audit_rule_data **rulep, const char *path);
extern int audit_add_watch_dir(int type, struct audit_rule_data **rulep,
const char *path);
extern int audit_trim_subtrees(int fd);
extern int audit_make_equivalent(int fd, const char *mount_point,
const char *subtree);
extern int audit_add_rule_data(int fd, struct audit_rule_data *rule,
int flags, int action);
extern int audit_delete_rule_data(int fd, struct audit_rule_data *rule,
int flags, int action);
extern int audit_value_needs_encoding(const char *str, unsigned int size)
__attr_access ((__read_only__, 1, 2));
extern char *audit_encode_value(char *final,const char *buf,unsigned int size)
__attr_access ((__write_only__, 1))
__attr_access ((__read_only__, 2, 3));
extern char *audit_encode_nv_string(const char *name, const char *value,
unsigned int vlen)
__attr_access ((__read_only__, 2, 3))
__attr_dealloc_free;
extern int audit_log_user_message(int audit_fd, int type, const char *message,
const char *hostname, const char *addr, const char *tty, int result);
extern int audit_log_user_comm_message(int audit_fd, int type,
const char *message, const char *comm, const char *hostname,
const char *addr, const char *tty, int result);
extern int audit_log_acct_message(int audit_fd, int type, const char *pgname,
const char *op, const char *name, unsigned int id,
const char *host, const char *addr, const char *tty, int result);
extern int audit_log_user_avc_message(int audit_fd, int type,
const char *message, const char *hostname, const char *addr,
const char *tty, uid_t auid);
extern int audit_log_semanage_message(int audit_fd, int type,
const char *pgname, const char *op, const char *name, unsigned int id,
const char *new_seuser, const char *new_role, const char *new_range,
const char *old_seuser, const char *old_role, const char *old_range,
const char *host, const char *addr,
const char *tty, int result);
extern int audit_log_user_command(int audit_fd, int type, const char *command,
const char *tty, int result);
extern struct audit_rule_data *audit_rule_create_data(void);
extern void audit_rule_init_data(struct audit_rule_data *rule);
extern int audit_rule_syscallbyname_data(struct audit_rule_data *rule,
const char *scall);
extern int audit_rule_io_uringbyname_data(struct audit_rule_data *rule,
const char *scall);
* takes just a *. That structure may need to be reallocated as a result of
* adding new fields */
extern int audit_rule_fieldpair_data(struct audit_rule_data **rulep,
const char *pair, int flags);
extern int audit_rule_interfield_comp_data(struct audit_rule_data **rulep,
const char *pair, int flags);
extern void audit_rule_free_data(struct audit_rule_data *rule);
int audit_can_control(void);
int audit_can_write(void);
int audit_can_read(void);
#ifdef __cplusplus
}
#endif
#endif