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