1. Initiera databasen
aide --init
2. Flytta databasen till ett säkert ställe (read-only).
Även config-filen och bin-filen bör flyttas dit.
3. Kolla filerna
aide --check
4. Trimma config-filen och uppdatera däefter databasen
aide --update
(innefattar även en check)
5. Flytta nu den nya databasen och config-filen till det säkra stället (read-only)
Filter
2006-06-18
Advanced Intrusion Detection System
Security
2006-06-17
Flera loggfiler blir en
Linux
You can combine multiple logs from different dates combined using cat utility:
$ cat logfile1 logfile2 logfile3 > access.log
2006-06-17
Tripwire
Security
cd /etc/tripwire
# Hämta configfilen
twadmin --printcfgfile > twcfg.txt
# Hämta policyfilen
twadmin --printpolfile > twpol.txt
# Kryptera och uppdatera config-filen
twadmin --create-cfgfile --site-keyfile site.key twcfg.txt
# Kryptera och uppdatera policy-filen
twadmin --create-polfile twpol.txt
tripwire --update-policy twpol.txt
# Skapa databasen
tripwire --init
# Kolla mot databasen
tripwire --check
cd /var/lib/tripwire/report
# Visa rapport
twprint --print-report --twrfile xxx-yyyymmdd-hhmmss.twr
# Visa rapport och uppdatera databsen
tripwire --update --twrfile xxx-yyyymmdd-hhmmss.twr
tripwire --check --interactive
# Testa mailen
tripwire --test --email namn@server.tld
# Skicka rapport via epost till den som står i varje regel
tripwire --check --email-report
2006-06-17
Maila från ett skal
Mail
$ sendmail -f from@server.tld recipient to@server.tld
Detta är mailets text... bla bla
.
(Avslutas med en punkt på en tom rad)
Om din isp har spärret port 25, skriv följande i /etc/postfix/main.cf
relayhost = smtp.server.tld
(eller ev detta:)
fallback_relay = smtp.server.tld:25
2006-06-12
Cron på rätt sätt
Linux
Jobs run using cron on a node email standard output and standard error to the user by default. If the standard output or standard error is large (which may happen if the job does not run as expected), the mail daemon has problems delivering the email, which fills up /var on the node, which causes problems with the node. Therefore, ALL users with cron jobs should redirect their standard output AND standard error to files. If you do not want to ever look at the standard output or standard error from a job, the redirect should point to /dev/null. Please do not actually put the command in the examples into a cron job, as it does nothing productive.
CORRECT Crontab Entry Examples
30 6 * * * /usr/bin/date 1>/nfstmp/output.file 2>/nfstmp/output.file
30 6 * * * /usr/bin/date 1>/nfstmp/output.file 2>&1
30 6 * * * /usr/bin/date >/nfstmp/output.file 2>&1
30 6 * * * /usr/bin/date 1>/nfstmp/output.file 2>/nfstmp/error.file
30 6 * * * /usr/bin/date 1>/nfstmp/output.file 2>/dev/null
30 6 * * * /usr/bin/date 1>/dev/null 2>/dev/null
30 6 * * * /usr/bin/date 1>/dev/null 2>&1
INCORRECT Crontab Entry Examples
30 6 * * * /usr/bin/date
30 6 * * * /usr/bin/date >/dev/null
30 6 * * * /usr/bin/date 1>/dev/null
30 6 * * * /usr/bin/date 2>/dev/null
