feat: unified launcher, multi-OS hardening, login alerts & auto-updates
Restructure around a single entry point (automations.sh) with a Gum wizard and a self-extracting bundle for repo-less installs. Add scripts/oslib.sh so the provisioning scripts (setup-host, harden-ssh, harden-jumphost, sshuser) run on Alpine/Debian/Alma; seed root keys from globals/. - ntfy SSH-login alerts (user, source IP, key, region, jump target) via pam_exec - daily auto-updates with AUTO_REBOOT=idle (reboots only when no SSH active) and opt-in Alpine stable-branch upgrades - generic + per-deployment cloud-init; Gitea release workflow on tag - README/LICENSE/.gitignore/.gitattributes (force LF); repo URLs -> Gitea
This commit is contained in:
58 files changed
+6225
-284
No files matched your search
@@ -0,0 +1,71 @@
|
||||
## **1. General Information**
|
||||
|
||||
1.01 This section contains regulations for identification of network systems, devices, and applications or services.
|
||||
|
||||
1.02 Whenever this section is reissued, the reason(s) for reissue will be listed in this paragraph.
|
||||
|
||||
## **2. Identification & Configuration**
|
||||
|
||||
2.01 Provides a common method and standard for universal identification of systems, devices, and software or services with a Domain Name for DNS.
|
||||
|
||||
## **3. Network Domain Name Schema**
|
||||
|
||||
3.01 Table of acronymized abbreviations for use in DNS.
|
||||
|
||||
### Names for Applications & Services:
|
||||
|
||||
- app – Application Server (non-web)
|
||||
- dbs – Database Server
|
||||
- ftp – SFTP server
|
||||
- mta – Mail Server / Mail Transfer Agent
|
||||
- dns – Name Server
|
||||
- rsv - DNS Rsolver
|
||||
- cfg – Configuration Management (puppet/ansible/etc.)
|
||||
- mon – Monitoring Server (nagios, sensu, etc.)
|
||||
- zbx - Zabbix Proxy / Server
|
||||
- ssh – SSH Jump/Bastion Host
|
||||
- sto – Storage Server / File Share (iSCSI/NFS/SMB/Ceph/GlusterFS)
|
||||
- git – Version Control Software Server (Git/SVN/CVS/etc.)
|
||||
- vmm – Virtual Machine Manager
|
||||
- web – Web Server k8s - Kubernetes Controller/Worker Node
|
||||
- dsv - Directory Domain Services (LDAP / AD DS)
|
||||
- rds - Remote Desktop Services - (RemoteApp/Sessions)
|
||||
- vpn – VPN Gateway
|
||||
- wgd – WireGuard
|
||||
- prx – Proxy/Load Balancer (software)
|
||||
- zta - Zero Trust Access
|
||||
- dot - Traffic Shaper
|
||||
|
||||
### Names for Systems and Devices:
|
||||
|
||||
- con – Console/Terminal Server
|
||||
- fwl – Firewall
|
||||
- lbl – Load Balancer (physical)
|
||||
- gtr - L3 Global Transit Router
|
||||
- ctr - L3 Core Router
|
||||
- rtr – L3 Router
|
||||
- swt – L2 Switch
|
||||
- dcr – Data Center Router
|
||||
- dcs – Data Center Switch
|
||||
- pdu – Power Distribution Unit
|
||||
- ups – Uninterruptible Power Supply
|
||||
|
||||
3.02 Geospatial positioning in domain names for regional datacenter services and systems is to follow UN/LOCODE naming conventions as follows:
|
||||
|
||||
Example: [us-evi-1.example.net](http://us-evi-1.example.net/) indicates the names
|
||||
|
||||
left most of ‘us-evi-1' are in Elk Grove Village Illinois within the United States of America. The trailing number “1” indicates the specific facility located in this municipality for cases where multiple are within the same regional area.
|
||||
|
||||
Application of this USP can be demonstrated as followed:
|
||||
|
||||
Example: [dns-1.us-evi-1.datacenter.gg](http://dns-1.us-evi-1.datacenter.gg/)
|
||||
|
||||
3.03 Anycast services do not follow 3.02, instead indicate region using anycast in placement of 3.02 region code. Section 3.02 may still be used for secondary IPs that are bound to the location, even to the same service.
|
||||
|
||||
Example: [dns-1.anycast.datacenter.gg](http://dns-1.anycast.datacenter.gg/)
|
||||
|
||||
## **4. UN/LOCODE Code List by Country and Territory**
|
||||
|
||||
4.01 Data Located in Online Resource
|
||||
|
||||
URL: [https://unece.org/trade/cefact/unlocode-code-list-country-and-territory](https://unece.org/trade/cefact/unlocode-code-list-country-and-territory)
|
||||
@@ -0,0 +1,34 @@
|
||||
# globals/
|
||||
|
||||
Shared, cross-deployment assets. Everything here is referenced by the launcher
|
||||
([`../automations.sh`](../automations.sh)), the helper library
|
||||
([`../scripts/lib.sh`](../scripts/lib.sh)), and the per-deployment cloud-init
|
||||
templates — so a value lives in exactly one place.
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `globals.env.example` | Template of shared defaults. Copy to `globals.env` (git-ignored) and edit. Sourced by the launcher and `lib.sh`. |
|
||||
| `age-pubkey.txt` | Age **public** key recipient(s) for encrypted backups. Used by any stack that backs up (e.g. simplex). Public key — safe to commit. |
|
||||
| `authorized_keys` | Static admin SSH **public** keys. The fallback source when `SSH_KEYS_URL` is unset. |
|
||||
| `motd.txt` | MOTD **template** (token-based) rendered to `/etc/motd` by [`../scripts/setup-host.sh`](../scripts/setup-host.sh). You edit the content; the renderer draws the borders and computes all spacing. |
|
||||
| `Network Domain Name Schema.md` | Reference: the DNS naming convention (service/device acronyms, UN/LOCODE geo-coding) used for host and service names. `setup-host.sh` derives the FQDN and Node ID from it. |
|
||||
|
||||
## SSH key resolution (URL-preferred)
|
||||
|
||||
`resolve_ssh_keys()` in `../scripts/lib.sh` decides where admin SSH keys come
|
||||
from:
|
||||
|
||||
1. If `SSH_KEYS_URL` is set in `globals.env`, it is fetched live with
|
||||
`curl -fsSL` (always current — best when you rotate keys often). This can be
|
||||
a GitHub keys endpoint (`https://github.com/<user>.keys`) or any raw
|
||||
`authorized_keys` URL.
|
||||
2. Otherwise, `globals/authorized_keys` is read directly (self-contained,
|
||||
versioned — edit the repo to rotate).
|
||||
|
||||
## Rules
|
||||
|
||||
- **Only public material lives here.** Never commit private keys (SSH private
|
||||
keys, age identities). `globals.env` and common private-key filename patterns
|
||||
are git-ignored (see [`../.gitignore`](../.gitignore)).
|
||||
- Store the age **private** key(s) and SSH **private** keys somewhere safe,
|
||||
outside this repository.
|
||||
@@ -0,0 +1,10 @@
|
||||
# Age public keys for encrypted backups (shared across all deployments)
|
||||
#
|
||||
# Generate a keypair with: age-keygen -o backup-private-key.txt
|
||||
# Then copy the "Public key: age1..." line here.
|
||||
#
|
||||
# You can list multiple recipients - backups are encrypted to all of them.
|
||||
# Store the corresponding PRIVATE keys securely, NEVER in this git repository.
|
||||
|
||||
# Primary backup key
|
||||
age1tudl7dksctvpkfnu46tq8tmkt36k6xg0rmudzaayqakrtper2fpsk0dnhp
|
||||
@@ -0,0 +1,11 @@
|
||||
# Shared admin SSH public keys.
|
||||
#
|
||||
# These are the public keys granted administrative SSH access across hosts.
|
||||
# Used as the fallback source when SSH_KEYS_URL is not set in globals.env
|
||||
# (see resolve_ssh_keys in ../scripts/lib.sh).
|
||||
#
|
||||
# One key per line. Lines starting with '#' and blank lines are ignored.
|
||||
# Only public keys belong here. NEVER commit private keys.
|
||||
#
|
||||
# Example:
|
||||
# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... william@laptop
|
||||
@@ -0,0 +1,26 @@
|
||||
# Shared defaults for all deployments and scripts.
|
||||
#
|
||||
# Copy to globals.env and edit. The launcher (../automations.sh) and the
|
||||
# helpers in ../scripts/lib.sh source globals.env if present, otherwise they
|
||||
# fall back to the values shown here. The real globals.env is git-ignored.
|
||||
|
||||
# ─── Repository ─────────────────────────────────────────────────────────────
|
||||
# Where the launcher and cloud-init clone this repo from. Used by the
|
||||
# one-liner bootstrap and by every deployment's cloud-init.yml.
|
||||
REPO_URL=https://git.anomalous.dev/57_Wolve/automations.git
|
||||
REPO_BRANCH=main
|
||||
|
||||
# ─── Shared deployment defaults ─────────────────────────────────────────────
|
||||
# Pre-filled into per-deployment prompts so you only type them once.
|
||||
ACME_EMAIL=admin@example.com
|
||||
SSH_PORT=22
|
||||
|
||||
# ─── SSH authorized keys ────────────────────────────────────────────────────
|
||||
# resolve_ssh_keys() prefers this URL when set (fetched live, always current),
|
||||
# e.g. a GitHub keys endpoint (https://github.com/<user>.keys) or a raw
|
||||
# authorized_keys file. When empty, it falls back to globals/authorized_keys.
|
||||
SSH_KEYS_URL=
|
||||
|
||||
# ─── Backups ────────────────────────────────────────────────────────────────
|
||||
# Age public-key recipient file for encrypted backups (relative to repo root).
|
||||
AGE_PUBKEY_FILE=globals/age-pubkey.txt
|
||||
@@ -0,0 +1,30 @@
|
||||
# MOTD template, rendered by ../scripts/setup-host.sh.
|
||||
#
|
||||
# You edit CONTENT here; the renderer draws the borders and handles all
|
||||
# spacing, so the box always stays aligned no matter how long a value is.
|
||||
#
|
||||
# Lines beginning with '#' are comments and ignored. Tokens:
|
||||
# @TOP@ top border
|
||||
# @BOT@ bottom border
|
||||
# @HR@ horizontal divider
|
||||
# @BLANK@ empty content line
|
||||
# @C@ text centered line (ASCII text)
|
||||
# @BOX@ text centered line wrapped in a mini double-line box
|
||||
# @F@ Label|value field line: right-aligned label, then value
|
||||
#
|
||||
# In @F@ values these placeholders are substituted at render time:
|
||||
# {{HOSTNAME}} full FQDN (e.g. sto-1.srvno.de)
|
||||
# {{NODE_ID}} short name, uppercased (e.g. STO-1)
|
||||
# {{DATACENTER}} the DATACENTER value
|
||||
#
|
||||
# Box width is set by MOTD_WIDTH in setup-host.sh (default 60).
|
||||
|
||||
@TOP@
|
||||
@BOX@ !! DANGER - CRITICAL INFRASTRUCTURE !!
|
||||
@C@ YOU are connected to a CRITICAL SYSTEM
|
||||
@C@ CHECK YOUR WORK BEFORE RELOAD / RESTART OF THE SERVICE
|
||||
@HR@
|
||||
@F@ Data Center|{{DATACENTER}}
|
||||
@F@ Hostname|{{HOSTNAME}}
|
||||
@F@ Node ID|{{NODE_ID}}
|
||||
@BOT@
|
||||
Reference in new issue
Block a user