Imported Upstream version 2.7
[ossec-hids.git] / src / headers / defs.h
1 /* @(#) $Id: ./src/headers/defs.h, 2012/08/11 dcid Exp $
2  */
3
4 /* Copyright (C) 2009-2012 Trend Micro Inc.
5  * All rights reserved.
6  *
7  * This program is a free software; you can redistribute it
8  * and/or modify it under the terms of the GNU General Public
9  * License (version 2) as published by the FSF - Free Software
10  * Foundation.
11  *
12  * License details at the LICENSE file included with OSSEC or
13  * online at: http://www.ossec.net/en/licensing.html
14  */
15
16
17
18 /* Global definitions
19  */
20
21 #ifndef __OS_HEADERS
22 #define __OS_HEADERS
23
24
25 /* TRUE / FALSE definitions
26  */
27 #define TRUE            1
28 #define FALSE           0
29
30 /* Read / Write definitions
31  */
32 #define READ            1
33 #define WRITE           2
34
35
36 /* Size limit control */
37 #define OS_SIZE_8192    8192
38 #define OS_SIZE_6144    6144
39 #define OS_SIZE_4096    4096
40 #define OS_SIZE_2048    2048
41 #define OS_SIZE_1024    1024
42 #define OS_SIZE_256     256
43 #define OS_SIZE_128     128
44
45 #define OS_MAXSTR       OS_SIZE_6144    /* Size for logs, sockets, etc */
46 #define OS_BUFFER_SIZE  OS_SIZE_2048    /* Size of general buffers */
47 #define OS_FLSIZE           OS_SIZE_256     /* Maximum file size */
48 #define OS_HEADER_SIZE  OS_SIZE_128     /* Maximum header size */
49 #define OS_LOG_HEADER   OS_SIZE_256     /* Maximum log header size */
50 #define IPSIZE          16              /* IP Address size */
51
52
53 /* Some Global names */
54 #define __name      "OSSEC HIDS"
55 #define __version   "v2.7"
56 #define __author    "Trend Micro Inc."
57 #define __contact   "contact@ossec.net"
58 #define __site      "http://www.ossec.net"
59 #define __license   "\
60 This program is free software; you can redistribute it and/or modify\n\
61 it under the terms of the GNU General Public License (version 2) as \n\
62 published by the Free Software Foundation. For more details, go to \n\
63 http://www.ossec.net/main/license/\n"
64
65 /* Maximum allowed PID */
66 #ifdef SOLARIS
67     #define MAX_PID 29999
68 #else
69     #define MAX_PID 32768
70 #endif
71
72
73 /* Max limit of 256 agents */
74 #ifndef MAX_AGENTS
75     #define MAX_AGENTS  256
76 #endif
77
78
79 /* manager notification */
80 #define NOTIFY_TIME     600     /* every 10 minutes */
81
82
83 /* User Configuration */
84 #ifndef MAILUSER
85     #define MAILUSER        "ossecm"
86 #endif
87
88 #ifndef USER
89     #define USER            "ossec"
90 #endif
91
92 #ifndef REMUSER
93     #define REMUSER         "ossecr"
94 #endif
95
96 #ifndef GROUPGLOBAL
97     #define GROUPGLOBAL     "ossec"
98 #endif
99
100 #ifndef DEFAULTDIR              
101         #define DEFAULTDIR      "/var/ossec"
102 #endif
103
104
105 /* Default queue */
106 #define DEFAULTQUEUE    "/queue/ossec/queue"
107
108
109 /* Active response files */
110 #ifndef WIN32
111     #define DEFAULTAR       "/etc/shared/ar.conf"
112     #define AR_BINDIR       "/active-response/bin"
113     #define AGENTCONFIGINT  "/etc/shared/agent.conf"
114     #define AGENTCONFIG     DEFAULTDIR "/etc/shared/agent.conf"
115 #else
116     #define DEFAULTAR           "shared/ar.conf"
117     #define AR_BINDIR           "active-response/bin"
118     #define AGENTCONFIG         "shared/agent.conf"
119     #define AGENTCONFIGINT      "shared/agent.conf"
120 #endif
121
122
123 /* Exec queue */
124 #define EXECQUEUE           "/queue/alerts/execq"
125
126
127 /* Active response queue */
128 #define ARQUEUE         "/queue/alerts/ar"
129
130
131 /* Decoder file */
132 #define XML_DECODER     "/etc/decoder.xml"
133 #define XML_LDECODER    "/etc/local_decoder.xml"
134
135
136 /* Agent information location */
137 #define AGENTINFO_DIR    "/queue/agent-info"
138
139
140 /* Syscheck directory */
141 #define SYSCHECK_DIR    "/queue/syscheck"
142
143 /* Rootcheck directory */
144 #define ROOTCHECK_DIR    "/queue/rootcheck"
145
146 /* Diff queue */
147 #define DIFF_DIR        "/queue/diff"
148 #define DIFF_DIR_PATH   DEFAULTDIR DIFF_DIR
149 #define DIFF_NEW_FILE  "new-entry"
150 #define DIFF_LAST_FILE "last-entry"
151
152
153 /* Syscheck data */
154 #define SYSCHECK        "syscheck"
155 #define SYSCHECK_REG    "syscheck-registry"
156
157
158 /* Rule path */
159 #define RULEPATH        "/rules"
160
161
162 /* Wait file */
163 #ifndef WIN32
164     #define WAIT_FILE       "/queue/ossec/.wait"
165 #else
166     #define WAIT_FILE       ".wait"
167 #endif
168
169
170 /* Agent information file */
171 #ifndef WIN32
172     #define AGENT_INFO_FILE "/queue/ossec/.agent_info"
173     #define AGENT_INFO_FILEP DEFAULTDIR AGENT_INFO_FILE
174 #else
175     #define AGENT_INFO_FILE ".agent_info"
176     #define AGENT_INFO_FILEP AGENT_INFO_FILE
177 #endif
178
179
180 /* Syscheck restart */
181 #ifndef WIN32
182     #define SYSCHECK_RESTART        "/var/run/.syscheck_run"
183     #define SYSCHECK_RESTART_PATH   DEFAULTDIR SYSCHECK_RESTART
184 #else
185     #define SYSCHECK_RESTART        "syscheck/.syscheck_run"
186     #define SYSCHECK_RESTART_PATH   "syscheck/.syscheck_run"
187 #endif
188
189
190 /* Agentless directories. */
191 #define AGENTLESSDIR    "/agentless"
192 #define AGENTLESSPASS   "/agentless/.passlist"
193 #define AGENTLESS_ENTRYDIR  "/queue/agentless"
194
195
196 /* Internal definitions files */
197 #ifndef WIN32
198     #define OSSEC_DEFINES   "/etc/internal_options.conf"
199     #define OSSEC_LDEFINES   "/etc/local_internal_options.conf"
200 #else
201     #define OSSEC_DEFINES   "internal_options.conf"
202     #define OSSEC_LDEFINES   "local_internal_options.conf"
203 #endif
204
205
206 /* Log directories */
207 #define EVENTS          "/logs/archives"
208 #define EVENTS_DAILY    "/logs/archives/archives.log"
209 #define ALERTS          "/logs/alerts"
210 #define ALERTS_DAILY    "/logs/alerts/alerts.log"
211 #define FWLOGS          "/logs/firewall"
212 #define FWLOGS_DAILY    "/logs/firewall/firewall.log"
213
214
215 /* Stats directories */
216 #define STATWQUEUE  "/stats/weekly-average"
217 #define STATQUEUE   "/stats/hourly-average"
218 #define STATSAVED   "/stats/totals"
219
220
221 /* Authentication keys file */
222 #ifndef WIN32
223 #define KEYS_FILE       "/etc/client.keys"
224 #define KEYSFILE_PATH   DEFAULTDIR KEYS_FILE
225 #else
226 #define KEYS_FILE       "client.keys"
227 #define KEYSFILE_PATH   KEYS_FILE
228 #endif
229
230 #ifndef AUTH_FILE
231 #define AUTH_FILE       KEYS_FILE
232 #endif
233
234
235 /* Shared config directory */
236 #ifndef WIN32
237     #define SHAREDCFG_DIR   "/etc/shared"
238 #else
239     #define SHAREDCFG_DIR   "shared"
240 #endif
241
242 /* Built in defines */
243 #define DEFAULTQPATH    DEFAULTDIR DEFAULTQUEUE
244
245 #ifndef WIN32
246 #define OSSECCONF       "/etc/ossec.conf"
247 #define DEFAULTCPATH    DEFAULTDIR OSSECCONF
248 #else
249 #define OSSECCONF       "ossec.conf"
250 #define DEFAULTCPATH "ossec.conf"
251 #endif
252
253 #ifndef WIN32
254     #define DEFAULTARPATH   DEFAULTDIR DEFAULTAR
255     #define AR_BINDIRPATH   DEFAULTDIR AR_BINDIR
256     #define AGENTLESSDIRPATH    DEFAULTDIR AGENTLESSDIR
257     #define AGENTLESSPASSPATH   DEFAULTDIR AGENTLESSPASS
258     #define AGENTLESS_ENTRYDIRPATH  DEFAULTDIR AGENTLESS_ENTRYDIR
259 #else
260     #define DEFAULTARPATH   "shared/ar.conf"
261     #define AR_BINDIRPATH   "active-response/bin"
262     #define AGENTLESSDIRPATH    AGENTLESSDIR
263     #define AGENTLESSPASSPATH   AGENTLESSPASS
264     #define AGENTLESS_ENTRYDIRPATH  AGENTLESS_ENTRYDIR
265 #endif
266 #define EXECQUEUEPATH   DEFAULTDIR EXECQUEUE
267
268 #ifdef WIN32
269     #define SHAREDCFG_DIRPATH   SHAREDCFG_DIR
270 #else
271     #define SHAREDCFG_DIRPATH   DEFAULTDIR SHAREDCFG_DIR
272 #endif
273
274 #define SHAREDCFG_FILE      SHAREDCFG_DIR "/merged.mg"
275 #define SHAREDCFG_FILEPATH  SHAREDCFG_DIRPATH "/merged.mg"
276 #define SHAREDCFG_FILENAME  "merged.mg"
277
278
279 #define WAIT_FILE_PATH  DEFAULTDIR WAIT_FILE
280
281
282 /* Default ports */
283 #ifndef DEFAULT_SECURE
284         #define DEFAULT_SECURE 1514 /* Default encrypted */
285 #endif
286
287 #ifndef DEFAULT_SYSLOG
288         #define DEFAULT_SYSLOG 514 /* Default syslog port - udp */
289 #endif
290
291
292
293 /* Xml global elements */
294 #ifndef xml_global
295 #define xml_global "global"
296 #endif
297
298 #ifndef xml_alerts
299 #define xml_alerts "alerts"
300 #endif
301
302 #ifndef xml_rules
303 #define xml_rules "rules"
304 #endif
305
306 #ifndef xml_localfile
307 #define xml_localfile "localfile"
308 #endif
309
310 #ifndef xml_remote
311 #define xml_remote "remote"
312 #endif
313
314 #ifndef xml_client
315 #define xml_client "client"
316 #endif
317
318 #ifndef xml_execd
319 #define xml_execd "execd"
320 #endif
321
322 #ifndef xml_syscheck
323 #define xml_syscheck "syscheck"
324 #endif
325
326 #ifndef xml_rootcheck
327 #define xml_rootcheck "rootcheck"
328 #endif
329
330 #ifndef xml_command
331 #define xml_command  "command"
332 #endif
333
334 #ifndef xml_ar
335 #define xml_ar      "active-response"
336 #endif
337
338 #endif /* __OS_HEADERS */