add jq to container
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
ARG IPTABLES_MODE=nft
|
||||
|
||||
#install iptables
|
||||
FROM ubuntu:noble AS iptables
|
||||
FROM ubuntu:noble AS apt
|
||||
RUN --mount=type=cache,target=/var/lib/apt/lists,sharing=locked --mount=type=cache,target=/var/cache/apt,sharing=locked <<EOF
|
||||
apt update
|
||||
apt upgrade -y
|
||||
apt install iptables -y
|
||||
apt install iptables jq -y
|
||||
EOF
|
||||
|
||||
#set alternative to use iptables-legacy
|
||||
FROM iptables AS iptables-legacy
|
||||
FROM apt AS iptables-legacy
|
||||
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
|
||||
RUN update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
|
||||
|
||||
#set alternative to use iptables-nft
|
||||
FROM iptables AS iptables-nft
|
||||
FROM apt AS iptables-nft
|
||||
RUN update-alternatives --set iptables /usr/sbin/iptables-nft
|
||||
RUN update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
|
||||
|
||||
|
@@ -63,7 +63,7 @@ function processAction() {
|
||||
}
|
||||
|
||||
while read line; do
|
||||
echo "$line"
|
||||
processAction "$(echo "$line" | jq -r .action)" "$(echo "$line" | jq -r .value)" "$(echo "$line" | jq -r .duration)" "$(echo "$line" | jq -r .scenario)"
|
||||
echo processAction $(echo "$line" | jq -r .action) $(echo "$line" | jq -r .value) $(echo "$line" | jq -r .duration) $(echo "$line" | jq -r .scenario) | tee bouncer.sh.out
|
||||
processAction $(echo "$line" | jq -r .action) $(echo "$line" | jq -r .value) $(echo "$line" | jq -r .duration) $(echo "$line" | jq -r .scenario)
|
||||
done
|
||||
#{"duration":"-1h1m9s","origin":"CAPI","scenario":"crowdsecurity/ssh-bf","scope":"Ip","type":"ban","value":"122.117.32.192","id":22739513,"action":"del"}
|
||||
|
Reference in New Issue
Block a user