server/fickit-frontend.yml

501 lines
17 KiB
YAML
Raw Normal View History

2018-01-21 16:03:45 +00:00
kernel:
2018-12-10 01:16:07 +00:00
image: nemunaire/kernel:4.9.140-4080ab71159a0b09a0b2ce7d87a7cb7fd719e35d-dirty-amd64
cmdline: "console=ttyS0 console=tty0"
2018-01-21 16:03:45 +00:00
init:
2018-12-10 01:16:07 +00:00
- linuxkit/init:c563953a2277eb73a89d89f70e4b6dcdcfebc2d1
- linuxkit/runc:83d0edb4552b1a5df1f0976f05f442829eac38fe
- linuxkit/containerd:326b096cd5fbab0f864e52721d036cade67599d6
- linuxkit/ca-certificates:v0.6
- linuxkit/getty:2eb742cd7a68e14cf50577c02f30147bc406e478
- nemunaire/mdadm:18541ef20acd7e67e07bb2bde4f378239e67c42d
2018-01-21 16:03:45 +00:00
onboot:
2018-12-10 01:16:07 +00:00
- name: mod
image: linuxkit/modprobe:v0.6
command: ["/bin/sh", "-c", "modprobe r8169;"]
2019-01-17 08:11:13 +00:00
- name: sysctl
image: linuxkit/sysctl:v0.6
binds:
- /etc/sysctl.d/01-fic.conf:/etc/sysctl.d/01-fic.conf:ro
2018-01-21 16:03:45 +00:00
# Filesystem
- name: swap
2018-12-10 01:16:07 +00:00
image: linuxkit/swap:v0.6
command: ["/sbin/swapon", "/dev/sda2", "/dev/sdb2"]
2018-01-21 16:03:45 +00:00
- name: mount
2018-12-10 01:16:07 +00:00
image: linuxkit/mount:v0.6
command: ["/usr/bin/mountie", "-device", "/dev/md0", "/var/lib/fic" ]
2018-01-21 16:03:45 +00:00
# Network
# - name: ntp
# image: linuxkit/openntpd:536e5947607c9e6a6771957c2ff817230cba0d3c
- name: nginx-ip-setup
2018-12-10 01:16:07 +00:00
image: linuxkit/ip:v0.6
2018-01-21 16:03:45 +00:00
command: ["/bin/sh", "-c", "ip a add 172.17.1.2/24 dev vethin-nginx; ip link set vethin-nginx up;" ]
net: new
runtime:
interfaces:
- name: vethin-nginx
add: veth
peer: veth-nginx
bindNS:
net: /run/netns/nginx
2019-01-17 06:55:05 +00:00
# - name: frontal-ip-setup # without bonding
2018-12-10 01:16:07 +00:00
# image: linuxkit/ip:v0.6
# command: ["/bin/sh", "-c", "ip link set eth1 up; ip a add 172.23.42.1/24 dev eth1; ip a add 172.23.42.254/24 dev eth1; ip a add 163.5.55.58/32 dev eth1; ip link add link eth1 name internet type vlan id 1; ip link set internet up;" ]
2018-12-10 01:16:07 +00:00
# net: /run/netns/nginx
# runtime:
# interfaces:
# - name: eth1
# - name: eth2
# - name: eth3
2019-01-17 06:55:05 +00:00
- name: frontal-ip-setup # with bonding
image: linuxkit/ip:v0.6
command: ["/bin/sh", "-c", "ip link set bond-frontal up; ifenslave bond-frontal eth1 eth2 eth3; ip a add 172.23.42.1/24 dev bond-frontal; ip a add 172.23.42.254/24 dev bond-frontal; ip a add 163.5.55.58/32 dev bond-frontal; ip link add link bond-frontal name internet type vlan id 1; ip link set internet up;" ]
2019-01-17 06:55:05 +00:00
net: /run/netns/nginx
runtime:
interfaces:
- name: eth1
- name: eth2
- name: eth3
- name: bond-frontal
add: bond
2018-01-21 16:03:45 +00:00
- name: frontend-ip-setup
2018-12-10 01:16:07 +00:00
image: linuxkit/ip:v0.6
2018-01-21 16:03:45 +00:00
command: ["/bin/sh", "-c", "ip a add 172.17.1.3/24 dev vethin-frontend; ip link set vethin-frontend up;" ]
net: new
runtime:
interfaces:
- name: vethin-frontend
add: veth
peer: veth-frontend
bindNS:
net: /run/netns/fic-frontend
- name: sshd-ip-setup
2018-12-10 01:16:07 +00:00
image: linuxkit/ip:v0.6
2018-01-21 16:03:45 +00:00
command: ["/bin/sh", "-c", "ip a add 10.10.10.2/29 dev eth0; ip link set eth0 up;" ]
net: new
runtime:
interfaces:
- name: eth0
bindNS:
net: /run/netns/sshd
- name: bridge-setup
2018-12-10 01:16:07 +00:00
image: linuxkit/ip:v0.6
2018-01-21 16:03:45 +00:00
command: ["/bin/sh", "-c", "ip a add 172.17.1.1/24 dev br0; ip link set veth-nginx master br0; ip link set veth-frontend master br0; ip link set br0 up; ip link set veth-nginx up; ip link set veth-frontend up;" ]
runtime:
interfaces:
- name: br0
add: bridge
- name: firewall-frontal
2018-12-10 01:16:07 +00:00
image: linuxkit/ip:v0.6
2018-01-21 16:03:45 +00:00
command: ["/bin/bash", "-c", "/sbin/iptables-restore < /etc/iptables/rules-frontal.v4; /sbin/ip6tables-restore < /etc/iptables/rules.v6" ]
binds:
- /etc/iptables/rules-frontal.v4:/etc/iptables/rules-frontal.v4:ro
- /etc/iptables/rules.v6:/etc/iptables/rules.v6:ro
net: /run/netns/nginx
- name: firewall-sshd
2018-12-10 01:16:07 +00:00
image: linuxkit/ip:v0.6
2018-01-21 16:03:45 +00:00
command: ["/bin/bash", "-c", "/sbin/iptables-restore < /etc/iptables/rules-sshd.v4; /sbin/ip6tables-restore < /etc/iptables/rules.v6" ]
binds:
- /etc/iptables/rules-sshd.v4:/etc/iptables/rules-sshd.v4:ro
- /etc/iptables/rules.v6:/etc/iptables/rules.v6:ro
net: /run/netns/sshd
services:
2018-12-10 01:16:07 +00:00
# - name: getty
# image: linuxkit/getty:2eb742cd7a68e14cf50577c02f30147bc406e478
# env:
# - INSECURE=true
2018-01-21 16:03:45 +00:00
- name: rngd
2018-12-10 01:16:07 +00:00
image: linuxkit/rngd:v0.6
2019-01-17 06:55:05 +00:00
- name: dhcpcd
image: linuxkit/dhcpcd:v0.6
net: /run/netns/nginx
binds:
- /etc/dhcpcd.conf:/dhcpcd.conf:ro
2018-01-21 16:03:45 +00:00
- name: nginx
image: nginx:alpine
capabilities:
- CAP_NET_BIND_SERVICE
- CAP_CHOWN
- CAP_SETUID
- CAP_SETGID
- CAP_DAC_OVERRIDE
binds:
- /etc/hosts:/etc/hosts:ro
- /etc/resolv.conf:/etc/resolv.conf:ro
- /etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro
- /etc/nginx/ssl/:/etc/nginx/ssl/:ro
- /etc/nginx/fic-auth.conf:/etc/nginx/fic-auth.conf:ro
- /www/htdocs-frontend:/srv/htdocs-frontend:ro
- /var/lib/fic/files:/srv/FILES:ro
- /var/lib/fic/pki:/srv/PKI:ro
- /var/lib/fic/settings:/srv/SETTINGS:ro
- /var/lib/fic/startingblock:/srv/startingblock:ro
- /var/lib/fic/teams:/srv/TEAMS:ro
net: /run/netns/nginx
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/files
- /var/lib/fic/pki
- /var/lib/fic/startingblock
- /var/lib/fic/teams
- name: fic-frontend
image: nemunaire/fic-frontend:latest
command: ["/srv/frontend", "-bind=:8080", "-startedFile=/srv/startingblock/started"]
binds:
- /etc/hosts:/etc/hosts:ro
- /var/lib/fic/files:/srv/FILES:ro
- /var/lib/fic/settings:/srv/SETTINGS:ro
- /var/lib/fic/startingblock:/srv/startingblock
- /var/lib/fic/submissions:/srv/submissions
- /var/lib/fic/teams:/srv/TEAMS:ro
net: /run/netns/fic-frontend
runtime:
mkdir:
- /var/lib/fic/files
- /var/lib/fic/settings
- /var/lib/fic/startingblock
- /var/lib/fic/submissions
- /var/lib/fic/teams
- name: sshd
image: nemunaire/rsync:ca312b09a5048c165cf727660b7755f001d17650
capabilities:
- all
2018-01-21 16:03:45 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
- /root/.ssh/id_synchro.pub:/root/.ssh/authorized_keys:ro
- /var/lib/fic/files:/srv/FILES
- /var/lib/fic/pki:/srv/PKI
- /var/lib/fic/settings:/srv/SETTINGS
- /var/lib/fic/submissions:/srv/submissions
- /var/lib/fic/teams:/srv/TEAMS
net: /run/netns/sshd
runtime:
mkdir:
- /var/lib/fic/files
- /var/lib/fic/pki
- /var/lib/fic/settings
- /var/lib/fic/submissions
- /var/lib/fic/teams
- name: dhcp-server
image: joebiellik/dhcpd
binds:
- /etc/dhcp/dhcpd.conf:/etc/dhcp/dhcpd.conf:ro
capabilities:
- CAP_NET_BIND_SERVICE
- CAP_NET_RAW
- CAP_DAC_OVERRIDE
net: /run/netns/nginx
pid: new
ipc: new
uts: new
2019-01-17 07:10:47 +00:00
- name: dns-server
2019-01-17 07:29:47 +00:00
image: nemunaire/unbound:93f5e52c6854356df113e547e0f60c8a23f98021
2019-01-17 07:10:47 +00:00
binds:
- /etc/unbound/unbound.d:/etc/unbound/unbound.d:ro
net: /run/netns/nginx
2018-01-21 16:03:45 +00:00
files:
2019-01-17 08:11:13 +00:00
- path: etc/sysctl.d/01-fic.conf
source: configs/sysctl-frontend.conf
mode: "0444"
2018-01-21 16:03:45 +00:00
- path: etc/nginx/ssl/dhparams-4096.pem
source: configs/dhparams-4096.pem
mode: "0444"
- path: etc/nginx/ssl/fullchain.pem
source: configs/fic.srs.epita.fr/fullchain.pem
mode: "0444"
- path: etc/nginx/ssl/privkey.pem
source: configs/fic.srs.epita.fr/privkey.pem
mode: "0440"
- path: etc/hosts
source: configs/hosts
mode: "0644"
- path: root/.ssh/authorized_keys
source: configs/authorized_keys
mode: "0400"
- path: root/.ssh/id_synchro.pub
source: configs/id_ed25519.pub
mode: "0400"
- path: etc/dhcp/dhcpd.conf
source: configs/dhcpd.conf
mode: "0400"
- path: etc/nginx/conf.d/default.conf
2018-12-10 01:16:07 +00:00
source: configs/nginx-demo.conf
2018-01-21 16:03:45 +00:00
mode: "0400"
- path: etc/nginx/fic-auth.conf
source: configs/fic-auth-fwd.conf
2018-01-21 16:03:45 +00:00
mode: "0400"
- path: www/htdocs-frontend
directory: true
mode: "0755"
- path: www/htdocs-frontend/e500.html
source: frontend/static/e500.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/e500.json
source: frontend/static/e500.json
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/img/srs.png
source: frontend/static/img/srs.png
mode: "0644"
- path: www/htdocs-frontend/img/fic.png
source: frontend/static/img/fic.png
mode: "0644"
- path: www/htdocs-frontend/img/epita.png
source: frontend/static/img/epita.png
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/img/comcyber.png
source: frontend/static/img/comcyber.png
2018-01-21 16:03:45 +00:00
mode: "0644"
2019-01-17 18:42:28 +00:00
- path: www/htdocs-frontend/img/icon-primary.ico
source: frontend/static/img/icon-primary.ico
mode: "0644"
- path: www/htdocs-frontend/img/icon-secondary.ico
source: frontend/static/img/icon-secondary.ico
mode: "0644"
- path: www/htdocs-frontend/img/icon-danger.ico
source: frontend/static/img/icon-danger.ico
mode: "0644"
- path: www/htdocs-frontend/img/icon-success.ico
source: frontend/static/img/icon-success.ico
mode: "0644"
- path: www/htdocs-frontend/img/icon-warning.ico
source: frontend/static/img/icon-warning.ico
mode: "0644"
- path: www/htdocs-frontend/img/icon-dark.ico
source: frontend/static/img/icon-dark.ico
mode: "0644"
- path: www/htdocs-frontend/img/icon-light.ico
source: frontend/static/img/icon-light.ico
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/favicon.ico
source: frontend/static/favicon.ico
mode: "0644"
- path: www/htdocs-frontend/e404.html
source: frontend/static/e404.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/e404.json
source: frontend/static/e404.json
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/css/bootstrap.min.css
source: frontend/static/css/bootstrap.min.css
mode: "0644"
- path: www/htdocs-frontend/css/fic.css
source: frontend/static/css/fic.css
mode: "0644"
- path: www/htdocs-frontend/css/glyphicon.css
source: frontend/static/css/glyphicon.css
mode: "0644"
- path: www/htdocs-frontend/js/i18n/angular-locale_fr-fr.js
source: frontend/static/js/i18n/angular-locale_fr-fr.js
mode: "0644"
- path: www/htdocs-frontend/js/angular-sanitize.min.js
source: frontend/static/js/angular-sanitize.min.js
mode: "0644"
- path: www/htdocs-frontend/js/d3.v3.min.js
source: frontend/static/js/d3.v3.min.js
mode: "0644"
- path: www/htdocs-frontend/js/common.js
source: frontend/static/js/common.js
mode: "0644"
- path: www/htdocs-frontend/js/angular.min.js
source: frontend/static/js/angular.min.js
mode: "0644"
- path: www/htdocs-frontend/js/challenge.js
source: frontend/static/js/challenge.js
mode: "0644"
- path: www/htdocs-frontend/js/bootstrap.min.js
source: frontend/static/js/bootstrap.min.js
mode: "0644"
- path: www/htdocs-frontend/js/jquery.min.js
source: frontend/static/js/jquery.min.js
mode: "0644"
- path: www/htdocs-frontend/js/angular-route.min.js
source: frontend/static/js/angular-route.min.js
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/js/blake2b.js
source: frontend/static/js/blake2b.js
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/e413.html
source: frontend/static/e413.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/e413.json
source: frontend/static/e413.json
mode: "0644"
- path: www/htdocs-frontend/fonts/FantasqueSansMono-Regular.woff
source: frontend/static/fonts/FantasqueSansMono-Regular.woff
mode: "0644"
2019-01-17 08:35:09 +00:00
- path: www/htdocs-frontend/fonts/LinBiolinum_R.woff
source: frontend/static/fonts/LinBiolinum_R.woff
mode: "0644"
- path: www/htdocs-frontend/fonts/LinBiolinum_RB.woff
source: frontend/static/fonts/LinBiolinum_RB.woff
mode: "0644"
- path: www/htdocs-frontend/fonts/LinBiolinum_RI.woff
source: frontend/static/fonts/LinBiolinum_RI.woff
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.woff2
source: frontend/static/fonts/glyphicons-halflings-regular.woff2
mode: "0644"
- path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.woff
source: frontend/static/fonts/glyphicons-halflings-regular.woff
mode: "0644"
- path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.eot
source: frontend/static/fonts/glyphicons-halflings-regular.eot
mode: "0644"
- path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.ttf
source: frontend/static/fonts/glyphicons-halflings-regular.ttf
mode: "0644"
- path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.svg
source: frontend/static/fonts/glyphicons-halflings-regular.svg
mode: "0644"
- path: www/htdocs-frontend/welcome.html
source: frontend/static/welcome.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/welcome.json
source: frontend/static/welcome.json
2018-01-21 16:03:45 +00:00
mode: "0644"
- path: www/htdocs-frontend/index.html
source: frontend/static/index.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/views/defi.html
source: frontend/static/views/defi.html
2018-01-21 16:03:45 +00:00
mode: "0644"
- path: www/htdocs-frontend/views/home.html
source: frontend/static/views/home.html
mode: "0644"
- path: www/htdocs-frontend/views/rank.html
source: frontend/static/views/rank.html
mode: "0644"
- path: www/htdocs-frontend/views/register.html
source: frontend/static/views/register.html
mode: "0644"
- path: www/htdocs-frontend/views/rules.html
source: frontend/static/views/rules.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/views/tag.html
source: frontend/static/views/tag.html
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/views/team-edit.html
source: frontend/static/views/team-edit.html
mode: "0644"
2018-12-10 01:16:07 +00:00
- path: www/htdocs-frontend/views/theme.html
source: frontend/static/views/theme.html
mode: "0644"
- path: www/htdocs-frontend/views/videos.html
source: frontend/static/views/videos.html
mode: "0644"
2018-01-21 16:03:45 +00:00
- path: www/htdocs-frontend/robots.txt
source: frontend/static/robots.txt
mode: "0644"
2019-01-17 06:55:05 +00:00
- path: etc/dhcpcd.conf
contents: |
allowinterfaces internet
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
nodelay
noarp
waitip 4
mode: "0440"
2019-01-17 07:10:47 +00:00
- path: etc/unbound/unbound.d/access-control.conf
contents: |
access-control: 172.23.0.0/16 allow
mode: "0440"
- path: etc/unbound/unbound.d/local-zone.conf
contents: |
local-zone: "srs.epita.fr" typetransparent
local-data: "fic.srs.epita.fr A 172.23.42.1"
local-data-ptr: "172.23.42.1 fic.srs.epita.fr"
mode: "0440"
2018-01-21 16:03:45 +00:00
- path: etc/iptables/rules.v6
contents: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
COMMIT
mode: "0440"
- path: etc/iptables/rules-sshd.v4
contents: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
[0:0] -A INPUT -i lo -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate INVALID -j DROP
[0:0] -A INPUT -p icmp -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A INPUT -i eth0 -s 10.10.10.0/29 -p tcp -m conntrack --ctstate NEW -m tcp --dport ssh -j ACCEPT
[0:0] -A INPUT -j LOG
[0:0] -A FORWARD -j LOG
[0:0] -A OUTPUT -o lo -j ACCEPT
[0:0] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A OUTPUT -j LOG
[0:0] -A OUTPUT -j REJECT
COMMIT
mode: "0440"
- path: etc/iptables/rules-frontal.v4
contents: |
2019-01-17 06:55:05 +00:00
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
[0:0] -A PREROUTING -p tcp -m tcp -i br0 ! -d 172.23.42.254/32 --dport 53 -j DNAT --to-destination 172.23.42.254
[0:0] -A PREROUTING -p udp -m udp -i br0 ! -d 172.23.42.254/32 --dport 53 -j DNAT --to-destination 172.23.42.254
[0:0] -A POSTROUTING -o internet -j MASQUERADE
COMMIT
2018-01-21 16:03:45 +00:00
*filter
:INPUT DROP [0:0]
2019-01-17 06:55:05 +00:00
:FORWARD ACCEPT [0:0]
2018-01-21 16:03:45 +00:00
:OUTPUT DROP [0:0]
[0:0] -A INPUT -i lo -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate INVALID -j DROP
[0:0] -A INPUT -p icmp --icmp-type 8 -j ACCEPT
[0:0] -A INPUT -p icmp --icmp-type 0 -j ACCEPT
2019-01-17 07:10:47 +00:00
[0:0] -A INPUT -i bond-frontal -p udp -m udp --dport domain -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
2019-01-17 07:10:47 +00:00
[0:0] -A INPUT -i bond-frontal -p tcp -m conntrack --ctstate NEW -m tcp --dport domain -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A INPUT -i bond-frontal -p tcp -m conntrack --ctstate NEW -m tcp --dport http -j ACCEPT
[0:0] -A INPUT -i bond-frontal -p tcp -m conntrack --ctstate NEW -m tcp --dport https -j ACCEPT
[0:0] -A INPUT -j LOG
[0:0] -A FORWARD -j LOG
[0:0] -A OUTPUT -o lo -j ACCEPT
[0:0] -A OUTPUT -p icmp --icmp-type 0 -j ACCEPT
[0:0] -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
2019-01-17 07:10:47 +00:00
[0:0] -A OUTPUT -o bond-frontal -p udp -m udp --sport domain -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
2019-01-17 06:55:05 +00:00
[0:0] -A OUTPUT -o vethin-nginx -d 172.17.1.3 -p tcp -m conntrack --ctstate NEW -m tcp --dport 8080 -j ACCEPT
[0:0] -A OUTPUT -o internet -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A OUTPUT -j LOG
[0:0] -A OUTPUT -j REJECT
COMMIT
mode: "0440"
trust:
org:
- linuxkit
- library