snster bootstrap

This commit is contained in:
Francois Lesueur
2022-12-22 17:25:05 +01:00
parent 5545db5891
commit 0733aa3ae8
26 changed files with 898 additions and 119 deletions

View File

@ -0,0 +1,42 @@
version: 1
header:
name: MICA AS
comment: An ACME Certification Authority
hosts:
router:
master: alpine
network:
interfaces:
eth0:
bridge: transit-a
ipv4: 100.64.1.140/24
ipv6: 2001:db8:b001::140/48
eth1:
bridge: mica-lan
ipv4: 100.82.0.1/16
ipv6: 2001:db8:82::1/48
templates:
- bgprouter:
asn: 12
asdev: eth1
neighbors4: 100.64.1.1 as 31
neighbors6: 2001:db8:b001::1 as 31
- resolv:
nameserver: 100.100.100.100
domain: mica.milxc
infra:
network:
interfaces:
eth0:
bridge: mica-lan
ipv4: 100.82.0.2/16
ipv6: 2001:db8:82::2/48
gatewayv4: 100.82.0.1
gatewayv6: 2001:db8:82::1
templates:
- resolv:
domain: mica.milxc
ns: 100.100.100.100

View File

@ -0,0 +1,8 @@
server:
interface: 0.0.0.0
access-control: 100.64.0.0/10 allow
local-zone: "mica.milxc." static
local-data: "ns.mica.milxc. IN A 100.82.0.2"
local-data: "www.mica.milxc. IN A 100.82.0.2"
local-data: "ca.mica.milxc. IN A 100.82.0.2"

View File

@ -0,0 +1,34 @@
#!/bin/bash
# MICA infra
set -e
if [ -z $MILXCGUARD ] ; then exit 1; fi
DIR=`dirname $0`
cd `dirname $0`
# Hacker's mail account hacker@isp-a.milxc
useradd -m -s "/bin/bash" -p `mkpasswd --method=sha-512 ca` ca || true
addgroup ca mail
#mkdir /home/hacker/mail
#touch /home/hacker/mail/Drafts /home/hacker/mail/Queue /home/hacker/mail/Sent /home/hacker/mail/Trash
# disable systemd-resolved which conflicts with nsd
echo "DNSStubListener=no" >> /etc/systemd/resolved.conf
systemctl stop systemd-resolved
# manage isp-a.milxc zone
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y unbound
cp dns.conf /etc/unbound/unbound.conf.d/
# Install smallstep CA / ACME server
cd /tmp
wget https://github.com/smallstep/cli/releases/download/v0.17.2/step-cli_0.17.2_amd64.deb
dpkg -i step-cli_0.17.2_amd64.deb
wget https://github.com/smallstep/certificates/releases/download/v0.17.2/step-ca_0.17.2_amd64.deb
dpkg -i step-ca_0.17.2_amd64.deb
# step ca init
# step ca root root.crt
# step ca provisioner add acme --type ACME
# certbot certonly -n --standalone -d www.target.milxc --server https://www.mica.milxc/acme/acme/directory --agree-tos --email "fr@fr.fr"