Archivi per ‘software’

Provvedimento del garante sugli Amministratori di sistema

Premetto che la ritengo una gran cagata… e completamente inutile, visto che i log NON HANNO ALCUN VALORE PROBATORIO!

Ma visto che dobbiamo adeguarci… cerchiamo di farlo a COSTO ZERO!

Io ho risolto (sto risolvendo) così:

Installo rsyslog con logging su file sul logserver

Su un server linux CentOs 5.*

yum install rsyslog*
vim /etc/sysconfig/rsyslog
sostituisco
SYSLOGD_OPTIONS=”-m 0″
con
SYSLOGD_OPTIONS=”-m 0 -r”
vim /etc/rsyslog.conf
###################################################
$template DynAuth, “/var/log/TUTTI/%$MONTH%/%$DAY%/%FROMHOST%.log”
local1.*,user.*,auth.*,authpriv.*,kern.* ?DynAuth
$EscapeControlCharactersOnReceive off
%msg:::space-cc%
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 *
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log
local3.*                                                /var/log/varie.log
###################################################
vedi http://openskill.info/infobox.php?ID=1475

Abilitare il logging su tutti i server linux

Su un qualsiasi server linux

cat /etc/syslog.conf

auth.*;authpriv.*;local1.*          @logserver.dominio

Su ogni server devo poi creare utenti PERSONALI da assegnare a tutti gli AdS:
useradd -G wheel -m -s /bin/bash username
passwd username
Aggiungo
AllowUsers username
in /etc/ssh/sshd_config
lancio
visudo
e aggiungo o decommento la riga seguente:
%wheel  ALL=(ALL)       ALL
In questo modo gli AdS dovranno loggarsi con il loro account ed usare sudo
(consiglio il sudo -i o sudo -u per diventare root)
Il vantaggio dell’uso di sudo sta nel fatto che ho potuto cambiare password a root e metterla in cassaforte senza la necessità di comunicarla a tutti gli AdS (dato che sudo permette di diventare root inserendo la propria password)

Abilitare il logging su Oracle 9i

mkdir /var/log/oracle/
chown -R oracle:dba /var/log/oracle/
SHOW PARAMETER audit
ALTER SYSTEM SET audit_trail=OS SCOPE=SPFILE;
ALTER SYSTEM SET audit_sys_operations=TRUE SCOPE=SPFILE;
ALTER SYSTEM SET audit_file_dest=”/var/log/oracle” SCOPE=SPFILE;
AUDIT SESSION;
SHUTDOWN IMMEDIATE
startup
Occorre poi creare un cron sul logserver che filtra solo i login/logout e prelevi i risultati.
Nella ver 9i infatti non è possibile inviare i log a un remote syslog

Abilitare il logging su Postgres

Modifico
/usr/local/pgsql/data/postgresql.conf
come segue:

log_destination = ’syslog’

syslog_facility = ‘LOCAL1′
syslog_ident = ‘postgres’
log_connections = true
log_disconnections = true
log_duration = true
log_hostname = true

Abilitare il logging su MySql

Dato che mysql non supporta la scrittura di log su syslog si può risolvere nel seguente modo:

Nel file
/etc/my.cnf

nella sezione
[mysqld]

aggiungo
log=/var/log/mysql.log

Poi lancio all’avvio il seguente comando:

tail -f /var/log/mysql.log | egrep ‘Connect|Quit’ | logger -p LOCAL1.info -t mysql &

e lo salvo nell’ rc.local

tail -f /var/log/mysql.log | egrep ‘Connect|Quit’ | logger -p LOCAL1.info -t mysql &

e lo metto anche nella sezione postrotate del logrotate in
/etc/logrotate.d/mysql-log-rotate

Altrimenti, come suggeritomi dal buon Alessandro Corbelli di www.web4web.it si possono usare le named pipe:

http://www.linuxjournal.com/article/2156

http://www.linuxjournal.com/content/using-named-pipes-fifos-bash

Non loggo tutto su file ma ho creato una named pipe ed in inittab ho inserito, in respawn, uno script così composto

while [ true ]; do
tail -f <namedpipe> | egrep ‘Connect|Quit’ | logger…
done

Le prestazioni sono ‘abbastanza’ decenti.
Il while sarebbe anche superfluo…

Occorre fare attenzione a un particolare:

Se si utilizza la named pipe con lo script in inittab, nello script NON deve esserci il tail, ma il cat.

Quindi lo script diventa:

while [ true ]; do
cat <namedpipe> | egrep ‘Connect|Quit’ | logger -p LOCAL1.info -t mysql
done


Abilitare il logging sui server Windows

Sui server windows

Ho usato snare:

SnareSetup-3.1.5-MultiArch.exe

http://www.intersectalliance.com/projects/SnareWindows/index.html

Come “Destination snare server address” ho messo lo stesso ip del log server e come porta la 514

Abilitare il logging su Exchange

Per abilitare il logging sel mailserver:

Gestore sistema Exchange -> Gruppi amministrativi -> <nome>  -> server -> NomeServer -> tasto dx sul server -> registrazione Diagnostica
-> MSExchangeIS -> private o cassetta postale -> Accessi = minima; Controllo accessi = minima (oppure logons=minima e access control = minima)

Poi su snare:
Creo un nuovo oggetto:
Identify the high level event = Any event(s)
Event ID Search Term = 1009,1016,1013,1029
General Search Term = *
Select the User Match Type = Include
User Search Term = *admin*
Identify the event types to be captured = Success Audit + Failure Audit
Identify the event logs = Security  + Application
Select the Alert Level = Critical

Abilitare il logging sul FileServer

Creo un nuovo oggetto:
Identify the high level event = Any event(s)
Event ID Search Term = 538,540,552,551,682,683,528
General Search Term = *
Select the User Match Type = Include
User Search Term = *admin*
Identify the event types to be captured = TUTTI
Identify the event logs = Security
Select the Alert Level = Critical

Immodificabilità dei log

Ogni notte, sul logserver, parte un cron che mi crea un md5 di tutti i file di log

Lo chiamo Z_calcola_md5.sh in modo che il cron lo chiama da ultimo DOPO il logrotate

cat /etc/cron.daily/Z_calcola_md5.sh

########################################
#!/bin/bash
TMP=`/bin/date –date=’1 days ago’ +%m/%d`
FILE_NAME=”MD5-`/bin/date –date=’1 days ago’ +%m-%d`.md5″
DEST_DIR01=”/var/log/TUTTI”
DEST_DIR=”$DEST_DIR01/$TMP/”
MD5_DIR=”/var/log/TUTTI/MD5/”
cd $MD5_DIR
find  $DEST_DIR  -type f -exec md5sum {} \;  > $FILE_NAME
#########################################

A questo punto posso creare un tar.gz e salvare i log su un dvd o effettuarne un backup

  • Share/Bookmark

Libnet questa introvabile sconosciuta

category Linux, slackware 12, software admin 23 July 2009

Dato che per compilare snort serve libnet 1.02a
Dato che il sito di riferimento (http://www.packetfactory.net/projects/libnet/) non è raggiungibile
Ho trovato il pacchetto in questo sito:

http://www.filewatcher.com/m/libnet-1.0.2a.tar.gz.140191.0.0.html

e per sicurezza ne allego una copia quilibnet-102a

  • Share/Bookmark

JoomlaFAP installazione e accessibilità

Intro
Prima di tutto occorre ringraziare per il MERAVIGLIOSO progetto e agiungere i corretti riferimenti
Sito del progetto: http://joomlacode.org/gf/project/joomlafap1_5

Download: http://joomlacode.org/gf/project/joomlafap1_5/frs/

Segnalazioni di errore su: http://joomlacode.org/gf/project/joomlafap1_5/tracker/

Le istruzioni sono nei video tutorial: http://joomlacode.org/gf/project/joomlafap1_5/docman/?subdir=466

Installazione e configurazione

Scarica joomla 1.5 – Joomla_1.5.10_ita-Stable.tgz e esegui l’installazione

Scarica il template
http://joomlacode.org/gf/download/frsrelease/9169/34135/tpl_accessible_81.zip
da qui
http://joomlacode.org/gf/project/joomlafap1_5/frs/?action=FrsReleaseBrowse&frs_package_id=3542

oppure usa quello allegato che è modificato da me copiandolo nella root del sito ed estraendolo lì con tar -zxvf template….)

template-maox-accessibiletar

scarica il modulo per le access-key da qui
http://joomlacode.org/gf/project/joomlafap1_5/frs/?action=FrsReleaseBrowse&frs_package_id=3543

attualmente è il seguente:
http://joomlacode.org/gf/download/frsrelease/9022/33465/com_accesskeys_77.zip

Poi scarica le patch del core da qui
http://joomlacode.org/gf/project/joomlafap1_5/scmsvn/?action=browse&path=%2Fcorepatches%2F

basta il file delle differenze:
joomla_fap_15_2009-03-29.diff

oppure, su linux (dopo aver installato subversion) creare una dir
temporanea:
mkdir tmp
cd tmp
svn checkout –username anonymous http://joomlacode.org/svn/joomlafap1_5/corepatches/
password: anonymous

copiare il file delle differenze nella root del sito:
cp joomla_fap_15_2009-03-29.diff ../

ed eseguire la patch:
patch -p0 < joomla_fap_15_2009-03-29.diff

Adesso copiare nella root del sito i 3 file delle differenze allegati di seguito ed
eseguire:
(serve x passare la validazione dell’xhtml)

maoxcom_contact

maoxcom_newsfeeds

maoxcom_weblinks

patch -p0 < MaoX.com_newsfeeds.diff
patch -p0 < MaoX.com_weblinks.diff
patch -p0 < MaoX.com_contact.diff

Nella sezione amministrativa:

modificare il Top Menu (sezione moduli) come nelle immagini allegate di seguito

Installare il componente access_key
Settare il template accessibile come predefinito.

Il risultato può essere visualizzato qui:

http://portale-energia.provincia.prato.it/

  • Share/Bookmark

Problema nagios-plugin su CentOS 4 – invalid option tune=pentium4

category centos, software admin 7 August 2008

Ho avuto difficoltà ad installare i plugin del nagios.
Dopo il make
ottenevo l’errore:
invalid option `tune=pentium4′

Per risolvere ho editato il file plugins/Makefile
ed ho eliminato l’opzione:
-mtune=pentium4

rilanciato il make e…
TUTTO OK!

Saluti

  • Share/Bookmark

[Recensione] – Un ottimo software per la gestione dei Blog

category recensione, software admin 26 June 2007

http://www.lifetype.net/


principio di Napoleone:
non attribuire a malintenzione cio’ che puo’
essere semplicemente spiegato come imbecillita’

MaoX Blog:
http://maox.blogspot.com

  • Share/Bookmark

Dovecot con supporto mysql su fedora – creare il proprio rpm

category Linux, fedora, software admin 15 June 2007
DOVECOT con supporto mysql 

La stessa cosa vista x postfix la si può fare x Dovecot: wget http://download.fedora.redhat.com/pub/fedora/linux/core/development/source/SRPMS/dovecot-1.0-2.rc17.fc7.src.rpm rpm -Uhv dovecot-1.0-2.rc17.fc7.src.rpm wget http://www.dovecot.org/releases/dovecot-1.0.rc22.tar.gz cp dovecot-1.0.rc22.tar.gz /usr/src/redhat/SOURCES/ cd /usr/src/redhat/SPECS vi dovecot.specs cambio  %define build_postgres 0 Release .......   yum install gettext-devel  rpmbuild -ba dovecot.specs rpmbuild -bb dovecot.specs  cd /usr/src/redhat/RPMS/i386/  rpm -Uhv ./dovecot-*   Seguo  http://wiki.dovecot.org/DovecotLDAPostfixAdminMySQL
  • Share/Bookmark

Postfix con supporto mysql su fedora – creare il proprio rpm

Postfix con supporto mysql su Fedora

Get the latest source rpm fromFedora Core Developmentand install it
or here:
http://download.fedora.redhat.com/pub/fedora/linux/updates/7/SRPMS/

(Note: the src.rpm not the i386.rpm) with:

rpm -Uvh postfix-2.3.x-1.src.rpm   

If it still not the latest get the latest source from any of thePostfix Download Siteand put int into
rpm/SOURCES/ directory. In postfix.spec modify the version and add MySQL support (%define MYSQL 1) and build it:

rpmbuild -ba postfix.spec
rpmbuild -bb postfix.spec

Cioè:scarico l'RPM con i sorgenti,poi scarico l'ultima versione di postfix e lo installoTutto va a finire in /usr/src/redhat/SOURCES/qui sostituiscopostfix-2.3.6.tar.gzconpostfix-2.3.7.tar.gzpoi in/usr/src/redhat/SPECS/modificopostfix.spec%define MYSQL 1 Version: 2.3.7e poi lanciorpmbuild -ba postfix.specrpmbuild -bb postfix.specin/usr/src/redhat/RPMS/i386trovo i pacchetti RPM  e quindicd /usr/src/redhat/RPMS/i386rpm -Uhv ./*

FATTO!!!!

[da http://dailypackage.fedorabook.com/index.php?/archives/6-Wednesday-Why-The-Alternatives-System.html]

To select one of these two packages interactively, the alternatives command is used with the –config option and the generic name of the feature that is being configured:

# alternatives –config mta

There are 2 programs which provide ‘mta’.

Selection Command
———————————————–
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number:

Note that the highest-priority alternative is marked with an astrisk (*), and the currently-selected option is marked with a plus-sign (+). Press enter to keep the current setting or enter a number to select another value.

To select an alternative directly from the command line, use the –set option:

# alternatives –set mta /usr/sbin/sendmail.postfix

You can see the current value by using the –display option:

# alternatives –display mta
mta – status is manual.
link currently points to /usr/sbin/sendmail.sendmail
/usr/sbin/sendmail.sendmail – priority 90
slave mta-pam: /etc/pam.d/smtp.sendmail
slave mta-mailq: /usr/bin/mailq.sendmail
slave mta-newaliases: /usr/bin/newaliases.sendmail
slave mta-rmail: /usr/bin/rmail.sendmail
slave mta-sendmail: /usr/lib/sendmail.sendmail
slave mta-mailqman: /usr/share/man/man1/mailq.sendmail.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
/usr/sbin/sendmail.postfix – priority 30
slave mta-pam: /etc/pam.d/smtp.postfix
slave mta-mailq: /usr/bin/mailq.postfix
slave mta-newaliases: /usr/bin/newaliases.postfix
slave mta-rmail: /usr/bin/rmail.postfix
slave mta-sendmail: /usr/lib/sendmail.postfix
slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best’ version is /usr/sbin/sendmail.sendmail.

Instead of selecting the alternative manually, you can choose to have the highest-priority option automatically selected. This will enable an automatic change as packages are added and removed:

# alternatives –auto mta

The most common use of the alternatives system is to select between implementations of Java, the print server, and the mail transfer agent. Fedora’s implementation of alternatives is a rewrite and extension of the alternatives system used in Debian.

(Why is the generic name linked to a name in /etc/alternatives which is symlinked to the target, instead of the generic name being directly symlinked to the target? This was done so that the configuration information is contained in the /etc directory, centralizing the location of configuration data).

  • Share/Bookmark

Ottimo CRM – Gestione Clienti

category recensione, software admin 10 June 2007

http://www.sugarcrm.com


principio di Napoleone: non attribuire a malintenzione cio' che puo' essere semplicemente spiegato come imbecillita'
MaoX Blog:
Problemi e soluzioni di un sistemista informatico:
http://maox.blogspot.com

  • Share/Bookmark

Ricompilare il kernel su fedora

category Linux, fedora, software admin 10 June 2007

http://fedoraserver.unipa.it/fedora/desktop/fedora-7/come-compilare-il-kernel-di-fedora-7-partendo-dai-sorgenti/


principio di Napoleone: non attribuire a malintenzione cio' che puo' essere semplicemente spiegato come imbecillita'
MaoX Blog:
Problemi e soluzioni di un sistemista informatico:
http://maox.blogspot.com

  • Share/Bookmark

Nut – Configurazioni

category Linux, recensione, software admin 4 June 2007

http://opensource.mgeups.com/howto.htm#test-cfg
http://opensource.mgeups.com/ups.htm
http://opensource.mgeups.com/install/debian.htm
http://www.mscs.dal.ca/~selinger/ups/backups.html


principio di Napoleone:
non attribuire a malintenzione cio' che puo'
essere semplicemente spiegato come imbecillita'
MaoX Blog:
http://maox.blogspot.com

  • Share/Bookmark