Project

General

Profile

Archive and statistics » History » Version 11

Janez Barbic, 13.12.2010 00:51

1 1 Aleksander Bešir
h1. Archive and statistics
2
3 6 Janez Barbic
WIP - trenutno se delam na dokumentu, ne se brat :)
4
5 2 Aleksander Bešir
{{toc}}
6
7 5 Janez Barbic
TBD - to be discussed
8
TODO - to do :)
9
Tole sem pustil zaenkrat not, da lahko hitro najdem stvari, ki jih moram se dopolnit oziroma jih moramo se predebatirat. V koncni verziji se bom teh kratic znebil in tudi tega komentarja v slovenscini :)
10 1 Aleksander Bešir
11 6 Janez Barbic
h2. 1 Basic concept
12 3 Janez Barbic
13 11 Janez Barbic
TODO Why syslog
14 3 Janez Barbic
15 11 Janez Barbic
p. Eneraptor is designed in a way that it could communicate with any device regardless of its operating system. Syslog, system for logging program messages offers a quick and easy solutions for such communications, because it allows separation of the software that generates messages from the system that stores them and the software that reports and analyzes them.
16 1 Aleksander Bešir
17 11 Janez Barbic
TODO malo nerodno zapisano?
18
19 3 Janez Barbic
h3. 1.1 Hardware
20 1 Aleksander Bešir
21 11 Janez Barbic
p. We will be using syslog-ng (syslog from now on), which has a few advantages over conventional syslog. Most basic setup , originator - collector, suits our needs just fine so far, but it can also be extended in the future. Syslog daemon (collector) will run on proxy server, syslog client (originator) will run on FRI-SMS system.
22 1 Aleksander Bešir
23 11 Janez Barbic
TBD collector will be listening to a certain port (5140 - most commonly used) for incoming messages from client(s).
24
25 5 Janez Barbic
Client mode operation:
26 1 Aleksander Bešir
27 5 Janez Barbic
!https://lusy.fri.uni-lj.si/redmine/attachments/11/client_server_syslog.png!
28 1 Aleksander Bešir
29
p. In client mode, syslog-ng collects the local logs generated by the host and forwards them through a network connection to the central syslog-ng server. Clients can also log the messages locally into files.
30 5 Janez Barbic
31 1 Aleksander Bešir
32 11 Janez Barbic
TODO more details on syslog-ng advantages over conventional syslog?
33 5 Janez Barbic
34 11 Janez Barbic
h3. 1.2 Syslog message format
35 5 Janez Barbic
36 11 Janez Barbic
37
38 5 Janez Barbic
TBD TCP/IP vs UDP
39
TBD How do we plan to send messages to our daemon, via client (not always possible) or do we generate them ourselves?
40
TBD Using logfiles vs logging into database
41
42
h3. 1.3 Development steps
43
44
# Installing and configuring Syslog-ng daemon on proxy
45
# Installing and configuring Syslog-ng client on FRI-SMS
46
# TBD Designing Statistical Data Analysis Software to work with data collected by syslog daemon
47
# TBD Implementing SDA software
48 1 Aleksander Bešir
# TBD Testing?
49 6 Janez Barbic
50
51
h2. 2 Installing and configuring syslog-ng daemon on proxy
52 7 Janez Barbic
53
p. Syslog-ng supports wide variety of Operating Systems so we aren't really restricted here. Since our proxy and FRI-SMS both run Linux 2.6 our obvious choce is syslog-ng for Linux.
54 9 Janez Barbic
55 1 Aleksander Bešir
h3. 2.1 syslog-ng daemon on proxy
56 9 Janez Barbic
57 7 Janez Barbic
Configuration file location:
58
/opt/syslog-ng/etc/syslog-ng.conf
59
60 8 Janez Barbic
Basic syslog configuration:
61
TODO add filters
62 7 Janez Barbic
<pre><code class="ruby">
63
@version: 3.2
64
#Default configuration file for syslog-ng.
65
#
66
# For a description of syslog-ng configuration file directives, please read
67
# the syslog-ng Administrator's guide at:
68
#
69
# http://www.balabit.com/dl/html/syslog-ng-admin-guide_en.html/bk01-toc.html
70
#
71 1 Aleksander Bešir
72
options {
73 8 Janez Barbic
   time_reap(30);
74
   mark_freq(10);
75
   keep_hostname(yes);
76
};
77 7 Janez Barbic
78
######
79
# sources
80
source s_local {
81
};
82
83
source s_net {
84 8 Janez Barbic
   tcp(ip("SERVER_ADDRESS") port(5140) keep-alive(yes)); 
85 7 Janez Barbic
};
86
87
######
88
# destinations
89 8 Janez Barbic
# should be able to point syslog to a database here
90 7 Janez Barbic
destination net_messages { file("/var/log/net_messages"); };
91
92
log {
93
source(s_net);
94
destination(net_messages);
95
};
96
</code></pre>
97 6 Janez Barbic
98
h3. 2.2 syslog-ng client on FRI-SMS
99 9 Janez Barbic
100
Configuration file location:
101
/opt/syslog-ng/etc/syslog-ng.conf
102
103
Basic syslog client configuration:
104
TODO add filters
105
106
<pre><code class="ruby">
107
@version: 3.2
108
#Default configuration file for syslog-ng.
109
#
110
# For a description of syslog-ng configuration file directives, please read
111
# the syslog-ng Administrator's guide at:
112
#
113
# http://www.balabit.com/dl/html/syslog-ng-admin-guide_en.html/bk01-toc.html
114
#
115
116
options {
117
};
118
119
######
120
# sources
121
source s_local {
122
   # TBD what triggers our messages
123
   # message generated by Syslog-NG
124
   internal();
125
   # standard Linux log source (this is the default place for the syslog()
126
   # function to send logs to)
127
   unix-stream("/dev/log");
128
   # messages from the kernel
129
   file("/proc/kmsg" program_override("kernel"));
130
};
131
132
133
######
134
# destinations
135
# local
136
# destination d_messages { file("/var/log/messages"); };
137
# net
138
destination host { tcp("SERVER_ADDRESS" port(5140)); };
139
140
# logging locally
141
# log {
142
#   source(s_local);
143
#   destination(d_messages);
144
#};
145
146
# sending log messages
147
log {
148
   source(s_local);
149
   destination(host);
150
};
151 10 Janez Barbic
</code></pre>
152 1 Aleksander Bešir
153
h2. Statistical Data Analysis Software
154
155 10 Janez Barbic
TODO
156
157
h2. References
158
159 11 Janez Barbic
"Syslog protocol, RFC 5424":http://tools.ietf.org/html/rfc5424
160
"Syslog-ng homepage":http://www.balabit.com/network-security/syslog-ng
161
"Syslog-ng administrator guide":http://www.balabit.com/support/documentation/syslog-ng-ibm-agent-guide-admin-en.pdf