Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
awall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
awall
Commits
7bb0674c
Commit
7bb0674c
authored
May 31, 2017
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log: new mode: none
parent
06591454
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2237 additions
and
611 deletions
+2237
-611
README.md
README.md
+2
-1
awall/modules/filter.lua
awall/modules/filter.lua
+3
-2
awall/modules/log.lua
awall/modules/log.lua
+3
-1
test/mandatory/filter-limit.json
test/mandatory/filter-limit.json
+59
-1
test/mandatory/log.json
test/mandatory/log.json
+5
-1
test/output/dump
test/output/dump
+1471
-421
test/output/rules-save
test/output/rules-save
+347
-92
test/output/rules6-save
test/output/rules6-save
+347
-92
No files found.
README.md
View file @
7bb0674c
...
...
@@ -244,7 +244,8 @@ logging class names to setting objects.
A setting object may have an attribute named
**mode**
, which specifies
which logging facility to use. Allowed values are
**log**
,
**nflog**
,
and
**ulog**
. The default is
**log**
, i.e. in-kernel logging.
**ulog**
, and
**none**
. The default is
**log**
, i.e. in-kernel
logging.
The following table shows the optional attributes valid for all
logging modes:
...
...
awall/modules/filter.lua
View file @
7bb0674c
...
...
@@ -177,7 +177,8 @@ end
function
LoggingRule
:
combinelog
(
ofrags
,
log
,
action
,
target
)
local
actions
=
self
:
actofrags
(
log
,
target
)
return
actions
[
1
]
and
self
:
combine
(
ofrags
,
actions
,
'log'
..
action
,
log
)
or
ofrags
self
:
combine
(
ofrags
,
actions
,
'log'
..
action
,
log
and
log
:
target
())
or
ofrags
end
function
LoggingRule
:
mangleoptfrags
(
ofrags
)
...
...
@@ -407,7 +408,7 @@ function Filter:mangleoptfrags(ofrags)
if
ct
then
extend
(
ofs
,
self
:
actofrags
(
self
.
log
))
nxt
=
target
elseif
sofs
and
not
pl
then
nxt
=
false
end
elseif
sofs
and
not
(
pl
and
pl
:
target
())
then
nxt
=
false
end
extend
(
ofs
,
combinations
(
sofs
,
self
:
actofrags
(
pl
,
nxt
)))
else
...
...
awall/modules/log.lua
View file @
7bb0674c
...
...
@@ -70,6 +70,7 @@ function Log:target()
}
local
mode
=
self
.
mode
or
'log'
if
mode
==
'none'
then
return
end
if
not
optmap
[
mode
]
then
self
:
error
(
'Invalid logging mode: '
..
mode
)
end
local
res
=
mode
:
upper
()
...
...
@@ -84,7 +85,8 @@ function Log:target()
end
function
Log
:
optfrags
()
return
combinations
(
self
:
matchofrags
(),
{{
target
=
self
:
target
()}})
local
target
=
self
:
target
()
return
combinations
(
self
:
matchofrags
(),
{
target
and
{
target
=
target
}})
end
function
Log
.
get
(
rule
,
spec
,
default
)
...
...
test/mandatory/filter-limit.json
View file @
7bb0674c
...
...
@@ -4,6 +4,8 @@
{
"conn-limit"
:
1
,
"action"
:
"pass"
},
{
"conn-limit"
:
1
,
"log"
:
true
},
{
"conn-limit"
:
1
,
"log"
:
true
,
"action"
:
"pass"
},
{
"conn-limit"
:
1
,
"log"
:
"none"
},
{
"conn-limit"
:
1
,
"log"
:
"none"
,
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
false
}
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"log"
:
true
},
...
...
@@ -12,17 +14,46 @@
"log"
:
true
,
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"log"
:
"none"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"log"
:
"none"
,
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
"none"
}
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
true
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
true
,
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
"none"
},
{
"conn-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
"none"
,
"action"
:
"pass"
},
{
"conn-limit"
:
30
},
{
"conn-limit"
:
30
,
"action"
:
"pass"
},
{
"conn-limit"
:
30
,
"log"
:
true
},
{
"conn-limit"
:
30
,
"log"
:
"none"
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
false
}
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"log"
:
true
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"log"
:
"none"
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
"none"
}
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
"none"
},
"action"
:
"pass"
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
"none"
},
"log"
:
true
},
{
"conn-limit"
:
{
"count"
:
30
,
"log"
:
"none"
},
"log"
:
"none"
},
{
"flow-limit"
:
1
},
{
"flow-limit"
:
1
,
"action"
:
"pass"
},
{
"flow-limit"
:
1
,
"log"
:
true
},
{
"flow-limit"
:
1
,
"log"
:
true
,
"action"
:
"pass"
},
{
"flow-limit"
:
1
,
"log"
:
"none"
},
{
"flow-limit"
:
1
,
"log"
:
"none"
,
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
false
}
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"log"
:
true
},
...
...
@@ -31,11 +62,38 @@
"log"
:
true
,
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"log"
:
"none"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
false
},
"log"
:
"none"
,
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
"none"
}
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
true
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
true
,
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
"none"
},
{
"flow-limit"
:
{
"count"
:
1
,
"log"
:
"none"
},
"log"
:
"none"
,
"action"
:
"pass"
},
{
"flow-limit"
:
30
},
{
"flow-limit"
:
30
,
"action"
:
"pass"
},
{
"flow-limit"
:
30
,
"log"
:
true
},
{
"flow-limit"
:
30
,
"log"
:
"none"
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
false
}
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"log"
:
true
}
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"log"
:
true
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
false
},
"log"
:
"none"
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
"none"
}
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
"none"
},
"action"
:
"pass"
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
"none"
},
"log"
:
true
},
{
"flow-limit"
:
{
"count"
:
30
,
"log"
:
"none"
},
"log"
:
"none"
}
]
}
test/mandatory/log.json
View file @
7bb0674c
{
"log"
:
{
"none"
:
{
"mode"
:
"none"
}
},
"filter"
:
[
{},
{
"action"
:
"drop"
},
...
...
@@ -8,6 +9,9 @@
{
"log"
:
false
,
"action"
:
"pass"
},
{
"log"
:
true
},
{
"log"
:
true
,
"action"
:
"drop"
},
{
"log"
:
true
,
"action"
:
"pass"
}
{
"log"
:
true
,
"action"
:
"pass"
},
{
"log"
:
"none"
},
{
"log"
:
"none"
,
"action"
:
"drop"
},
{
"log"
:
"none"
,
"action"
:
"pass"
}
]
}
test/output/dump
View file @
7bb0674c
This diff is collapsed.
Click to expand it.
test/output/rules-save
View file @
7bb0674c
This diff is collapsed.
Click to expand it.
test/output/rules6-save
View file @
7bb0674c
This diff is collapsed.
Click to expand it.
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