Subject: [PATCH] increase security of configuration file to 0600 (token and other sensitive information)

From: tetsumaki <[email-masked]>
Date: Wed, 16 Nov 2022 19:11:23 +0100

From: tetsumaki <[email-masked]>

https://github.com/crowdsecurity/cs-firewall-bouncer/blob/main/debian/rules#L27
https://github.com/crowdsecurity/cs-firewall-bouncer/blob/main/rpm/SPECS/crowdsec-firewall-bouncer.spec#L44
---
 testing/cs-firewall-bouncer/APKBUILD | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/testing/cs-firewall-bouncer/APKBUILD b/testing/cs-firewall-bouncer/APKBUILD
index 789cc41764..577a7bd233 100644
--- a/testing/cs-firewall-bouncer/APKBUILD
+++ b/testing/cs-firewall-bouncer/APKBUILD
@@ -1,8 +1,9 @@
+# Contributor: tetsumaki <[email-masked]>
 # Contributor: Kevin Daudt <[email-masked]>
 # Maintainer: Kevin Daudt <[email-masked]>
 pkgname=cs-firewall-bouncer
 pkgver=0.0.24
-pkgrel=1
+pkgrel=2
 pkgdesc="Crowdsec bouncer for firewalls"
 url="https://github.com/crowdsecurity/cs-firewall-bouncer"
 arch="all"
@@ -31,8 +32,8 @@ package() {
 	install -Dm0755 crowdsec-firewall-bouncer -t "$pkgdir"/usr/bin/
 	install -dm0755 "$pkgdir"/etc/crowdsec/bouncers
 	BACKEND=iptables API_KEY="" envsubst \
-		<config/crowdsec-firewall-bouncer.yaml \
-		>"$pkgdir"/etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml
+		< config/crowdsec-firewall-bouncer.yaml \
+		| install -Dm0600 /dev/stdin "$pkgdir"/etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml
 
 	install -Dm0755 "$srcdir"/$pkgname.initd \
 		"$pkgdir"/etc/init.d/cs-firewall-bouncer
-- 
2.38.1