1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 04:06:47 +00:00
webvirtcloud/computes/migrations/0007_gstfsd_key.py
catborise 2dab23cd9e fix(gstfsd): only the panel, with the host's key, can change a VM's disk
gstfsd, the root service on each compute that rewrites a shut-off VM's
/etc/shadow and authorized_keys, did what any client on its port asked.
Now it needs GSTFSD_KEY (64 hexadecimal characters, in the unit's
/etc/default/webvirt-gstfsd) and does not start without it. Each
connection gets a new challenge; the panel signs its request for it
with HMAC-SHA256 and gstfsd checks the signature before any change, so
a request recorded on one connection is refused on another. gstfsd
signs its reply for the same challenge and the panel's nonce, and the
panel accepts only that reply.

Each compute has a gstfsd key, the host's GSTFSD_KEY: the compute forms
and the API take it and never show it, and an empty value on an edit
keeps it. The bootstrap script makes the key file once, readable by
root only; the README shows how to make it and where the panel takes
it. The traffic is still not encrypted: a remote panel's port stays
open to the panel's address only.
2026-10-31 01:53:43 +03:00

19 lines
696 B
Python

# Generated by Django 5.2.18 on 2026-10-30 22:36
import computes.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('computes', '0006_login_password_length'),
]
operations = [
migrations.AddField(
model_name='compute',
name='gstfsd_key',
field=models.CharField(blank=True, default='', help_text="GSTFSD_KEY in the host's /etc/default/webvirt-gstfsd: the panel sets the root password and SSH key of a shut-off VM with it; empty: they cannot be set there", max_length=64, validators=[computes.validators.validate_gstfsd_key], verbose_name='gstfsd key'),
),
]