Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Reset
Редакция КоммитРедакция портала
commit cefbe11 · 19 days ago

🌐 Machine-translated from Russian. Show original

In this part:

Why VPN

Opening 1C, RDP, databases, and file balls to the internet is the most common way small companies can hack . A VPN gives remote employees and branches access to internal resources without exposing them to the outside.

WireGuard is a modern VPN: fast, easy to set up, built into the Linux kernel, with clients available for Windows, macOS, Android, and iOS.

Server

sudo apt install wireguard
wg genkey | sudo tee /etc/wireguard/server.key | wg pubkey | sudo tee /etc/wireguard/server.pub
sudo chmod 600 /etc/wireguard/server.key

/etc/wireguard/wg0.conf:

[Interface]
Address = 10.10.0.1/24
ListenPort = 51820
PrivateKey = <содержимое server.key>

# Сотрудник: ноутбук Айгерим
[Peer]
PublicKey = <публичный ключ клиента>
AllowedIPs = 10.10.0.2/32
sudo systemctl enable --now wg-quick@wg0
sudo ufw allow 51820/udp

To get clients into the office network, enable routing: net.ipv4.ip_forward = 1 in /etc/sysctl.conf (sudo sysctl -p) and NAT rules or routes on the office router.

Client

On the employee's device — the WireGuard application, keys are generated within it or also via wg genkey. Configuration:

[Interface]
Address = 10.10.0.2/32
PrivateKey = <приватный ключ клиента>
DNS = 192.168.1.1

[Peer]
PublicKey = <содержимое server.pub>
Endpoint = vpn.example.kz:51820
AllowedIPs = 10.10.0.0/24, 192.168.1.0/24
PersistentKeepalive = 25
Read more
Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up
Редакция КоммитРедакция портала
commit 946beaf · 19 days ago

🌐 Machine-translated from Russian. Show original

In this part:

Why monitor a small company

Without monitoring, the director reports the problem: 'nothing works.' With monitoring, you'll find out earlier — that the disk is 90% full, the certificate expires in a week, and yesterday's backup failed.

Zabbix or Prometheus

ZabbixPrometheus + Grafana
Approachagents, templates, all-in-onecollecting metrics over HTTP, individual components,
Entry thresholdlower for classic infrastructurelower for containers and microservices
Templatesmany ready-made: Windows, Linux, network hardware, DBMS,exporters for almost everything, dashboards in Grafana
Storageyour own database (PostgreSQL/MySQL)your time-series database
Suitableoffices, servers, printers, switches,cloud, Docker, Kubernetes, your applications,

A quick tip: servers, Windows, and network — Zabbix; containers and proprietary services — Prometheus. Both are free.

What to monitor first

  1. Free disk space is the most common cause of failures.
  2. Availability of key services: website, email, 1C, VPN — external verification.
  3. Validity period of SSL certificates and domains.
  4. The result of the night backup is the time and completion code.
  5. CPU, memory, swap — trends are more important than instantaneous values.
  6. Disk status (SMART) and RAID.
  7. UPS: switch to battery and charge.
Read more
Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up
Редакция КоммитРедакция портала
commit 0d894e9 · 19 days ago

🌐 Machine-translated from Russian. Show original

In this part:

3-2-1 rule

  • 3 copies of data (working + 2 backup);
  • on 2 different media or systems;
  • 1 copy — outside the office or server.

Add another rule to this: a backup that has never been restored does not count.

Why restic

restic — a free backup utility:

  • encrypts data before sending — the storage does not need to be trusted;
  • deduplicates: stores only modified blocks, daily copies take up little space;
  • can store copies on a local disk, via SFTP, in S3-compatible storage, and others.
sudo apt install restic

First repository

export RESTIC_REPOSITORY=sftp:backup@nas.local:/backups/srv1
export RESTIC_PASSWORD_FILE=/root/.restic-pass   # пароль в файле с правами 600
restic init

⚠️ Lose your password — lose backups. Store it in the password manager and sealed off the server.

Backup

restic backup /etc /srv /var/backups/db --exclude-caches
restic snapshots          # список копий

Copy databases by dumping, not files on the fly: first pg_dump / mysqldump in /var/backups/db, then restic.

Retention policy

restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune

A week of daily copies, a month of weekly copies, and a year of monthly copies are a reasonable start.

Automation

Script /usr/local/bin/backup.sh:

Read more
Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up