Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
b813f3c6
Commit
b813f3c6
authored
Aug 31, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ids) add missing fileid in alert info
parent
6fccdac4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
ServiceController.php
...vc/app/controllers/OPNsense/IDS/Api/ServiceController.php
+4
-3
index.volt
src/opnsense/mvc/app/views/OPNsense/IDS/index.volt
+1
-1
queryAlertLog.py
src/opnsense/scripts/suricata/queryAlertLog.py
+1
-0
No files found.
src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/ServiceController.php
View file @
b813f3c6
...
@@ -251,15 +251,16 @@ class ServiceController extends ApiControllerBase
...
@@ -251,15 +251,16 @@ class ServiceController extends ApiControllerBase
/**
/**
* fetch alert detailed info
* fetch alert detailed info
* @param $alertId alert id, position in log file
* @param string $alertId alert id, position in log file
* @param string $fileid log file id number (empty for standard)
* @return array alert info
* @return array alert info
*/
*/
public
function
getAlertInfoAction
(
$alertId
)
public
function
getAlertInfoAction
(
$alertId
,
$fileid
=
""
)
{
{
$backend
=
new
Backend
();
$backend
=
new
Backend
();
$filter
=
new
Filter
();
$filter
=
new
Filter
();
$id
=
$filter
->
sanitize
(
$alertId
,
"int"
);
$id
=
$filter
->
sanitize
(
$alertId
,
"int"
);
$response
=
$backend
->
configdpRun
(
"ids query alerts"
,
array
(
1
,
0
,
"filepos/"
.
$id
));
$response
=
$backend
->
configdpRun
(
"ids query alerts"
,
array
(
1
,
0
,
"filepos/"
.
$id
,
$fileid
));
$result
=
json_decode
(
$response
,
true
);
$result
=
json_decode
(
$response
,
true
);
if
(
$result
!=
null
&&
count
(
$result
[
'rows'
])
>
0
)
{
if
(
$result
!=
null
&&
count
(
$result
[
'rows'
])
>
0
)
{
return
$result
[
'rows'
][
0
];
return
$result
[
'rows'
][
0
];
...
...
src/opnsense/mvc/app/views/OPNsense/IDS/index.volt
View file @
b813f3c6
...
@@ -246,7 +246,7 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -246,7 +246,7 @@ POSSIBILITY OF SUCH DAMAGE.
requestHandler:addAlertQryFilters,
requestHandler:addAlertQryFilters,
formatters:{
formatters:{
info: function (column, row) {
info: function (column, row) {
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filepos + "\"><span class=\"fa fa-info-circle\"></span></button> ";
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filepos + "
/" + row.fileid + "
\"><span class=\"fa fa-info-circle\"></span></button> ";
}
}
},
},
}
}
...
...
src/opnsense/scripts/suricata/queryAlertLog.py
View file @
b813f3c6
...
@@ -96,6 +96,7 @@ if os.path.exists(suricata_log):
...
@@ -96,6 +96,7 @@ if os.path.exists(suricata_log):
if
'alert'
in
record
:
if
'alert'
in
record
:
# add position in file
# add position in file
record
[
'filepos'
]
=
line
[
'pos'
]
record
[
'filepos'
]
=
line
[
'pos'
]
record
[
'fileid'
]
=
parameters
[
'fileid'
]
# flatten structure
# flatten structure
record
[
'alert_sid'
]
=
record
[
'alert'
][
'signature_id'
]
record
[
'alert_sid'
]
=
record
[
'alert'
][
'signature_id'
]
record
[
'alert'
]
=
record
[
'alert'
][
'signature'
]
record
[
'alert'
]
=
record
[
'alert'
][
'signature'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment