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
b296b956
Commit
b296b956
authored
May 31, 2017
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework reply-to tag, disablereplyto at wrong location + missing in bogons
parent
9f31b9d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
filter.lib.inc
src/etc/inc/filter.lib.inc
+13
-5
No files found.
src/etc/inc/filter.lib.inc
View file @
b296b956
...
...
@@ -31,9 +31,16 @@ function filter_core_bootstrap($fw)
global
$config
;
// set defaults
$filter_rule_defaults
=
array
();
$filter_rule_defaults
[
'pass'
]
=
array
(
"type"
=>
"pass"
,
"log"
=>
!
isset
(
$config
[
'syslog'
][
'nologdefaultpass'
]));
$filter_rule_defaults
[
'block'
]
=
array
(
"type"
=>
"block"
,
"log"
=>
!
isset
(
$config
[
'syslog'
][
'nologdefaultblock'
]));
$filter_rule_defaults
[
'disablereplyto'
]
=
1
;
// don't generate "reply-to" tags on internal rules by default
$filter_rule_defaults
[
'pass'
]
=
array
(
"type"
=>
"pass"
,
"log"
=>
!
isset
(
$config
[
'syslog'
][
'nologdefaultpass'
]),
"disablereplyto"
=>
1
// don't generate "reply-to" tags on internal rules by default
);
$filter_rule_defaults
[
'block'
]
=
array
(
"type"
=>
"block"
,
"log"
=>
!
isset
(
$config
[
'syslog'
][
'nologdefaultblock'
]),
"disablereplyto"
=>
1
// don't generate "reply-to" tags on internal rules by default
);
// setup system filter rules
filter_core_rules_system
(
$fw
,
$filter_rule_defaults
);
...
...
@@ -145,9 +152,10 @@ function filter_core_rules_system($fw, $defaults)
$fw
->
registerFilterRule
(
1
,
array
(
'from'
=>
'<virusprot>'
,
'label'
=>
'virusprot overload table'
),
$defaults
[
'block'
]);
// block bogons and private nets
$bogontmpl
=
array
(
'type'
=>
'block'
,
'log'
=>
!
isset
(
$config
[
'syslog'
][
'nologbogons'
]));
$bogontmpl
=
array
(
'type'
=>
'block'
,
'log'
=>
!
isset
(
$config
[
'syslog'
][
'nologbogons'
])
,
'disablereplyto'
=>
1
);
$privtmpl
=
array
(
'type'
=>
'block'
,
'log'
=>
!
isset
(
$config
[
'syslog'
][
'nologprivatenets'
]),
'from'
=>
'10.0.0.0/8,127.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16,fc00::/7'
);
'from'
=>
'10.0.0.0/8,127.0.0.0/8,100.64.0.0/10,172.16.0.0/12,192.168.0.0/16,fc00::/7'
,
'disablereplyto'
=>
1
);
foreach
(
$fw
->
getInterfaceMapping
()
as
$intf
=>
$intfinfo
)
{
$fw
->
registerFilterRule
(
5
,
array
(
'from'
=>
"<bogons>"
,
'direction'
=>
'in'
,
'interface'
=>
$intf
,
...
...
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