Compare commits
3 Commits
v0.0.6w-ml
...
v0.0.6z-ml
Author | SHA1 | Date | |
---|---|---|---|
cf6f6096d6 | |||
99ed9d3b27 | |||
3e98f7149f |
@ -27,19 +27,15 @@ table filter {
|
|||||||
|
|
||||||
# allow SSH connections from the private network and from some
|
# allow SSH connections from the private network and from some
|
||||||
# well-known internet hosts
|
# well-known internet hosts
|
||||||
saddr ($NET_PRIVATE 81.209.165.42) proto tcp dport ssh ACCEPT;
|
saddr ($NET_PRIVATE) proto tcp dport ssh ACCEPT;
|
||||||
|
|
||||||
# we provide DNS and SMTP services for the internal net
|
# we provide DNS and SMTP services for the internal net
|
||||||
interface $DEV_PRIVATE saddr $NET_PRIVATE {
|
interface $DEV_PRIVATE saddr $NET_PRIVATE {
|
||||||
proto (udp tcp) dport domain ACCEPT;
|
proto (udp tcp) dport domain ACCEPT;
|
||||||
proto udp dport bootps ACCEPT;
|
proto udp dport bootps ACCEPT;
|
||||||
}
|
}
|
||||||
interface $DEV_VPN{
|
|
||||||
# respond to ping
|
|
||||||
proto icmp icmp-type echo-request ACCEPT;
|
|
||||||
# disallow ssh
|
|
||||||
saddr proto tcp dport ssh ACCEPT;
|
|
||||||
}
|
|
||||||
# interface réseau
|
# interface réseau
|
||||||
interface $DEV_WORLD {
|
interface $DEV_WORLD {
|
||||||
|
|
||||||
@ -49,13 +45,8 @@ table filter {
|
|||||||
}#FIN INPUT
|
}#FIN INPUT
|
||||||
|
|
||||||
# outgoing connections are not limited
|
# outgoing connections are not limited
|
||||||
chain OUTPUT {policy ACCEPT;
|
chain OUTPUT {
|
||||||
interface $DEV_VPN{
|
policy ACCEPT;
|
||||||
# allow ssh
|
|
||||||
daddr proto tcp dport ssh DROP;
|
|
||||||
# respond to ping
|
|
||||||
proto icmp icmp-type echo-request ACCEPT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chain FORWARD {
|
chain FORWARD {
|
||||||
policy ACCEPT;
|
policy ACCEPT;
|
||||||
@ -68,6 +59,9 @@ table filter {
|
|||||||
# internal nets are allowed
|
# internal nets are allowed
|
||||||
interface $DEV_PRIVATE ACCEPT;
|
interface $DEV_PRIVATE ACCEPT;
|
||||||
|
|
||||||
|
interface $DEV_VPN daddr $NET_PRIVATE {
|
||||||
|
proto tcp dport ssh DROP;
|
||||||
|
}
|
||||||
# the rest is dropped by the above policy
|
# the rest is dropped by the above policy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
# Définir la politique par défaut
|
|
||||||
iptables -P INPUT DROP
|
|
||||||
iptables -P OUTPUT ACCEPT
|
|
||||||
iptables -P FORWARD ACCEPT
|
|
||||||
|
|
||||||
# Autoriser le trafic pour le VPN
|
|
||||||
iptables -A INPUT -p udp --dport 51820 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions établies et connexes
|
|
||||||
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions sur l'interface loopback
|
|
||||||
iptables -A INPUT -i lo -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les requêtes ping
|
|
||||||
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions SSH depuis le réseau privé et depuis certains hôtes internet
|
|
||||||
iptables -A INPUT -p tcp -s 172.16.0.0/24,81.209.165.42 --dport ssh -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions DNS et SMTP sur l'interface privée
|
|
||||||
iptables -A INPUT -i enp0s9 -s 172.16.0.0/24 -p udp --dport domain -j ACCEPT
|
|
||||||
iptables -A INPUT -i enp0s9 -s 172.16.0.0/24 -p tcp --dport domain -j ACCEPT
|
|
||||||
iptables -A INPUT -i enp0s9 -s 172.16.0.0/24 -p udp --dport bootps -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les requêtes ping sur l'interface VPN
|
|
||||||
iptables -A INPUT -i wg0 -p icmp --icmp-type echo-request -j ACCEPT
|
|
||||||
|
|
||||||
# Interdire les connexions SSH sur l'interface VPN
|
|
||||||
iptables -A INPUT -i wg0 -s 0.0.0.0/0 -p tcp --dport ssh -j DROP
|
|
||||||
|
|
||||||
# Interdire les connexions SSH sortantes sur l'interface VPN
|
|
||||||
iptables -A OUTPUT -o wg0 -d 0.0.0.0/0 -p tcp --dport ssh -j DROP
|
|
||||||
|
|
||||||
# Autoriser le trafic sur l'interface publique
|
|
||||||
iptables -A INPUT -i enp0s8 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions depuis l'interface privée vers l'interface publique ou une autre interface privée
|
|
||||||
iptables -A FORWARD -i enp0s9 -o enp0s8 -j ACCEPT
|
|
||||||
iptables -A FORWARD -i enp0s9 -o enp0s9 -j ACCEPT
|
|
||||||
|
|
||||||
# Interdire toutes les autres connexions de forwarding
|
|
||||||
iptables -A FORWARD -j DROP
|
|
@ -1,50 +0,0 @@
|
|||||||
# Politique par défaut : DROP
|
|
||||||
iptables -P INPUT DROP
|
|
||||||
iptables -P FORWARD ACCEPT
|
|
||||||
iptables -P OUTPUT ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions VPN entrantes
|
|
||||||
iptables -A INPUT -p udp --dport 51820 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions établies et apparentées
|
|
||||||
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions depuis l'interface locale
|
|
||||||
iptables -A INPUT -i lo -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les requêtes ping
|
|
||||||
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions SSH depuis le réseau privé et depuis certains hôtes Internet
|
|
||||||
iptables -A INPUT -s 172.16.0.0/24 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
|
|
||||||
iptables -A INPUT -s 81.209.165.42 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions DNS et SMTP depuis le réseau privé
|
|
||||||
iptables -A INPUT -i enp0s8 -s 172.16.0.0/24 -p udp --dport 53 -j ACCEPT
|
|
||||||
iptables -A INPUT -i enp0s8 -s 172.16.0.0/24 -p tcp --dport 53 -j ACCEPT
|
|
||||||
iptables -A INPUT -i enp0s8 -s 172.16.0.0/24 -p udp --dport 67 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser le trafic sortant
|
|
||||||
iptables -A OUTPUT -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les requêtes ping sortantes
|
|
||||||
iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions SSH sortantes
|
|
||||||
iptables -A OUTPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions VPN sortantes
|
|
||||||
iptables -A FORWARD -i wg0 -o enp0s9 -j ACCEPT
|
|
||||||
iptables -A FORWARD -i enp0s9 -o wg0 -j ACCEPT
|
|
||||||
|
|
||||||
# Interdire les connexions SSH entrantes depuis l'interface VPN
|
|
||||||
iptables -A FORWARD -i wg0 -p tcp --dport 22 -j DROP
|
|
||||||
|
|
||||||
# Autoriser les connexions SSH sortantes vers l'interface VPN
|
|
||||||
iptables -A FORWARD -o wg0 -p tcp --dport 22 -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser les connexions établies et apparentées
|
|
||||||
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
|
|
||||||
|
|
||||||
# Autoriser le trafic depuis le réseau privé
|
|
||||||
iptables -A FORWARD -i enp0s8 -o enp0s9 -j ACCEPT
|
|
@ -44,7 +44,7 @@ peertube:
|
|||||||
dbUser: user # must be consistent with postgresql configuration
|
dbUser: user # must be consistent with postgresql configuration
|
||||||
dbPasswd: user # must be consistent with postgresql configuration
|
dbPasswd: user # must be consistent with postgresql configuration
|
||||||
dbSsl: false # disabled by default WARNING: ssl connection feature not tested, use at your own risk
|
dbSsl: false # disabled by default WARNING: ssl connection feature not tested, use at your own risk
|
||||||
dbHostname: peertube-postgresql # must be consistent with postgresql configuration
|
dbHostname: peertube-gsb-postgresql # must be consistent with postgresql configuration
|
||||||
webHostname: peertube # must be changed to your local setup
|
webHostname: peertube # must be changed to your local setup
|
||||||
secret: b2753b0f37444974de0e81f04815e6a889fcf8960bd203a01b624d8fa8a37683
|
secret: b2753b0f37444974de0e81f04815e6a889fcf8960bd203a01b624d8fa8a37683
|
||||||
smtpHostname: peertube-mail # must be consistent with mail configuration
|
smtpHostname: peertube-mail # must be consistent with mail configuration
|
||||||
@ -53,7 +53,7 @@ peertube:
|
|||||||
smtpTls: false # disabled by default WARNING: tls connection feature not tested, use at your own risk
|
smtpTls: false # disabled by default WARNING: tls connection feature not tested, use at your own risk
|
||||||
smtpDisableStartTls: false # unless crashes related to tls/ssl, this should be unchanged
|
smtpDisableStartTls: false # unless crashes related to tls/ssl, this should be unchanged
|
||||||
adminEmail: root@localhost.lan # use this if you want peopleto be able to reach you
|
adminEmail: root@localhost.lan # use this if you want peopleto be able to reach you
|
||||||
redisHostname: peertube-redis-master # must be consistent with redis configuration
|
redisHostname: peertube-gsb-redis-master # must be consistent with redis configuration
|
||||||
redisAuth: peertube # must be consistent with redis configuration
|
redisAuth: peertube # must be consistent with redis configuration
|
||||||
app:
|
app:
|
||||||
userCanRegister: true # control if people can register by themselves
|
userCanRegister: true # control if people can register by themselves
|
||||||
@ -116,7 +116,7 @@ ingress:
|
|||||||
|
|
||||||
resources: {}
|
resources: {}
|
||||||
autoscaling:
|
autoscaling:
|
||||||
enabled: true
|
enabled: false
|
||||||
minimumReplicas: 3
|
minimumReplicas: 3
|
||||||
maximumReplicas: 20
|
maximumReplicas: 20
|
||||||
targetCPUUtilizationPercentage: 90
|
targetCPUUtilizationPercentage: 90
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
- name: installation de helm...
|
- name: installation de helm...
|
||||||
shell: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
shell: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
|
|
||||||
- name: installation de peertube...
|
|
||||||
shell: helm repo add postgresql https://charts.bitnami.com/bitnami && helm repo add redis https://charts.bitnami.com/bitnami && helm repo add mail https://bokysan.github.io/docker-postfix
|
|
||||||
|
|
||||||
- name: exposition du cluster...
|
- name: exposition du cluster...
|
||||||
shell: export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
shell: export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
||||||
|
|
||||||
|
- name: installation de peertube...
|
||||||
|
shell: helm repo add postgresql https://charts.bitnami.com/bitnami && helm repo add redis https://charts.bitnami.com/bitnami && helm repo add mail https://bokysan.github.io/docker-postfix
|
||||||
|
|
||||||
- name: lancement du helm chart peertube...
|
- name: lancement du helm chart peertube...
|
||||||
shell: helm install --create-namespace -n peertube peertube-gsb /root/tools/peertube/helm
|
shell: helm install --create-namespace -n peertube peertube-gsb /root/tools/peertube/helm
|
||||||
|
@ -14,7 +14,15 @@
|
|||||||
name: wireguard-tools
|
name: wireguard-tools
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: delais 2 secondes isc-dhcp-service
|
||||||
|
become: yes
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/init.d/isc-dhcp-server
|
||||||
|
insertafter: '^\s+start\)$'
|
||||||
|
line: " sleep 2"
|
||||||
|
firstmatch: yes
|
||||||
|
state: present
|
||||||
|
backup: yes
|
||||||
|
|
||||||
#- name: renommage du fichier de configuration
|
#- name: renommage du fichier de configuration
|
||||||
# command: "mv /etc/wireguard/wg0-b.conf /etc/wireguard/wg0.conf"
|
# command: "mv /etc/wireguard/wg0-b.conf /etc/wireguard/wg0.conf"
|
||||||
|
Reference in New Issue
Block a user