new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / config / syscheck-config.h
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All right reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation
8  */
9
10 #ifndef __SYSCHECKC_H
11 #define __SYSCHECKC_H
12
13 #define MAX_DIR_SIZE    64
14 #define MAX_DIR_ENTRY   128
15 #define SYSCHECK_WAIT   300
16
17 /* Checking options */
18 #define CHECK_MD5SUM        0000001
19 #define CHECK_PERM          0000002
20 #define CHECK_SIZE          0000004
21 #define CHECK_OWNER         0000010
22 #define CHECK_GROUP         0000020
23 #define CHECK_SHA1SUM       0000040
24 #define CHECK_REALTIME      0000100
25 #define CHECK_SEECHANGES    0000200
26 #define CHECK_SHA256SUM     0000400
27 #define CHECK_GENERIC       0001000
28 #define CHECK_NORECURSE     0002000
29
30
31 #include <stdio.h>
32
33 #include "os_regex/os_regex.h"
34
35 typedef struct _rtfim {
36     int fd;
37     OSHash *dirtb;
38 #ifdef WIN32
39     HANDLE evt;
40 #endif
41 } rtfim;
42
43 typedef struct _config {
44     unsigned int tsleep;            /* sleep for sometime for daemon to settle */
45     int sleep_after;
46     int rootcheck;                  /* set to 0 when rootcheck is disabled */
47     int disabled;                   /* is syscheck disabled? */
48     int scan_on_start;
49     int realtime_count;
50     short skip_nfs;
51
52     int time;                       /* frequency (secs) for syscheck to run */
53     int queue;                      /* file descriptor of socket to write to queue */
54
55     int *opts;                      /* attributes set in the <directories> tag element */
56
57     char *remote_db;
58     char *db;
59
60     char *scan_day;                 /* run syscheck on this day */
61     char *scan_time;                /* run syscheck at this time */
62
63     char **ignore;                  /* list of files/dirs to ignore */
64     OSMatch **ignore_regex;         /* regex of files/dirs to ignore */
65
66     char **nodiff;                  /* list of files/dirs to never output diff */
67     OSMatch **nodiff_regex;         /* regex of files/dirs to never output diff */
68
69     char **dir;                     /* array of directories to be scanned */
70     OSMatch **filerestrict;
71
72     /* Windows only registry checking */
73 #ifdef WIN32
74     char **registry_ignore;         /* list of registry entries to ignore */
75     void **registry_ignore_regex;   /* regex of registry entries to ignore */
76     char **registry;                /* array of registry entries to be scanned */
77     FILE *reg_fp;
78 #endif
79
80     OSHash *fp;
81
82     rtfim *realtime;
83
84     char *prefilter_cmd;
85
86 } syscheck_config;
87
88 int dump_syscheck_entry(syscheck_config *syscheck, const char *entry, int vals, int reg, const char *restrictfile) __attribute__((nonnull(1, 2)));
89
90 char *syscheck_opts2str(char *buf, int buflen, int opts);
91
92 #endif /* __SYSCHECKC_H */
93