Compare commits
6 Commits
v0.0.6w-ml
...
v0.0.7c-em
Author | SHA1 | Date | |
---|---|---|---|
5b759a24c9 | |||
a64004d713 | |||
dd6d34986b | |||
cf6f6096d6 | |||
99ed9d3b27 | |||
3e98f7149f |
@ -28,7 +28,7 @@
|
|||||||
192.168.99.103 s-lb-web3.gsb.adm
|
192.168.99.103 s-lb-web3.gsb.adm
|
||||||
192.168.99.112 r-vp1.gsb.adm
|
192.168.99.112 r-vp1.gsb.adm
|
||||||
192.168.99.102 r-vp2.gsb.adm
|
192.168.99.102 r-vp2.gsb.adm
|
||||||
|
192.168.99.120 s-peertube.gsb.adm
|
||||||
|
|
||||||
192.168.99.8 syslog.gsb.adm
|
192.168.99.8 syslog.gsb.adm
|
||||||
|
|
||||||
|
@ -27,6 +27,6 @@
|
|||||||
192.168.99.103 s-lb-web3.gsb.adm
|
192.168.99.103 s-lb-web3.gsb.adm
|
||||||
192.168.99.112 r-vp1.gsb.adm
|
192.168.99.112 r-vp1.gsb.adm
|
||||||
192.168.99.102 r-vp2.gsb.adm
|
192.168.99.102 r-vp2.gsb.adm
|
||||||
|
192.168.99.120 s-peertube.gsb.adm
|
||||||
192.168.99.8 syslog.gsb.adm
|
192.168.99.8 syslog.gsb.adm
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
;
|
;
|
||||||
$TTL 604800
|
$TTL 604800
|
||||||
@ IN SOA s-infra.gsb.lan. root.s-infra.gsb.lan. (
|
@ IN SOA s-infra.gsb.lan. root.s-infra.gsb.lan. (
|
||||||
2023012500 ; Serial
|
2023040501 ; Serial
|
||||||
7200 ; Refresh
|
7200 ; Refresh
|
||||||
86400 ; Retry
|
86400 ; Retry
|
||||||
8419200 ; Expire
|
8419200 ; Expire
|
||||||
@ -35,4 +35,5 @@ s-web1 IN A 192.168.101.1
|
|||||||
s-web2 IN A 192.168.101.2
|
s-web2 IN A 192.168.101.2
|
||||||
s-lb.gsb.lan IN A 192.168.100.10
|
s-lb.gsb.lan IN A 192.168.100.10
|
||||||
ns IN CNAME s-infra.gsb.lan.
|
ns IN CNAME s-infra.gsb.lan.
|
||||||
wpad IN CNAME s-infra.gsb.lan.
|
wpad IN CNAME s-infra.gsb.lan.
|
||||||
|
peertube IN A 192.168.100.20
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
;
|
;
|
||||||
$TTL 604800
|
$TTL 604800
|
||||||
@ IN SOA s-infra.gsb.lan. root.s-infra.gsb.lan. (
|
@ IN SOA s-infra.gsb.lan. root.s-infra.gsb.lan. (
|
||||||
2023012500 ; Serial
|
2023040501 ; Serial
|
||||||
7200 ; Refresh
|
7200 ; Refresh
|
||||||
86400 ; Retry
|
86400 ; Retry
|
||||||
8419200 ; Expire
|
8419200 ; Expire
|
||||||
@ -28,4 +28,4 @@ $TTL 604800
|
|||||||
11.0 IN PTR s-elk.gsb.lan.
|
11.0 IN PTR s-elk.gsb.lan.
|
||||||
17.0 IN PTR s-gestsup.lan
|
17.0 IN PTR s-gestsup.lan
|
||||||
254.0 IN PTR r-int.gsb.lan.
|
254.0 IN PTR r-int.gsb.lan.
|
||||||
|
100.20 IN PTR s-peertube
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
@def $DEV_PRIVATE = enp0s8;
|
@def $DEV_PRIVATE = enp0s8;
|
||||||
@def $DEV_WORLD = enp0s9;
|
@def $DEV_WORLD = enp0s9;
|
||||||
|
@def $DEV_WORLD = enp0s9;
|
||||||
@def $DEV_VPN= wg0;
|
@def $DEV_VPN= wg0;
|
||||||
@def $NET_PRIVATE = 172.16.0.0/24;
|
@def $NET_PRIVATE = 172.16.0.0/24;
|
||||||
|
|
||||||
table filter {
|
table filter {
|
||||||
|
|
||||||
chain (INPUT OUTPUT){
|
chain (INPUT OUTPUT){
|
||||||
# allow VPN
|
# allow VPN
|
||||||
proto udp dport 51820 ACCEPT;
|
proto udp dport 51820 ACCEPT;
|
||||||
@ -28,22 +30,22 @@ 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 réseau
|
|
||||||
|
|
||||||
# the rest is dropped by the above policy
|
# the rest is dropped by the above policy
|
||||||
|
|
||||||
}#FIN INPUT
|
}#FIN INPUT
|
||||||
|
|
||||||
# outgoing connections are not limited
|
# outgoing connections are not limited
|
||||||
|
|
||||||
chain OUTPUT {
|
chain OUTPUT {
|
||||||
policy ACCEPT;
|
policy ACCEPT;
|
||||||
# interface $DEV_VPN proto ssh dport 22 ACCEPT;
|
|
||||||
|
|
||||||
}#FIN OUTPUT
|
}#FIN OUTPUT
|
||||||
|
|
||||||
@ -59,6 +61,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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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: exposition du cluster...
|
||||||
|
command: KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
||||||
|
|
||||||
- name: installation de peertube...
|
- 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
|
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...
|
|
||||||
shell: export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
|
||||||
|
|
||||||
- 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