Gentoo Archives: gentoo-commits

From: "Davide Cendron (scen)" <scen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/doc/it: logcheck.xml
Date: Wed, 26 Jan 2011 22:56:28
Message-Id: 20110126225619.B6B4120054@flycatcher.gentoo.org
1 scen 11/01/26 22:56:19
2
3 Added: logcheck.xml
4 Log:
5 Initial commit: version 2, revision 1.2 of EN CVS
6
7 Revision Changes Path
8 1.1 xml/htdocs/doc/it/logcheck.xml
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/it/logcheck.xml?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/it/logcheck.xml?rev=1.1&content-type=text/plain
12
13 Index: logcheck.xml
14 ===================================================================
15 <?xml version='1.0' encoding='UTF-8'?>
16 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
17 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/it/logcheck.xml,v 1.1 2011/01/26 22:56:19 scen Exp $ -->
18
19 <guide lang="it">
20 <title>guida a Logcheck</title>
21
22 <author title="Autore">
23 <mail link="phajdan.jr"/>
24 </author>
25 <author title="Redazione">
26 <mail link="nightmorph"/>
27 </author>
28 <author title="Traduzione">
29 <mail link="scen"/>
30 </author>
31
32 <abstract>
33 Questa guida mostra come analizzare i log di sistema con logcheck.
34 </abstract>
35
36 <!-- The content of this document is licensed under the CC-BY-SA license -->
37 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
38 <license/>
39
40 <version>2</version>
41 <date>2010-10-12</date>
42
43 <chapter>
44 <title>Primi passi con logcheck</title>
45 <section>
46 <title>Contesto</title>
47 <body>
48
49 <p>
50 <c>logcheck</c> è una versione aggiornata di <c>logsentry</c> (dal pacchetto
51 <c>sentrytools</c>), uno strumento per analizzare i log di sistema. In aggiunta,
52 <c>logcheck</c> è corredato con un database interno di messaggi di log standard
53 e solitamente non interessanti per filtrare le informazioni inutili. L'idea
54 generale dello strumento è che tutti i messaggi sono interessanti, tranne quelli
55 esplicitamente marcati come "rumore". <c>logcheck</c> invia periodicamente una
56 e-mail con il sommario di tutti i messaggi di rilievo.
57 </p>
58
59 </body>
60 </section>
61 <section>
62 <title>Installare logcheck</title>
63 <body>
64
65 <impo>
66 È fortemente raccomandato rimuovere logsentry se installato sul proprio sistema.
67 Inoltre è preferibile rimuovere /etc/logcheck per evitare problemi di permessi e
68 collisioni tra file.
69 </impo>
70
71 <pre caption="Rimuovere logsentry">
72 <comment>(Disinstallare il pacchetto logsentry)</comment>
73 # <i>emerge -C logsentry</i>
74 <comment>(Rimuovere i file rimasti)</comment>
75 # <i>rm -rf /etc/logcheck</i>
76 </pre>
77
78 <p>
79 Ora è possibile procedere con l'installazione di logcheck.
80 </p>
81
82 <pre caption="Installare logcheck">
83 # <i>emerge -av app-admin/logcheck</i>
84 </pre>
85
86 </body>
87 </section>
88 <section>
89 <title>Configurazione di base</title>
90 <body>
91
92 <p>
93 <c>logcheck</c> crea un utente a parte denominato "logcheck" per evitare di
94 essere eseguito come root. In effetti esso si rifiuterà di essere eseguito come
95 utente root. Per permettergli di analizzare i log, bisogna assicurarsi che essi
96 siano leggibili da logcheck. Ecco un esempio per <c>syslog-ng</c>:
97 </p>
98
99 <pre caption="stralcio di /etc/syslog-ng/syslog-ng.conf">
100 options {
101 owner(root);
102
103 <comment>(Rendere i file di log leggibili dal gruppo logcheck)</comment>
104 group(logcheck);
105 perm(0640);
106 };
107 </pre>
108
109 <p>
110 Ora ricaricare la configurazione ed assicurarsi che le modifiche funzionino come
111 previsto.
112 </p>
113
114 <pre caption="Ricaricare la configurazione di syslog-ng">
115 # <i>/etc/init.d/syslog-ng reload</i>
116 <comment>(Assicurarsi che /var/log/messages abbia i permessi corretti)</comment>
117 # <i>ls -l /var/log/messages</i>
118 -rw-r----- 1 root logcheck 1694438 Feb 12 12:18 /var/log/messages
119 </pre>
120
121 <p>
122 Ora sistemare alcune impostazioni basilari di <c>logcheck</c> in
123 <path>/etc/logcheck/logcheck.conf</path>.
124 </p>
125
126 <pre caption="Configurazione basilare di /etc/logcheck/logcheck.conf">
127 # Controls the level of filtering:
128 # Can be Set to "workstation", "server" or "paranoid" for different
129 # levels of filtering. Defaults to server if not set.
130 <comment>(Il livello include server, e server include paranoid.
131 Il livello paranoid non filtra praticamente nessun messaggio)</comment>
132 REPORTLEVEL="server"
133
134 # Controls the address mail goes to:
135 # *NOTE* the script does not set a default value for this variable!
136 # Should be set to an offsite "emailaddress@×××××××××××.tld"
137 <comment>(Assicurarsi di ricevere le e-mail di logcheck. Una verifica è
138 fortemente consigliata)</comment>
139 SENDMAILTO="root"
140
141 # Controls if syslog-summary is run over each section.
142 # Alternatively, set to "1" to enable extra summary.
143 # HINT: syslog-summary needs to be installed.
144 <comment>(Se si ricevono un sacco di messaggi simili tra loro nei log, si
145 potrebbe voler installare app-admin/syslog-summary e abilitare questa impostazione)</comment>
146 SYSLOGSUMMARY=0
147 </pre>
148
149 <p>
150 Inoltre bisogna specificare a <c>logcheck</c> quali file di log analizzare
151 (<path>/etc/logcheck/logcheck.logfiles</path>).
152 </p>
153
154 <pre caption="Configurazione basilare di /etc/logcheck/logcheck.logfiles">
155 <comment>(Questo è un esempio per syslog-ng)</comment>
156 /var/log/messages
157 </pre>
158
159 <p>
160 Infine, abilitare il processo cron di logcheck.
161 </p>
162
163 <pre caption="Abilitare il processo cron di logcheck">
164 <comment>(Modifcare il file di cron e seguire le istruzioni all'interno)</comment>
165 # <i>nano -w /etc/cron.hourly/logcheck.cron</i>
166 </pre>
167
168 <note>
169 Per ulteriori informazioni su cron leggere la <uri link="/doc/it/cron-guide.xml">
170 Guida a Cron</uri>.
171 </note>
172
173 <p>
174 Congratulazioni! Ora si riceveranno regolarmente i messaggi di log importante
175 tramite email. Un esempio di messaggio potrebbe essere questo:
176 </p>
177
178 <pre caption="Messaggio d'esempio di logcheck">
179 System Events
180 =-=-=-=-=-=-=
181 Feb 10 17:13:53 localhost kernel: [30233.238342] conftest[25838]: segfault at 40 ip 40061403 sp bfc443c4 error 4
182 in libc-2.10.1.so[4003e000+142000]
183 Feb 11 12:31:21 localhost postfix/pickup[18704]: fatal: could not find any active network interfaces
184 Feb 11 12:31:22 localhost postfix/master[3776]: warning: process //usr/lib/postfix/pickup pid 18704 exit status 1
185 Feb 11 12:31:22 localhost postfix/master[3776]: warning: //usr/lib/postfix/pickup: bad command startup -- throttling
186 </pre>
187
188 </body>
189 </section>
190 </chapter>
191
192 <chapter>
193 <title>Risoluzione dei problemi</title>
194 <section>
195 <title>Consigli generali</title>
196 <body>
197
198 <p>
199 È possibile usare il parametro <c>-d</c> di logcheck per visualizzare ulteriori
200 informazioni di debug. Esempio:
201 </p>
202
203 <pre caption="Effettuare il debug di logcheck">
204 # <i>su -s /bin/bash -c '/usr/sbin/logcheck -d' logcheck</i>
205 D: [1281318818] Turning debug mode on
206 D: [1281318818] Sourcing - /etc/logcheck/logcheck.conf
207 D: [1281318818] Finished getopts c:dhH:l:L:m:opr:RsS:tTuvw
208 D: [1281318818] Trying to get lockfile: /var/lock/logcheck/logcheck.lock
209 D: [1281318818] Running lockfile-touch /var/lock/logcheck/logcheck.lock
210 D: [1281318818] cleanrules: /etc/logcheck/cracking.d/kernel
211 ...
212 D: [1281318818] cleanrules: /etc/logcheck/violations.d/su
213 D: [1281318818] cleanrules: /etc/logcheck/violations.d/sudo
214 ...
215 D: [1281318825] logoutput called with file: /var/log/messages
216 D: [1281318825] Running /usr/sbin/logtail2 on /var/log/messages
217 D: [1281318825] Sorting logs
218 D: [1281318825] Setting the Intro
219 D: [1281318825] Checking for security alerts
220 D: [1281318825] greplogoutput: kernel
221 ...
222 D: [1281318825] greplogoutput: returning 1
223 D: [1281318825] Checking for security events
224 ...
225 D: [1281318825] greplogoutput: su
226 D: [1281318825] greplogoutput: Entries in checked
227 D: [1281318825] cleanchecked - file: /tmp/logcheck.uIFLqU/violations-ignore/logcheck-su
228 D: [1281318825] report: cat'ing - Security Events for su
229 ...
230 D: [1281318835] report: cat'ing - System Events
231 D: [1281318835] Setting the footer text
232 D: [1281318835] Sending report: 'localhost 2010-08-09 03:53 Security Events' to root
233 D: [1281318835] cleanup: Killing lockfile-touch - 17979
234 D: [1281318835] cleanup: Removing lockfile: /var/lock/logcheck/logcheck.lock
235 D: [1281318835] cleanup: Removing - /tmp/logcheck.uIFLqU
236 </pre>
237
238 </body>
239 </section>
240 </chapter>
241 </guide>