Skip to content

Commit

Permalink
add so-allow-view script/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
weslambert committed Dec 21, 2017
1 parent 58f1174 commit c5805bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
17 changes: 2 additions & 15 deletions usr/sbin/so-allow-elastic
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,11 @@ case $input in
esac
done

iptbl_stats() {
echo "################"
echo "# Docker Rules #"
echo "################"
echo
echo "To Action From"
echo "-- ------ ----"
iptables -vL DOCKER-USER |grep ACCEPT |grep -v "state RELATED,ESTABLISHED" |awk '{print $11,$4,$7,$3,$6,$8}'

}

#########################################
# Status
########################################
if [ "$device" == "status" ]; then
ufw status
iptbl_stats
/usr/sbin/so-allow-view
echo
exit 0
fi
Expand Down Expand Up @@ -176,8 +164,7 @@ echo "Rule has been added."
echo
echo "Here is the entire firewall ruleset:"
echo
ufw status
iptbl_stats
/usr/sbin/so-allow-view
echo

if [ "$device" == "analyst" ]; then
Expand Down
5 changes: 5 additions & 0 deletions usr/sbin/so-allow-view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
. /usr/sbin/so-common
header "UFW Rules"
ufw status | sed -n '1!p'
/usr/sbin/so-allow-view-iptables
8 changes: 8 additions & 0 deletions usr/sbin/so-allow-view-iptables
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
. /usr/sbin/so-common
header "Docker IPTables Rules"
echo
echo "To Action From"
echo "-- ------ ----"
iptables -vL DOCKER-USER |grep ACCEPT |grep -v "state RELATED,ESTABLISHED" |awk '{print substr($11,5) "/" $4,$7,$3,$6,$8}'
echo

0 comments on commit c5805bf

Please sign in to comment.