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
0aec40f7
Commit
0aec40f7
authored
Mar 25, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ids/ips) use macro physical_interface
parent
285c4c62
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
rc.conf.d
src/opnsense/service/templates/OPNsense/IDS/rc.conf.d
+4
-2
suricata.yaml
src/opnsense/service/templates/OPNsense/IDS/suricata.yaml
+6
-4
No files found.
src/opnsense/service/templates/OPNsense/IDS/rc.conf.d
View file @
0aec40f7
{
#
Macro
import
#
}
{%
from
'
OPNsense
/
Macros
/
interface
.
macro
'
import
physical_interface
%}
{%
if
helpers
.
exists
(
'
OPNsense
.
IDS
.
general
'
)
and
OPNsense
.
IDS
.
general
.
enabled
|
default
(
"0"
)
==
"1"
%}
suricata_enable
=
"YES"
...
...
@@ -12,10 +14,10 @@ suricata_netmap=YES
{%
for
intfName
in
OPNsense
.
IDS
.
general
.
interfaces
.
split
(
','
)
%}
{%
if
loop
.
index
==
1
%}
{
#
enable
first
interface
#
}
suricata_interface
=
"{{
helpers.getNodeByTag('interfaces.'+intfName).if
}}"
suricata_interface
=
"{{
physical_interface(intfName)
}}"
{%
else
%}
{
#
store
additional
interfaces
to
addFlags
#
}
{%
do
addFlags
.
append
(
helpers
.
getNodeByTag
(
'
interfaces
.
'
+
intfName
).
if
)
%}
{%
do
addFlags
.
append
(
physical_interface
(
intfName
)
)
%}
{%
endif
%}
{%
endfor
%}
{
#
append
additional
interfaces
#
}
...
...
src/opnsense/service/templates/OPNsense/IDS/suricata.yaml
View file @
0aec40f7
{
# Macro import #}
{
%
from 'OPNsense/Macros/interface.macro' import physical_interface %
}
%
YAML 1.1
---
...
...
@@ -317,11 +319,11 @@ netmap:
{
%
if helpers.exists('OPNsense.IDS.general.interfaces') %
}
{
%
for intfName in OPNsense.IDS.general.interfaces.split('
,
'
)
%}
-
interface:
{{
helpers.getNodeByTag('
interfaces.'+intfName).if
}
}
copy-iface
:
{{
helpers.getNodeByTag('interfaces.'+intfName).if
}}
+
-
interface:
{{
physical_interface(intfName)
}}
copy-iface:
{{
physical_interface(intfName)
}}+
-
interface
:
{{
helpers.getNodeByTag('interfaces.'+intfName).if
}}
+
copy-iface
:
{{
helpers.getNodeByTag('interfaces.'+intfName).if
}}
-
interface:
{{
physical_interface(intfName)
}}+
copy-iface:
{{
physical_interface(intfName)
}}
{%
endfor
%}
{%
endif
%}
...
...
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