PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : snort will nicht in mysql datenbank loggen



mdkuser
20.06.04, 19:40
Hallo habe folgendes Problem: habe snort mit mysql support als rpms unter fedora core 1 installiert. funzt auch, jedoch loggt snort nur ins syslog und nicht in die datenbank. habe einen datenbank benutzer mit den rechten insert, update, select angelegt und die datenbank mit den scripten von snort formatiert. wenn ich jetzt snort im testlauf starte also snort -T -u snort -g snort -c /etc/snort/snort.conf taucht am ende auf:

database: Closing connection to database ""

das zeigt mir, dass er die snortdb (so heisst sie auch) nicht findet, obwohl in der snort.conf folgendes eingestellt ist:

ouput database: aler, mysql, user=xyz passwort=xxxx dbname=snortdb host=localhost


weiss jemand, wie ich snortd beibringe, das er die snortdb zum loggen nehmen soll?
danke schon mal!

Stormbringer
20.06.04, 22:09
Hi,

ich nehme mal an, daß es sich um Schreibfehler handelt, oder?
Zumindest lautet der hier funktionierende Eintrag:


output database: log, mysql, user=%user% password=%password% dbname=snort host=localhost


Ist denn der von Dir angegebene Benutzer berechtigt, in die DB zu schreiben?
Steht denn etwas in den Logdateien des Systems, oder von mysql?

Gruß

mdkuser
21.06.04, 08:09
also schreibfehler meinst du? in der sample-config von snort stand username und password aber ohne % !!!
der mysql-user hat die rechte INSERT,SELECT und UPDATE. Nehme ich Ihm das Recht UPDATE weg, dann meckert snort, das er nicht auf die Datenbank zugreifen kann wegen fehlenden Berechtigungen, gebe ich dem user zusätzlich noch das UPDATE-Recht beschwert sich snort nicht. Komisch ist nur das bei database eben "" statt "snortdb" steht. in das syslog wird aber von snort fleissig geloggt.
ich frage mich eh, warum der snortdb-user das update recht braucht. hatte mal eine frühere snort-version selbst mit mysql support compiliert und da reichten dann als rechte insert und select aus. tja wenns mit den rpms nicht geht, muss ich eben noch mal selbst kopilieren...
waere mir aber lieber, es würde auch so klappen.
irgendjemand noch ne idee?
danke schon mal!

mdkuser
21.06.04, 09:12
Hier die ausgabe von snort -T -u snort -g snort -c /etc/snort/snort.conf




Running in IDS mode
Log directory = /var/log/snort

Initializing Network Interface eth0

--== Initializing Snort ==--
Initializing Output Plugins!
Decoding Ethernet on interface eth0
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file /etc/snort/snort.conf

++++++++++++++++++++++++++++++++++++++++++++++++++ +
Initializing rule chains...
,-----------[Flow Config]----------------------
| Stats Interval: 0
| Hash Method: 2
| Memcap: 10485760
| Rows : 4099
| Overhead Bytes: 16400(%0.16)
`----------------------------------------------
No arguments to frag2 directive, setting defaults to:
Fragment timeout: 60 seconds
Fragment memory cap: 4194304 bytes
Fragment min_ttl: 0
Fragment ttl_limit: 5
Fragment Problems: 0
Self preservation threshold: 500
Self preservation period: 90
Suspend threshold: 1000
Suspend period: 30
Stream4 config:
Stateful inspection: ACTIVE
Session statistics: INACTIVE
Session timeout: 30 seconds
Session memory cap: 8388608 bytes
State alerts: INACTIVE
Evasion alerts: INACTIVE
Scan alerts: INACTIVE
Log Flushed Streams: INACTIVE
MinTTL: 1
TTL Limit: 5
Async Link: 0
State Protection: 0
Self preservation threshold: 50
Self preservation period: 90
Suspend threshold: 200
Suspend period: 30
Stream4_reassemble config:
Server reassembly: INACTIVE
Client reassembly: ACTIVE
Reassembler alerts: ACTIVE
Zero out flushed packets: INACTIVE
flush_data_diff_size: 500
Ports: 21 23 25 53 80 110 111 143 513 1433
Emergency Ports: 21 23 25 53 80 110 111 143 513 1433
HttpInspect Config:
GLOBAL CONFIG
Max Pipeline Requests: 0
Inspection Type: STATELESS
Detect Proxy Usage: NO
IIS Unicode Map Filename: /etc/snort/rules/unicode.map
IIS Unicode Map Codepage: 1252
DEFAULT SERVER CONFIG:
Ports: 80 8080 8180
Flow Depth: 300
Max Chunk Length: 500000
Inspect Pipeline Requests: YES
URI Discovery Strict Mode: NO
Allow Proxy Usage: NO
Disable Alerting: NO
Oversize Dir Length: 500
Only inspect URI: NO
Ascii: YES alert: NO
Double Decoding: YES alert: YES
%U Encoding: YES alert: YES
Bare Byte: YES alert: YES
Base36: OFF
UTF 8: OFF
IIS Unicode: YES alert: YES
Multiple Slash: YES alert: NO
IIS Backslash: YES alert: NO
Directory: YES alert: NO
Apache WhiteSpace: YES alert: YES
IIS Delimiter: YES alert: YES
IIS Unicode Map: GLOBAL IIS UNICODE MAP CONFIG
Non-RFC Compliant Characters: NONE
rpc_decode arguments:
Ports to decode RPC on: 111 32771
alert_fragments: INACTIVE
alert_large_fragments: ACTIVE
alert_incomplete: ACTIVE
alert_multiple_requests: ACTIVE
telnet_decode arguments:
Ports to decode telnet on: 21 23 25 119
database: compiled support for ( mysql )
database: configured to use mysql
database: user = snort
database: password is set
database: database name = snortdb
database: host = localhost
database: sensor name = 192.168.x.x
database: sensor id = 1
database: schema version = 106
database: using the "alert" facility
1686 Snort rules read...
1686 Option Chains linked into 152 Chain Headers
0 Dynamic rules
++++++++++++++++++++++++++++++++++++++++++++++++++ +

Warning: flowbits key 'realplayer.playlist' is checked but not ever set.

+-----------------------[thresholding-config]----------------------------------
| memory-cap : 1048576 bytes
+-----------------------[thresholding-global]----------------------------------
| none
+-----------------------[thresholding-local]-----------------------------------
| gen-id=1 sig-id=2523 type=Both tracking=dst count=10 seconds=10
| gen-id=1 sig-id=2275 type=Threshold tracking=dst count=5 seconds=60
| gen-id=1 sig-id=2495 type=Both tracking=dst count=20 seconds=60
| gen-id=1 sig-id=2494 type=Both tracking=dst count=20 seconds=60
| gen-id=1 sig-id=2496 type=Both tracking=dst count=20 seconds=60
+-----------------------[suppression]------------------------------------------
-------------------------------------------------------------------------------
Rule application order: ->activation->dynamic->alert->pass->log

--== Initialization Complete ==--

-*> Snort! <*-
Version 2.1.3 (Build 27)
By Martin Roesch (roesch@sourcefire.com, www.snort.org)

Snort sucessfully loaded all rules and checked all rule chains!
Final Flow Statistics
,----[ FLOWCACHE STATS ]----------
Memcap: 10485760 Overhead Bytes 16400 used(%0.156403)/blocks (16400/1) Overhead blocks: 1 Could Hold: (0)
IPV4 count: 0 frees: 0 low_time: 0, high_time: 0, diff: 0h:00:00s
finds: 0 reversed: 0(%0.000000)
find_sucess: 0 find_fail: 0 percent_success: (%0.000000) new_flows: 0
database: Closing connection to database ""
Snort exiting




Kann jemand daran sehen, wo das Problem liegt?

Stormbringer
21.06.04, 19:25
Hi,

ich meinte fehlenden "t" bei output & alert.
Dem DB-account habe ich vollen Zugriff auf die betreffende DB gegeben.
Aber ers scheint ja offenbar dei DB zu öffnen, und beendet sie dann wieder - aber ohne Fehlermeldung ...?

Gruß

mdkuser
21.06.04, 19:33
ja im log von mysql steht auch nix. was mich wundert ist, dass er am ende des testlaufs schreibt:


database: Closing connection to database ""


dabei heisst die db doch snortdb.

trage ich in der snort.conf noch ein leerzeichen zwischen dem komma von alert und mysql ein, dann steht da:



database: Closing connection to database "YÜÜ"


also das scheint mir nicht zu stimmen.

nehme ich dem db-user das update recht weg, kommt die meldung das keine verbindung zur datenbank erstellt werden konnte wegen fehlender update rechte.

volle rechte auf den db-user bringen auch nix.

ich bin echt am verzweifeln, wieso klappt dass denn nicht???


p.s. dass er die datenbankverbindung beendet bedeutet nur, dass ich snort im testmodus gestartet habe, aber auch im daemon modus loggt er nicht in die db.

mdkuser
21.06.04, 19:54
jetzt klappte es mal. Die sache ist die, dass die firewall das logging in die db verhinderte, obwohl die db und snort auf der selben maschine installiert sind...
tja localhost zu local host ist freigegeben, was muss denn da noch in der firewall offen sein?