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
32776f24
Commit
32776f24
authored
Jun 23, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ids) replace standard json library with ultrajson
parent
36fe85ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
getRuleJSON.py
src/opnsense/scripts/suricata/getRuleJSON.py
+4
-2
listClasstypes.py
src/opnsense/scripts/suricata/listClasstypes.py
+3
-2
No files found.
src/opnsense/scripts/suricata/getRuleJSON.py
View file @
32776f24
...
...
@@ -33,7 +33,7 @@
total_rows: total rowcount for this selection
parameters: list of parameters used
"""
import
json
import
u
json
import
sys
from
rulecache
import
RuleCache
...
...
@@ -59,4 +59,6 @@ if __name__ == '__main__':
# dump output
result
=
rc
.
search
(
**
parameters
)
result
[
'parameters'
]
=
parameters
print
(
json
.
dumps
(
result
))
print
(
ujson
.
dumps
(
result
))
src/opnsense/scripts/suricata/listClasstypes.py
View file @
32776f24
...
...
@@ -30,7 +30,7 @@
--------------------------------------------------------------------------------------
script to fetch all classtypes from the installed suricata rules using the shared rule cache:
"""
import
json
import
u
json
from
rulecache
import
RuleCache
if
__name__
==
'__main__'
:
...
...
@@ -41,4 +41,5 @@ if __name__ == '__main__':
items
=
rc
.
listClassTypes
()
result
=
{
'items'
:
items
,
'count'
:
len
(
items
)}
print
(
json
.
dumps
(
result
))
print
(
ujson
.
dumps
(
result
))
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