Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
947e23d6
Commit
947e23d6
authored
7 years ago
by
Václav Bartoš
Committed by
Pavel Kácha
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs in kippo connector
- It didn't work with newer MySQL versions - Fixed timezone conversions
parent
77c11ae8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
warden3/contrib/connectors/hp-kippo/warden3-kippo-sender.py
+4
-4
4 additions, 4 deletions
warden3/contrib/connectors/hp-kippo/warden3-kippo-sender.py
with
4 additions
and
4 deletions
warden3/contrib/connectors/hp-kippo/warden3-kippo-sender.py
+
4
−
4
View file @
947e23d6
...
...
@@ -93,13 +93,13 @@ def main():
crs
=
con
.
cursor
()
events
=
[]
query
=
"
SELECT UNIX_TIMESTAMP(
CONVERT_TZ(s.starttime,
'
+00:00
'
, @@global.time_zon
e)) as starttime, s.ip, COUNT(s.id) as attack_scale, sn.ip as sensor
\
query
=
"
SELECT
MIN(
UNIX_TIMESTAMP(
s.starttim
e)) as starttime, s.ip, COUNT(s.id) as attack_scale, sn.ip as sensor
\
FROM sessions s
\
LEFT JOIN sensors sn ON s.sensor=sn.id
\
WHERE s.starttime > DATE_SUB(
UTC
_TIMESTAMP(), INTERVAL + %s SECOND)
\
GROUP BY s.ip ORDER BY
s.
starttime ASC;
"
WHERE s.starttime > DATE_SUB(
CURRENT
_TIMESTAMP(), INTERVAL + %s SECOND)
\
GROUP BY s.ip
, sn.ip
ORDER BY starttime ASC;
"
crs
.
execute
(
query
,
awin
)
crs
.
execute
(
query
,
(
awin
,)
)
rows
=
crs
.
fetchall
()
for
row
in
rows
:
dtime
=
format_timestamp
(
row
[
'
starttime
'
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment