Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
073934f5
Commit
073934f5
authored
1 year ago
by
Tibo
Browse files
Options
Downloads
Patches
Plain Diff
filter out ports bound to 127.0.0.1 or ::1
parent
f18a5c74
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#12942
passed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/Unit/SensorsTest.php
+3
-4
3 additions, 4 deletions
tests/Unit/SensorsTest.php
tests/Unit/ifconfig-opnsense
+63
-0
63 additions, 0 deletions
tests/Unit/ifconfig-opnsense
with
66 additions
and
4 deletions
tests/Unit/SensorsTest.php
+
3
−
4
View file @
073934f5
...
...
@@ -74,10 +74,9 @@ class SensorsTest extends TestCase
$string
=
file_get_contents
(
__DIR__
.
"/netstat-tcp"
);
$sensor
=
new
\App\Sensor\ListeningPorts
();
$ports
=
$sensor
->
parse
(
$string
);
$this
->
assertEquals
(
16
,
count
(
$ports
));
$this
->
assertEquals
(
"31933/cloud-backup-"
,
$ports
[
4
]
->
process
);
$this
->
assertEquals
(
1024
,
$ports
[
4
]
->
port
);
$this
->
assertEquals
(
"127.0.0.1"
,
$ports
[
4
]
->
bind
);
$this
->
assertEquals
(
4
,
count
(
$ports
));
$this
->
assertEquals
(
111
,
$ports
[
0
]
->
port
);
$this
->
assertEquals
(
"0.0.0.0"
,
$ports
[
0
]
->
bind
);
}
public
function
testSsacli
()
...
...
This diff is collapsed.
Click to expand it.
tests/Unit/ifconfig-opnsense
0 → 100644
+
63
−
0
View file @
073934f5
igb0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: LAN
options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
ether f4:90:ea:00:b0:b5
inet 172.20.0.100 netmask 0xffff0000 broadcast 172.20.255.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
igb1: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: BRIDGEINT
options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
ether f4:90:ea:00:b0:b6
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
igb2: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: BRIDGEEXT
options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
ether f4:90:ea:00:b0:b7
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
ax0: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
ether f4:90:ea:00:b0:b8
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
ax1: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
ether f4:90:ea:00:b0:b9
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
enc0: flags=0<> metric 0 mtu 1536
groups: enc
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
pflog0: flags=20100<PROMISC,PPROMISC> metric 0 mtu 33160
groups: pflog
pfsync0: flags=0<> metric 0 mtu 1500
syncpeer: 0.0.0.0 maxupd: 128 defer: off
syncok: 1
groups: pfsync
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: BRIDGE
ether 58:9c:fc:10:ff:99
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: igb1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 55
member: igb2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 3 priority 128 path cost 55
groups: bridge
nd6 options=9<PERFORMNUD,IFDISABLED>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment