Compare commits

...
8 Commits
36 changed files with 398 additions and 103 deletions
+1
View File
@@ -8,6 +8,7 @@ Der abgenommene MVP liegt auf dem Branch `main`. Der [Produktvertrag](Rust_RMM_I
2. In der [Übergabe](docs/handover.md) den betroffenen Einstiegspunkt finden. Vor Änderungen den tatsächlichen Aufrufer, die Berechtigungsprüfung und die vorhandenen Tests lesen. Ein datierter Beleg in `docs/evidence/` dokumentiert das Ereignis zu seinem Messzeitpunkt.
3. Den normalen Bedienweg und den konkreten Fehlerfall prüfen. Bei einem Linux- oder Windows-spezifischen Verhalten den betreffenden Gast verwenden. Ein Build belegt die Erzeugung des Artefakts. Das Ergebnis des Zielgeräts belegt seine Wirkung.
4. Verändert sich das Produktverhalten, die zuständige Anleitung und den Produktvertrag abgleichen. Eine neue Abnahme im [Prüfstand](docs/mvp-completion-plan.md) mit Quelle, Ziel und beobachtetem Ergebnis nachtragen.
5. Nach jeder abgeschlossenen Änderung die zugehörigen Dateien committen und auf den passenden Branch in Gitea pushen. Das gilt auch für reine Dokuänderungen. Den gepushten Commit in Gitea prüfen. [Entwicklungsablauf](docs/development.md#änderungen-in-gitea-sichern)
## Regeln für Änderungen
+1 -1
View File
@@ -38,6 +38,6 @@ Für administrative Skripte gilt zusätzlich das Plattformrecht `root:execute` o
Die WebUI erzeugt einen kundengebundenen Einmalcode und zeigt die HTTPS-Installationsanleitung für die verfügbare Plattform. Zum Erstbezug braucht das Gerät eine vertrauenswürdige TLS-Verbindung. Der Installer prüft Vertrauensmaterial und Release, richtet die lokalen Dienste ein und nimmt das Gerät auf. Anschließend verwendet die Installation ihre eigene Identität. Der lokale Administrator richtet den privilegierten Skript-Helper ein, wenn das Gerät auch Administratoraufträge erhalten soll. [Serverseitiger Bootstrap](crates/server/src/bootstrap)
Der Server stellt je Kunde und Plattform Agent und Helper mit einem gemeinsam signierten Manifest bereit. Das Manifest bindet die Hashes und Größen der Binärdateien. Für die Erstaufnahme liefert der Server auch den passenden Bootstrap-Updater. Linux x64 verwendet den GNU/Linux-Kanal, Windows x64 offiziell `x86_64-pc-windows-gnu`. Der lokale Updater fragt regelmäßig nach einer neueren veröffentlichten Generation, prüft die Bindung an Plattform, Schlüsselring, Releasefolge und Binärhashes und aktiviert das geprüfte Paar unter derselben Geräteidentität. Auf Linux steuert ein systemd-Timer den Abruf, auf Windows ein eigener Updatedienst.
Der Server stellt je Kunde und Plattform Agent und Helper mit einem gemeinsam signierten Manifest bereit. Das Manifest bindet die Hashes und Größen der Binärdateien. Für die Erstaufnahme liefert der Server auch den passenden Bootstrap-Updater. Das gemeinsame Linux-Installationsskript erkennt x86-64 und ARM64 auf dem Zielgerät. Beide GNU/Linux-Architekturen haben einen eigenen Releasekanal, Signierschlüssel und Bootstrap-Pin. Windows x64 verwendet offiziell `x86_64-pc-windows-gnu`. Der lokale Updater fragt regelmäßig nach einer neueren veröffentlichten Generation, prüft die Bindung an Plattform, Schlüsselring, Releasefolge und Binärhashes und aktiviert das geprüfte Paar unter derselben Geräteidentität. Auf Linux steuert ein systemd-Timer den Abruf, auf Windows ein eigener Updatedienst.
Für Erstinstallation und Update muss das Manifest zum Prüfzeitpunkt gültig sein. Beim bereits installierten Administrator-Helper prüft der Server die Gültigkeit zum gespeicherten Registrierungszeitpunkt des Releases und die Signatur gegen den aktuellen Schlüsselring. Der Ablauf des Manifests allein blockiert daher keinen Adminauftrag auf diesem Client. [Releaseprüfung](crates/server/src/agent_updates.rs) · [Build und Veröffentlichung](docs/development.md)
+1 -1
View File
@@ -103,7 +103,7 @@ impl Observer {
}
self.cached()
.cloned()
.unwrap_or_else(|| Observation::not_configured(Platform::LinuxX64, chrono::Utc::now()))
.unwrap_or_else(|| Observation::not_configured(Platform::NATIVE_LINUX, chrono::Utc::now()))
}
pub fn catalog_record(&self) -> Option<GuardedRecord> {
self.cached()?;
+9 -7
View File
@@ -15,7 +15,7 @@ use rmm_domain::{
};
use rmm_privileged_helper::{Binding, TrustedClock};
use rmm_updater::{
ActiveRelease, Platform as ReleasePlatform, ReleaseRelation, SignedRelease, TrustedContext,
ActiveRelease, ReleaseRelation, SignedRelease, TrustedContext,
TrustedUpdateKey, UpdateKeyring, verify_release,
};
use serde::Deserialize;
@@ -346,12 +346,12 @@ impl Trust {
.try_into()
.map_err(|_| anyhow::anyhow!("UPDATE_CATALOG_KEY_SIZE"))?;
ensure!(
key.platform == Platform::LinuxX64 && key.public_key_hex != binding.public_key_hex,
key.platform == Platform::NATIVE_LINUX && key.public_key_hex != binding.public_key_hex,
"UPDATE_CATALOG_KEY_SEPARATION"
);
trusted.push(TrustedUpdateKey::new(
public,
ReleasePlatform::LinuxX64,
Platform::NATIVE_LINUX.into(),
key.first_sequence,
key.last_sequence,
key.revoked,
@@ -426,7 +426,7 @@ impl Trust {
},
&self.keys,
&TrustedContext {
platform: ReleasePlatform::LinuxX64,
platform: Platform::NATIVE_LINUX.into(),
now_utc_seconds: now,
keyring_generation: self.generation,
protocol_major: self.protocol,
@@ -522,16 +522,18 @@ async fn request(
async fn fetch(client: &reqwest::Client, address: SocketAddr) -> Result<Vec<u8>> {
let response = client
.get(format!(
"https://{}:{}/agent/v1/releases/current?platform=x86_64-unknown-linux-gnu",
"https://{}:{}/agent/v1/releases/current?platform={}",
crate::https_channel::server_name()?,
address.port()
address.port(),
Platform::NATIVE_LINUX.target_triple()
))
.send()
.await?;
crate::https_channel::bounded_body(response, RESPONSE_LIMIT, "application/json").await
}
#[cfg(test)]
// These fixtures provision the legacy x86-64 manual updater profile.
#[cfg(all(test, target_arch = "x86_64"))]
mod tests {
use super::*;
use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD};
+1 -1
View File
@@ -319,7 +319,7 @@ pub fn context(
let scope = match job.action {
rmm_domain::jobs::Action::UpdateAgent { ref update } => {
match update.manifest().map_err(anyhow::Error::msg)?.platform {
update::Platform::LinuxX64 => "linux.base",
update::Platform::LinuxX64 | update::Platform::LinuxArm64 => "linux.base",
update::Platform::WindowsX64 | update::Platform::WindowsGnuX64 => "windows.base",
}
}
+2
View File
@@ -465,6 +465,8 @@ impl<C: reconcile::SyncClock> Agent<C> {
"heartbeat/1".into(),
"agent.update/1".into(),
];
#[cfg(target_arch = "aarch64")]
capabilities.push(rmm_domain::agent_update::LINUX_ARM64_RELEASE_CAPABILITY.into());
if self.binding.is_some() {
capabilities.push("rmm.sync.v1".into());
}
@@ -42,7 +42,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
signature: URL_SAFE_NO_PAD.encode([1_u8; 64]),
};
let transition = match platform {
Platform::LinuxX64 if full => PeerPinTransition::LinuxGeneralFullV1 {
Platform::LinuxX64 | Platform::LinuxArm64 if full => PeerPinTransition::LinuxGeneralFullV1 {
general_pin_sha256: "10".repeat(32),
full: LinuxFullTransition {
schema_version: 1,
@@ -57,7 +57,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
effective_signing_key_id: "17".repeat(32),
},
},
Platform::LinuxX64 => PeerPinTransition::UnchangedGeneralPinV1 {
Platform::LinuxX64 | Platform::LinuxArm64 => PeerPinTransition::UnchangedGeneralPinV1 {
general_pin_sha256: "10".repeat(32),
},
Platform::WindowsX64 | Platform::WindowsGnuX64 => PeerPinTransition::WindowsCodePairV1 {
@@ -110,7 +110,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
update: Box::new(update),
},
execution_identity: match platform {
Platform::LinuxX64 => "root",
Platform::LinuxX64 | Platform::LinuxArm64 => "root",
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
}
.into(),
+24 -1
View File
@@ -50,11 +50,34 @@ impl UpdateKeyringFile {
pub enum Platform {
#[serde(rename = "x86_64-unknown-linux-gnu")]
LinuxX64,
#[serde(rename = "aarch64-unknown-linux-gnu")]
LinuxArm64,
#[serde(rename = "x86_64-pc-windows-msvc")]
WindowsX64,
#[serde(rename = "x86_64-pc-windows-gnu")]
WindowsGnuX64,
}
pub const LINUX_ARM64_RELEASE_CAPABILITY: &str = "agent.release.linux.arm64/1";
impl Platform {
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
pub const NATIVE_LINUX: Self = Self::LinuxArm64;
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
pub const NATIVE_LINUX: Self = Self::LinuxX64;
pub const fn is_linux(self) -> bool {
matches!(self, Self::LinuxX64 | Self::LinuxArm64)
}
pub const fn target_triple(self) -> &'static str {
match self {
Self::LinuxX64 => "x86_64-unknown-linux-gnu",
Self::LinuxArm64 => "aarch64-unknown-linux-gnu",
Self::WindowsX64 => "x86_64-pc-windows-msvc",
Self::WindowsGnuX64 => "x86_64-pc-windows-gnu",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ArtifactRole {
@@ -708,7 +731,7 @@ impl ResolvedAgentUpdate {
}
pub fn execution_identity(&self) -> Option<&'static str> {
self.manifest().ok().map(|m| match m.platform {
Platform::LinuxX64 => "root",
Platform::LinuxX64 | Platform::LinuxArm64 => "root",
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
})
}
+1 -1
View File
@@ -75,7 +75,7 @@ pub fn validate_for_scope(
.map_err(|_| "INVALID_AGENT_UPDATE_OBSERVATION")?
!= update
|| !typed.agent_update.validate()
|| (typed.agent_update.platform == crate::agent_update::Platform::LinuxX64) != (scope == "linux.base")
|| typed.agent_update.platform.is_linux() != (scope == "linux.base")
|| typed.agent_update.observed_at - now > chrono::Duration::seconds(45)
|| now - typed.agent_update.observed_at > chrono::Duration::hours(72)
{
@@ -110,7 +110,7 @@ pub fn observe_record(
&& response.ledger_inode != 0
&& response.lock_inode != 0
&& response.observation.validate()
&& response.observation.platform == Platform::LinuxX64,
&& response.observation.platform == Platform::NATIVE_LINUX,
"UPDATE_OBSERVER_RESPONSE_BINDING"
);
let record = rmm_domain::agent_update_provisioning::InstalledReleaseRecord::from_bytes(
@@ -346,7 +346,7 @@ pub fn collect(db: &Connection, local: Local<'_>, request: &Request) -> Result<R
));
let observation = AgentUpdateObservation {
schema_version: 1,
platform: Platform::LinuxX64,
platform: Platform::NATIVE_LINUX,
observed_at,
quality: ObservationQuality::Valid,
predecessor: Some(trust.predecessor().clone()),
+1 -1
View File
@@ -418,7 +418,7 @@ async fn issue(
&& snapshot.sha256 == hex::decode(hash(&snapshot.data)).map_err(|_| denied())?,
)?;
let scope = match action.manifest().map_err(|_| denied())?.platform {
update::Platform::LinuxX64 => "linux.base",
update::Platform::LinuxX64 | update::Platform::LinuxArm64 => "linux.base",
update::Platform::WindowsX64 | update::Platform::WindowsGnuX64 => "windows.base",
};
// Health requires a fresh real base inventory of the restarted platform;
+20 -27
View File
@@ -17,7 +17,7 @@ use axum::{
use chrono::{DateTime, Utc};
use futures_util::StreamExt;
use rmm_domain::{
agent_update::{ArtifactDescriptor, Platform, ReleaseEnvelope, ReleaseManifest},
agent_update::{ArtifactDescriptor, LINUX_ARM64_RELEASE_CAPABILITY, Platform, ReleaseEnvelope, ReleaseManifest},
jobs::{ArtifactReference, encode, hash},
};
use serde::Deserialize;
@@ -42,11 +42,7 @@ fn invalid() -> Error {
Error(StatusCode::BAD_REQUEST, "INVALID_AGENT_RELEASE")
}
pub fn platform_name(platform: Platform) -> &'static str {
match platform {
Platform::LinuxX64 => "x86_64-unknown-linux-gnu",
Platform::WindowsX64 => "x86_64-pc-windows-msvc",
Platform::WindowsGnuX64 => "x86_64-pc-windows-gnu",
}
platform.target_triple()
}
pub fn protected_file(path: &FsPath, maximum: u64) -> Result<Vec<u8>, Error> {
let key_path =
@@ -139,13 +135,6 @@ pub fn store() -> Result<UpdateArtifacts, Error> {
metadata.uid(),
)?)
}
fn verifier_platform(platform: Platform) -> rmm_updater::Platform {
match platform {
Platform::LinuxX64 => rmm_updater::Platform::LinuxX64,
Platform::WindowsX64 => rmm_updater::Platform::WindowsX64,
Platform::WindowsGnuX64 => rmm_updater::Platform::WindowsGnuX64,
}
}
/// Network input can choose only among statically named protected
/// configuration slots. It never supplies a path or introduces update trust.
fn keyring_path_with(
@@ -154,6 +143,7 @@ fn keyring_path_with(
) -> Result<std::path::PathBuf, Error> {
let name = match platform {
Platform::LinuxX64 => "RMM_AGENT_UPDATE_LINUX_KEYRING_FILE",
Platform::LinuxArm64 => "RMM_AGENT_UPDATE_LINUX_ARM64_KEYRING_FILE",
Platform::WindowsX64 => "RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE",
Platform::WindowsGnuX64 => {
// The shared device gateway and both management APIs must select the same
@@ -177,7 +167,7 @@ fn keyring_path_with(
}
// Exact legacy compatibility only when the platform-specific slot is
// absent. An invalid explicit slot must never silently choose other trust.
if platform == Platform::WindowsGnuX64 {
if matches!(platform, Platform::LinuxArm64 | Platform::WindowsGnuX64) {
return Err(fail("AGENT_UPDATE_NOT_CONFIGURED"));
}
lookup("RMM_AGENT_UPDATE_KEYRING_FILE")?
@@ -239,7 +229,7 @@ fn verify_envelope_with_keyring(
rmm_updater::TrustedUpdateKey::new(
raw.try_into()
.map_err(|_| fail("AGENT_UPDATE_TRUST_INVALID"))?,
verifier_platform(key.platform),
key.platform.into(),
key.first_sequence,
key.last_sequence,
key.revoked,
@@ -250,7 +240,7 @@ fn verify_envelope_with_keyring(
let keyring = rmm_updater::UpdateKeyring::new(config.generation, keys)
.map_err(|_| fail("AGENT_UPDATE_TRUST_INVALID"))?;
let context = rmm_updater::TrustedContext {
platform: verifier_platform(decoded.manifest.platform),
platform: decoded.manifest.platform.into(),
now_utc_seconds,
keyring_generation: config.generation,
protocol_major: 1,
@@ -658,18 +648,21 @@ async fn check_device_platform(
.fetch_one(&mut **tx)
.await?;
let caps: Vec<String> = serde_json::from_value(caps)?;
let expected = match platform {
Platform::LinuxX64 => "linux.base/1",
Platform::WindowsX64 if caps.iter().any(|c| c == "agent.release.windows.gnu/1") => {
return Err(missing());
}
Platform::WindowsX64 => "windows.base/1",
Platform::WindowsGnuX64 => "agent.release.windows.gnu/1",
};
if !caps.iter().any(|c| c == expected) {
return Err(missing());
if device_supports_release(platform, &caps) {
Ok(())
} else {
Err(missing())
}
}
fn device_supports_release(platform: Platform, caps: &[String]) -> bool {
let has = |expected: &str| caps.iter().any(|capability| capability == expected);
match platform {
Platform::LinuxX64 => has("linux.base/1") && !has(LINUX_ARM64_RELEASE_CAPABILITY),
Platform::LinuxArm64 => has("linux.base/1") && has(LINUX_ARM64_RELEASE_CAPABILITY),
Platform::WindowsX64 => has("windows.base/1") && !has("agent.release.windows.gnu/1"),
Platform::WindowsGnuX64 => has("agent.release.windows.gnu/1"),
}
Ok(())
}
/// A published release grants access to its two fixed binaries for authenticated
+1 -1
View File
@@ -1,5 +1,5 @@
#!/bin/sh
# Usage: sudo sh linux.sh https://bootstrap.example [--enable-admin-scripts]
# Linux x86-64 / ARM64. Usage: sudo sh linux.sh https://bootstrap.example [--enable-admin-scripts]
set -eu
umask 077
file=$(mktemp)
+21 -7
View File
@@ -32,7 +32,6 @@ TIMER = 'rmm-discovery-update.timer'
HELPER = 'rmm-discovery-managed-script-helper.service'
HELPER_SOCKET = Path('/run/rmm-discovery-script-helper/control.sock')
OLD_HELPER_CONFIG = Path('/etc/rmm-discovery-managed-scripts')
PLATFORM = 'x86_64-unknown-linux-gnu'
MAX_BINARY = 256 * 1024 * 1024
UNIT_DIR = Path('/etc/systemd/system')
@@ -42,6 +41,13 @@ def require(condition, message):
raise ValueError(message)
def release_platform():
machine = platform.machine()
require(platform.system() == 'Linux' and machine in ('x86_64', 'aarch64'),
'Linux x86-64 or ARM64 required')
return machine + '-unknown-linux-gnu'
def origin(value):
parsed = urlsplit(value)
require(parsed.scheme == 'https' and parsed.hostname and parsed.username is None
@@ -151,7 +157,9 @@ def pair(folder, doc, source, updater):
manifest = doc['manifest']
release_id = canonical_id(manifest['release_id'])
prefix = '/agent/v1/bootstrap/releases' if source else '/agent/v1/releases'
suffix = '?platform=' + PLATFORM if source else ''
target = release_platform()
require(manifest['platform'] == target, 'release architecture differs from this device')
suffix = '?platform=' + target if source else ''
save(folder / 'envelope.json', doc['release_envelope'])
for artifact, role in zip(manifest['artifacts'], ('agent', 'helper'), strict=True):
require(artifact['role'] == role, 'incorrect artifact role')
@@ -186,7 +194,12 @@ def installed():
def healthy(version, baseline, duration=90, pin=None):
until = time.monotonic() + duration
started = time.time()
certificate_pointer = STATE / 'certificates/current.json'
while time.monotonic() < until:
# The agent writes this pointer after obtaining its first device certificate.
if not certificate_pointer.is_file():
time.sleep(2)
continue
try:
record = installed()
contact = record.get('last_contact_at')
@@ -481,7 +494,7 @@ def save_token(base, token, gid):
def install(base, token_file, enable_admin_scripts=False):
require(platform.machine() == 'x86_64', 'Linux x86-64 required')
target = release_platform()
base = origin(base)
if ROOT.exists():
config = read(ROOT / 'config.json')
@@ -491,7 +504,7 @@ def install(base, token_file, enable_admin_scripts=False):
token = enrollment_token(token_file)
with tempfile.TemporaryDirectory() as work:
metadata = Path(work) / 'bootstrap.json'
remote((base, token), '/agent/v1/bootstrap/current?platform=' + PLATFORM, metadata)
remote((base, token), '/agent/v1/bootstrap/current?platform=' + target, metadata)
require(read(metadata)['tenant_id'] == config['tenant'], 'different enrollment tenant')
save_token(ROOT, token, pwd.getpwnam('rmm-discovery').pw_gid)
# An operator rerunning the HTTPS installer can update the lifecycle
@@ -524,7 +537,7 @@ def install(base, token_file, enable_admin_scripts=False):
with tempfile.TemporaryDirectory(prefix='.rmm-', dir=ROOT.parent) as work:
staging = Path(work) / 'installation'
staging.mkdir()
remote((base, token), '/agent/v1/bootstrap/current?platform=' + PLATFORM, staging / 'bootstrap.json')
remote((base, token), '/agent/v1/bootstrap/current?platform=' + target, staging / 'bootstrap.json')
doc = read(staging / 'bootstrap.json')
require(doc['schema_version'] == 1, 'unknown bootstrap profile')
save(staging / 'keyring.json', doc['keyring'])
@@ -532,7 +545,7 @@ def install(base, token_file, enable_admin_scripts=False):
save(staging / 'config.json', {'bootstrap': base, 'gateway': origin(doc['gateway_origin']),
'tenant': canonical_id(doc['tenant_id'])})
updater = staging / 'updater'
remote((base, token), '/agent/v1/bootstrap/updater?platform=' + PLATFORM + '&sha256=' + doc['updater']['sha256'], updater, doc['updater'])
remote((base, token), '/agent/v1/bootstrap/updater?platform=' + target + '&sha256=' + doc['updater']['sha256'], updater, doc['updater'])
updater.chmod(0o755)
releases = staging / 'releases'
releases.mkdir()
@@ -599,6 +612,7 @@ def revert(intent, report_failure=True):
def update():
target = release_platform()
with (ROOT / 'release.lock').open('rb') as lock:
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
pending = ROOT / 'pending.json'
@@ -608,7 +622,7 @@ def update():
with tempfile.TemporaryDirectory(prefix='.incoming-', dir=ROOT / 'releases') as work:
staging = Path(work) / 'generation'
staging.mkdir()
remote(None, '/agent/v1/releases/current?platform=' + PLATFORM, staging / 'current.json')
remote(None, '/agent/v1/releases/current?platform=' + target, staging / 'current.json')
response = read(staging / 'current.json')
if response['status'] == 'not_configured':
return
+1
View File
@@ -31,6 +31,7 @@ fn official_windows(platform: Platform) -> bool {
async fn config(s: &crate::State, platform: Platform, tenant: Uuid, wanted: Option<&str>) -> Result<Config, Error> {
let slot = match platform {
Platform::LinuxX64 => "RMM_AGENT_BOOTSTRAP_LINUX_FILE",
Platform::LinuxArm64 => "RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE",
Platform::WindowsX64 => "RMM_AGENT_BOOTSTRAP_WINDOWS_FILE",
Platform::WindowsGnuX64 => "RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE",
};
+4 -1
View File
@@ -14,7 +14,9 @@ pub(super) async fn publish_missing(
tx: &mut Transaction<'_, Postgres>,
tenant: Uuid,
) -> Result<(), Error> {
let Some(slot) = std::env::var_os("RMM_AGENT_BOOTSTRAP_LINUX_FILE") else {
let Some(slot) = std::env::var_os("RMM_AGENT_BOOTSTRAP_LINUX_FILE")
.or_else(|| std::env::var_os("RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE"))
else {
return Ok(());
};
let Some(config_dir) = FsPath::new(&slot).parent() else {
@@ -29,6 +31,7 @@ pub(super) async fn publish_missing(
}
for platform in [
Platform::LinuxX64,
Platform::LinuxArm64,
Platform::WindowsGnuX64,
Platform::WindowsX64,
] {
+5 -2
View File
@@ -3,7 +3,7 @@
use crate::{jobs::Error, root_policy::RootScope, windows_policy::SystemScope};
use axum::http::StatusCode;
use rmm_domain::{
agent_update::{ArtifactRole, Platform, ReleaseManifest, digest},
agent_update::{ArtifactRole, LINUX_ARM64_RELEASE_CAPABILITY, Platform, ReleaseManifest, digest},
jobs::{Action, FULL_MAINTENANCE_CAPABILITY, JobPayload},
};
use serde::Deserialize;
@@ -60,7 +60,7 @@ impl ReleaseAnchor {
};
let field = |name: &str, value: &str| format!(r#""{name}":"{value}""#);
match manifest.platform {
Platform::LinuxX64 => replace(
Platform::LinuxX64 | Platform::LinuxArm64 => replace(
field("helper_binary_sha256", &self.helper_sha256),
field("helper_binary_sha256", next(ArtifactRole::Helper)?),
1,
@@ -164,6 +164,9 @@ fn check_pair(
caps: &[String],
) -> Result<(), Error> {
let platform = match identity {
"root" if caps.iter().any(|cap| cap == LINUX_ARM64_RELEASE_CAPABILITY) => {
Platform::LinuxArm64
}
"root" => Platform::LinuxX64,
"system" => Platform::WindowsGnuX64,
_ => return Err(binding_error()),
+3 -11
View File
@@ -218,11 +218,7 @@ fn current_keyring(file: &UpdateKeyringFile) -> Result<UpdateKeyring> {
.map_err(|_| anyhow::anyhow!("UPDATE_HISTORY_KEY_SIZE"))?;
keys.push(TrustedUpdateKey::new(
public,
match key.platform {
Platform::LinuxX64 => ReleasePlatform::LinuxX64,
Platform::WindowsX64 => ReleasePlatform::WindowsX64,
Platform::WindowsGnuX64 => ReleasePlatform::WindowsGnuX64,
},
key.platform.into(),
key.first_sequence,
key.last_sequence,
key.revoked,
@@ -307,11 +303,7 @@ fn verify_record_release(
.release_envelope
.decode()
.map_err(anyhow::Error::msg)?;
let platform = match record.platform {
Platform::LinuxX64 => ReleasePlatform::LinuxX64,
Platform::WindowsX64 => ReleasePlatform::WindowsX64,
Platform::WindowsGnuX64 => ReleasePlatform::WindowsGnuX64,
};
let platform = ReleasePlatform::from(record.platform);
let envelope: &ReleaseEnvelope = &record.release_envelope;
verify_release(
SignedRelease {
@@ -403,7 +395,7 @@ fn verify_update(
ensure!(
job.execution_identity
== match record.platform {
Platform::LinuxX64 => "root",
Platform::LinuxX64 | Platform::LinuxArm64 => "root",
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
}
&& update.release_envelope == record.release_envelope
+1 -1
View File
@@ -45,7 +45,7 @@ mod linux {
let args: Vec<_> = std::env::args_os().skip(1).collect();
if args.first().is_some_and(|arg| arg == "--verify-bootstrap") {
let release =
rmm_updater::verify_bootstrap_files(rmm_updater::Platform::LinuxX64, &args[1..])?;
rmm_updater::verify_bootstrap_files(rmm_domain::agent_update::Platform::NATIVE_LINUX.into(), &args[1..])?;
println!("{}", serde_json::to_string(release.manifest())?);
return Ok(());
}
+2 -7
View File
@@ -4,7 +4,7 @@ use crate::{
VerifiedRelease,
};
use anyhow::{Context, Result, ensure};
use rmm_domain::agent_update::{Platform as WirePlatform, ReleaseEnvelope, UpdateKeyringFile};
use rmm_domain::agent_update::{ReleaseEnvelope, UpdateKeyringFile};
use std::{
ffi::OsString,
fs::File,
@@ -31,18 +31,13 @@ pub fn verify_bootstrap_files(platform: Platform, args: &[OsString]) -> Result<V
.keys
.into_iter()
.map(|key| {
let platform = match key.platform {
WirePlatform::LinuxX64 => Platform::LinuxX64,
WirePlatform::WindowsX64 => Platform::WindowsX64,
WirePlatform::WindowsGnuX64 => Platform::WindowsGnuX64,
};
let raw = hex::decode(key.public_key_hex)?
.try_into()
.ok()
.context("Ed25519 public key length")?;
TrustedUpdateKey::new(
raw,
platform,
key.platform.into(),
key.first_sequence,
key.last_sequence,
key.revoked,
+14
View File
@@ -16,12 +16,26 @@ pub const RELEASE_SIGNATURE_DOMAIN: &[u8] = b"rmm.agent-release.v1\0";
pub enum Platform {
#[serde(rename = "x86_64-unknown-linux-gnu")]
LinuxX64,
#[serde(rename = "aarch64-unknown-linux-gnu")]
LinuxArm64,
#[serde(rename = "x86_64-pc-windows-msvc")]
WindowsX64,
#[serde(rename = "x86_64-pc-windows-gnu")]
WindowsGnuX64,
}
impl From<rmm_domain::agent_update::Platform> for Platform {
fn from(platform: rmm_domain::agent_update::Platform) -> Self {
use rmm_domain::agent_update::Platform as WirePlatform;
match platform {
WirePlatform::LinuxX64 => Self::LinuxX64,
WirePlatform::LinuxArm64 => Self::LinuxArm64,
WirePlatform::WindowsX64 => Self::WindowsX64,
WirePlatform::WindowsGnuX64 => Self::WindowsGnuX64,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ArtifactRole {
+28 -2
View File
@@ -66,11 +66,18 @@ fn manifest() -> ReleaseManifest {
}
fn verify_bytes(payload: &[u8], context: &TrustedContext) -> anyhow::Result<VerifiedRelease> {
verify_bytes_with_key(payload, context, key(false, 1, 20))
}
fn verify_bytes_with_key(
payload: &[u8],
context: &TrustedContext,
pinned: TrustedUpdateKey,
) -> anyhow::Result<VerifiedRelease> {
let signer = SigningKey::from_bytes(&[41; 32]);
let mut message = RELEASE_SIGNATURE_DOMAIN.to_vec();
message.extend_from_slice(payload);
let signature = signer.sign(&message).to_bytes();
let pinned = key(false, 1, 20);
let key_id = pinned.key_id().to_owned();
verify_release(
SignedRelease {
@@ -166,7 +173,7 @@ fn signed_noncanonical_unknown_duplicate_and_oversize_payloads_are_rejected() {
payload.replacen("{", "{\"schema_version\":1,", 1),
payload.replacen("\"bytes\":11", "\"bytes\":11,\"path\":\"/etc/passwd\"", 1),
payload.replacen("\"release_sequence\":4", "\"release_sequence\":4.0", 1),
payload.replacen("x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", 1),
payload.replacen("x86_64-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu", 1),
] {
assert!(verify_bytes(changed.as_bytes(), &context()).is_err());
}
@@ -174,6 +181,25 @@ fn signed_noncanonical_unknown_duplicate_and_oversize_payloads_are_rejected() {
assert!(verify_bytes(b"", &context()).is_err());
}
#[test]
fn arm64_release_requires_arm64_context_and_key() {
let mut target = manifest();
target.platform = Platform::LinuxArm64;
let mut context = context();
assert!(verify(&target, &context).is_err());
context.platform = Platform::LinuxArm64;
assert!(verify(&target, &context).is_err());
let arm64_key = TrustedUpdateKey::new(
SigningKey::from_bytes(&[41; 32]).verifying_key().to_bytes(),
Platform::LinuxArm64,
1,
20,
false,
).unwrap();
let payload = serde_json::to_vec(&target).unwrap();
assert!(verify_bytes_with_key(&payload, &context, arm64_key).is_ok());
}
#[test]
fn incompatible_clock_platform_state_protocol_and_trust_contexts_are_rejected() {
let mut ctx = context();
+2
View File
@@ -21,9 +21,11 @@ services:
RMM_BOOTSTRAP_ORIGIN: https://discovery.ease-technologies.de:8443
RMM_AGENT_UPDATE_ARTIFACT_DIR: /release-objects
RMM_AGENT_UPDATE_LINUX_KEYRING_FILE: /release-config/linux-keyring.json
RMM_AGENT_UPDATE_LINUX_ARM64_KEYRING_FILE: /release-config/linux-arm64-keyring.json
RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE: /release-config/windows-keyring.json
RMM_AGENT_UPDATE_WINDOWS_GNU_OFFICIAL_KEYRING_FILE: /release-config/windows-gnu-official-keyring.json
RMM_AGENT_BOOTSTRAP_LINUX_FILE: /release-config/linux-bootstrap.json
RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE: /release-config/linux-arm64-bootstrap.json
RMM_AGENT_BOOTSTRAP_WINDOWS_FILE: /release-config/windows-bootstrap.json
RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE: /release-config/windows-gnu-official-bootstrap.json
ports: ["127.0.0.1:18445:18443"]
+2
View File
@@ -1,8 +1,10 @@
x-release-environment: &release-environment
RMM_AGENT_UPDATE_ARTIFACT_DIR: /release-objects
RMM_AGENT_UPDATE_LINUX_KEYRING_FILE: /release-config/linux-keyring.json
RMM_AGENT_UPDATE_LINUX_ARM64_KEYRING_FILE: /release-config/linux-arm64-keyring.json
RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE: /release-config/windows-keyring.json
RMM_AGENT_BOOTSTRAP_LINUX_FILE: /release-config/linux-bootstrap.json
RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE: /release-config/linux-arm64-bootstrap.json
RMM_AGENT_BOOTSTRAP_WINDOWS_FILE: /release-config/windows-bootstrap.json
RMM_AGENT_UPDATE_WINDOWS_GNU_OFFICIAL_KEYRING_FILE: /release-config/windows-gnu-official-keyring.json
RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE: /release-config/windows-gnu-official-bootstrap.json
+21 -2
View File
@@ -1,15 +1,22 @@
# Entwickeln, bauen und ausliefern
## Änderungen in Gitea sichern
Nach jeder abgeschlossenen Änderung die geprüften Dateien committen und den Commit auf den zugehörigen Gitea-Branch pushen. Das gilt für Code, Konfiguration und Dokumentation. Bei einem neuen Arbeitsbranch `git push -u origin HEAD` verwenden. Danach prüfen, dass der Commit auf dem Zielbranch in Gitea liegt.
## Quellen bauen
Der Buildrunner verpackt die Quellen eines eingecheckten Git-Stands und baut mit den gepinnten Docker-Buildern. Die folgenden Befehle laufen vom Wurzelverzeichnis des Repositorys. `REVISION` durch den zu liefernden Commit ersetzen. Vor dem ersten Frontendbuild `npm --prefix web ci` ausführen. Für den Rust-Build werden Python 3, Git, Docker, tar, rsync und die zum Ziel passenden lokalen Builder-Images benötigt. [Buildrunner](../tools/build.py)
| Ziel | Befehl | Ergebnis |
| --- | --- | --- |
| Linux-Client x86-64 | `python3 tools/build.py linux-x64 --ref REVISION` | `rmm-agent`, `rmm-privileged-helper`, `rmm-agent-updater` |
| Linux-Client ARM64 | `python3 tools/build.py linux-arm64 --ssh --ref REVISION` | `rmm-agent`, `rmm-privileged-helper`, `rmm-agent-updater` für AArch64 |
| Offizieller Windows-Client x64 | `python3 tools/build.py windows-gnu-x64 --ref REVISION` | `rmm-agent-windows.exe`, `rmm-helper-windows.exe`, `rmm-updater-windows.exe` für GNU |
| Server auf dem dedizierten ARM64-Host | `python3 tools/build.py server-arm64 --ssh --ref REVISION` | Server und Linux-Zeitbroker im Remote-Buildbereich |
| WebUI | `npm --prefix web run build` | TypeScript-Prüfung und Bundle in `web/dist/` |
`--plan` zeigt den Rust-Build einschließlich Quellenrevision und Ziel an. Der Runner verwendet je Ziel einen gemeinsamen Cargo-Cache, lädt bei Bedarf die gesperrten Abhängigkeiten und kompiliert offline. Er meldet den konkreten Ausgabeordner. Lokal liegt er unter `devstate/build/<Ziel>/artifacts/<Commit>/<Manifesthash>/`, beim SSH-Build unter `~/rmm-dev-build/server-arm64/artifacts/` auf dem Server. Die Buildquittung `manifest.json` bindet Ziel, Git-Revision, Builder und Binärhashes.
`--plan` zeigt den Rust-Build einschließlich Quellenrevision und Ziel an. Der Runner verwendet je Ziel einen gemeinsamen Cargo-Cache, lädt bei Bedarf die gesperrten Abhängigkeiten und kompiliert offline. Er meldet den konkreten Ausgabeordner. Lokal liegt er unter `devstate/build/<Ziel>/artifacts/<Commit>/<Manifesthash>/`, beim SSH-Build unter `~/rmm-dev-build/<Ziel>/artifacts/` auf dem Server. Die Buildquittung `manifest.json` bindet Ziel, Git-Revision, Builder und Binärhashes.
## Entwicklungsserver und WebUI aktualisieren
@@ -45,7 +52,7 @@ python3 tools/dev_agent_release.py --official-windows \
--minimum-updater-version 2 --prepare-only
```
Für Linux gilt derselbe Ablauf mit dem Linux-Buildordner und ohne `--official-windows`. Die Mindestversion entsprechend der vom Paket benötigten Updaterfähigkeit setzen. Der offizielle Windows-Kanal nutzt einen eigenen Signierschlüssel. Private Signierschlüssel verbleiben auf dem Signierhost.
Für Linux gilt derselbe Ablauf mit dem Linux-Buildordner und ohne `--official-windows`. Die Mindestversion entsprechend der vom Paket benötigten Updaterfähigkeit setzen. Der offizielle Windows-Kanal nutzt einen eigenen Signierschlüssel. Linux x86-64 und ARM64 haben ebenfalls getrennte Signierschlüssel, Starter und Updater-Pins. Private Signierschlüssel verbleiben auf dem Signierhost.
Für die Erstaufnahme in neuen Kundenkatalogen kann der Betreiber einen veröffentlichten Release als Starter auswählen. Die Quelle wird anhand ihrer Kunden-, Plattform- und Release-ID geprüft. Bereits befüllte Kataloge werden je Kunde gepflegt. [Starter veröffentlichen](../tools/dev_customer_starters.py)
@@ -54,8 +61,20 @@ python3 tools/dev_customer_starters.py --tenant "$TENANT_ID" \
--platform x86_64-pc-windows-gnu --official-windows --release "$RELEASE_ID"
```
Für ARM64 beim Starter `--platform aarch64-unknown-linux-gnu` verwenden und `--official-windows` weglassen. Die beiden Release-Overlays für den Server und die öffentliche API binden den ARM64-Schlüsselring und den Bootstrap-Pin ein.
Ein neuer stabiler Updater benötigt eine eigene Rotation des Bootstrap-Hashes. `--rotate-worker-only --rotate-bootstrap-from SHA256` bindet die Umstellung im Zielkunden an den bisherigen Hash. Für den gezielten lokalen Austausch des stabilen Windows-Updaters im Entwicklungsbetrieb prüft der PowerShell-Operator beide Hashes, die Geräteidentität und die installierten Releasepaare. [Releasewerkzeuge](../tools/agent_release.py) · [Windows-Updater austauschen](../deploy/windows/Replace-DevelopmentReleaseUpdater.ps1)
## Linux-Gerät per HTTPS aufnehmen
Unter **Verwaltung → Geräteaufnahme** den Kunden wählen und einen Einmalcode erstellen. Den gemeinsamen Linux-Befehl auf dem Zielgerät ausführen. `linux.sh` erkennt `x86_64` und `aarch64` und wählt den passenden signierten Agenten, Helper und Updater.
```sh
curl --fail --show-error --silent 'https://discovery.ease-technologies.de:8443/install/linux.sh' -o linux.sh && sudo sh linux.sh 'https://discovery.ease-technologies.de:8443' --enable-admin-scripts
```
Den Einmalcode auf Nachfrage eingeben. Bei direkter Root-Anmeldung entfällt `sudo`. `--enable-admin-scripts` aktiviert den lokalen Skript-Helper. Zusätzliche zentrale Geräterechte und die WebUI-Genehmigung gelten pro Auftrag.
## Ergebnis prüfen
Die folgenden Rust-Tests laufen lokal mit Testidentitäten. Die Transporttests starten einen TLS-Server auf Loopback.
@@ -0,0 +1,40 @@
{
"date": "2026-11-18",
"host": "otrs.ease-technologies.de",
"reported_startup_traceback": "FileNotFoundError: /var/lib/rmm-discovery/certificates/current.json",
"before_correction": {
"device_certificate_present": true,
"identity_present": true,
"installer_token_file_removed": true,
"agent_active": true,
"update_timer_active": true,
"update_service_last_result": "success",
"authenticated_contact_at": "2026-11-18T17:08:51.835840Z",
"connection_generation": 1
},
"deployment": {
"revision": "4b3d0136e93e9b6d1de2ddaf3aae2cdade0dbb85",
"server_sha256": "e1001b2d82e7cde249cfbdfe1b559a8f33369fa78a49eb894dbc781a8e0c563d",
"web_index_sha256": "7486a20e0e570c8059d75be7b847ee35a39680d7bfa93498a8a9d26e6e3c4f87",
"image": "sha256:09a5dfb6750dce24f838f393b592bd41ceff22592710df9c308d6909faac49b6",
"api_health": "ok",
"gateway_health": "ok"
},
"native_retest": {
"version": "0.1.0-arm64.1",
"architecture": "aarch64-unknown-linux-gnu",
"last_authenticated_contact": "2026-11-18T17:12:57.212990Z",
"connection_generation": 2,
"identity_preserved": true,
"agent_process_preserved": true,
"update_timer_active": true,
"arm64_release_check": "available",
"installer_without_traceback": true,
"installer_without_new_code": true,
"wait_for_missing_certificate_native_probe": true,
"previous_lifecycle_sha256": "70fdfc00dc2126df6b6d6fc58fc0d727fa573f9838e703695c63dda126228e3d",
"new_lifecycle_sha256": "552a4ab7fb69b6c2f4a89b01145e866e53d2ae3f61c0db9536fe0b5d355d260c",
"public_installer_sha256": "09e1aef51362e2de9e6ce40721acc17df3cace0a9da01560c1ada0c5e1b906a2"
},
"linux_installer_regressions_passed": 15
}
@@ -0,0 +1,82 @@
{
"date": "2026-11-18",
"native_host": "otrs.ease-technologies.de",
"source": {
"client_revision": "247646a2ba74abe4f2d42a2c712e3d3166fd2187",
"server_revision": "6d15f1b3f524c11923ec1a5daba1c1903ff63a27",
"build_receipt_sha256": "35ee5c49744970e140f3e3156980e7dca950eb88a3346e92b8e497fe16265df7",
"maximum_required_glibc": "2.34"
},
"deployment": {
"database_schema": 40,
"server_sha256": "5681a387a1cdfe459185106e9bdf61c47103472a9051db4396262721d9d0a7eb",
"public_web_index_sha256": "7486a20e0e570c8059d75be7b847ee35a39680d7bfa93498a8a9d26e6e3c4f87",
"api_and_gateway_health": "ok",
"manifest_sha256": "d0f548d0d0a0c0e29e706089d958928d8e48cea29e61e52637be01938dd5df45",
"arm64_customer_starter_published": true,
"existing_devices_after_deploy": [
{
"platform": "linux-x86-64",
"version": "0.1.0-mvp.7",
"authenticated_contact_at": "2026-11-18T17:05:50.996252Z"
},
{
"platform": "windows-x64",
"version": "0.1.17",
"authenticated_contact_at": "2026-11-18T17:05:33.93606Z"
}
]
},
"public_https_native_probe": {
"machine": "aarch64",
"os": "Ubuntu 22.04.5 LTS",
"glibc": "glibc 2.35",
"origin": "https://discovery.ease-technologies.de:8443",
"installer_sha256": "f22a93fb33021f49ed9d9e56b89d040751c9505313611c73fd1490b1d0618c61",
"tenant_id": "11111111-1111-4111-8111-111111111111",
"release_id": "8f9c1558-a9b6-4338-84a7-4cd376201879",
"sequence": 1,
"version": "0.1.0-arm64.1",
"platform": "aarch64-unknown-linux-gnu",
"artifacts": [
{
"artifact_id": "2b8efd81-ed48-5d13-92b0-b5e0fdca49ac",
"bytes": 14786512,
"role": "agent",
"sha256": "67fac33df92bf88223c57d2c641518ce35fd7706f8d5031975b2227ad258c869"
},
{
"artifact_id": "bb4e1fb2-02fa-561c-993c-5c4792493a9a",
"bytes": 13055264,
"role": "helper",
"sha256": "8f64e88b11be8298fc216ccf827787a690419c9e9ebd948a9bd476f7a47dd5b6"
}
],
"updater": {
"bytes": 8755912,
"sha256": "3a3c272c59fd59ee8b994288372531f9bfb92b7174e31f71bd107542ec044934"
},
"published_platforms": [
"aarch64-unknown-linux-gnu",
"x86_64-pc-windows-gnu",
"x86_64-unknown-linux-gnu"
],
"x86_64_version": "0.1.0-mvp.7",
"native_checks": {
"installer_shell_syntax": true,
"invalid_code_stopped_before_install": true,
"manifest_and_pair_signature": true,
"modified_agent_rejected": true,
"wrong_platform_artifact_http_status": 404,
"missing_code_http_status": 401,
"enrollment_performed": false,
"all_three_elf_images_started_with_help": true
}
},
"passed_tests": {
"linux_installer": 13,
"release_contract_native_arm64": 10,
"webui_unit": 78,
"webui_enrollment_chromium": 1
}
}
+1 -1
View File
@@ -29,7 +29,7 @@ Alle acht Versuche lieferten Exitcode 0. Bei beiden Neustarts wurde die Wiederan
| Öffentliche Verwaltung und Kundengrenzen | HTTPS-WebUI mit Passwort/TOTP, MCP mit widerrufbarem Token. Gerätebestand, Historie, eingeschränkter und kundenübergreifender Zugriff sowie Widerruf sind geprüft. [Öffentlicher Zugang](evidence/public-access-20261117.json) · [Kunden und Geräte](evidence/customer-fleet-20261117.json) |
| Gerätetyp in der Übersicht | Spalte „Type“ nach „Hostname“ mit `physical`, `virtual` und `hypervisor`. Erkannte Proxmox-VE-Hosts zeigen `Proxmox VE` als OS. Am 18. November wurde `c599baa` auf dem öffentlichen Server aktiviert. Der Serverrunner bestätigte API, Gateway und öffentlichen API-Dienst mit Binärhash `4f9c8c60…`. Der öffentliche WebUI-Index stimmte mit dem gebauten Bundle überein. Die unveränderten Geräteidentitäten meldeten nach regulärem signierten Update `virtual` auf Linux mit `0.1.0-mvp.7` um 16:45 UTC und Windows mit `0.1.17` um 16:47 UTC. Geräteliste, Details, Mobilansicht mit 390 px und Historie sind in der öffentlichen WebUI geprüft. Beide Pakete sind in Development A und B und als Starter für leere Kataloge veröffentlicht. Die Typen `physical` und `hypervisor` sind mit Testdaten geprüft. Die Feldabnahme auf einem physischen Gerät und einem Proxmox-VE-Host steht aus. [Inventarprojektion](../crates/server/src/devices.rs) · [Geräteansicht](../web/src/devices.tsx) |
| Von der Auswahl zur Ausgabe | Die WebUI bindet die ausgewählte Skriptversion, zeigt den Inhalt vor Genehmigung und verlinkt das Ergebnis je Gerät. Ein abgelehnter Antrag erzeugte null Jobs. [Auftragsablauf](evidence/webui-auftragsablauf-20261117.json) · [Ergebnislinks und Entscheidungen](evidence/webui-order-history-20261118.json) |
| Frische Installation und periodisches Agentupdate | Beide VMs wurden über HTTPS aufgenommen und übernahmen anschließend ein signiertes Folgepaket mit derselben Geräteidentität. Auf Windows ist der öffentliche GNU-Kanal einschließlich Prüfung des offiziellen Schlüssels belegt. [Linux](evidence/linux-public-installer-update-20261117.json) · [Windows GNU](evidence/windows-gnu-official-vm-20261118.json) |
| Frische Installation und periodisches Agentupdate | Beide VMs wurden über HTTPS aufgenommen und übernahmen anschließend ein signiertes Folgepaket mit derselben Geräteidentität. Auf Windows ist der öffentliche GNU-Kanal einschließlich Prüfung des offiziellen Schlüssels belegt. [Linux](evidence/linux-public-installer-update-20261117.json) · [Windows GNU](evidence/windows-gnu-official-vm-20261118.json). ARM64 erweitert denselben HTTPS-Installer mit automatischer Architekturerkennung. Release `0.1.0-arm64.1` ist veröffentlicht und als Starter verfügbar. Auf Ubuntu 22.04.5 ARM64 wurden die öffentlichen Downloads, die Signaturprüfung, die Ablehnung einer veränderten Agentdatei und der native Start aller drei Dateien im Prüfmodus beobachtet. OTRS ist mit Gerätezertifikat aufgenommen und meldet authentisierte Heartbeats. Die erste Kontaktprüfung wartet seit der Korrektur auf das Zertifikat. Der öffentliche Installer lief auf OTRS erneut ohne Traceback und ohne neuen Einmalcode. Der ARM64-Katalogabruf ist bestätigt. Ein späterer Versionswechsel auf ARM64 steht aus. [ARM64-Release](evidence/linux-arm64-installer-20261118.json) · [Geräteaufnahme und Nachtest](evidence/linux-arm64-enrollment-heartbeat-20261118.json) |
| Betriebssystemupdate per PowerShell | Die Windows-Updatevorlage installierte KB890830 v5.147 als SYSTEM. Ergebnis und Windows-Ereignis 19 bestätigen die Installation. [Installationsbeleg](evidence/windows-update-installation-20261117.json) |
| Wiederanlauf | Nach einem Gatewaywechsel wurde der Windows-Agent ohne manuellen Dienstneustart wieder bereit. Der Helper glich seine bereits quittierte Ergebnismeldung ab. [Gatewaywechsel](evidence/windows-gateway-clock-recovery-20261117.json) · [Helper-Abgleich](evidence/windows-helper-result-recovery-20261118.json) |
+3
View File
@@ -0,0 +1,3 @@
ALTER TABLE agent_update_releases DROP CONSTRAINT agent_update_releases_platform_check;
ALTER TABLE agent_update_releases ADD CHECK (platform IN
('x86_64-unknown-linux-gnu','aarch64-unknown-linux-gnu','x86_64-pc-windows-msvc','x86_64-pc-windows-gnu'));
+3 -2
View File
@@ -165,7 +165,7 @@ test('shows the execution stop and prepares the Windows restart through a versio
expect(writes).toHaveLength(2);
});
test('offers local admin opt-in on both installer commands and keeps the one-time code outside commands', async ({ page }) => {
test('offers one Linux command for x86-64 and ARM64 and keeps the code outside both installer commands', async ({ page }) => {
const token = 'f'.repeat(64), api = '/api/v1/tenants/' + tenantId;
const requests: string[] = [];
await page.route(origin + '/auth/config', r => r.fulfill({ json: { dev_login_enabled: true, oidc_configured: false, oidc_login_url: null } }));
@@ -176,7 +176,7 @@ test('offers local admin opt-in on both installer commands and keeps the one-tim
if (url.pathname === '/api/v1/tenants') return r.fulfill({ json: listing(auth.tenants) });
if (url.pathname === api + '/enrollment-tokens') return r.fulfill({ json: {
token, expires_at: new Date(Date.now() + 900000).toISOString(), bootstrap_origin: 'https://bootstrap.example',
release_platforms: ['x86_64-unknown-linux-gnu', 'x86_64-pc-windows-gnu']
release_platforms: ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu', 'x86_64-pc-windows-gnu']
} });
return r.fulfill({ json: { ...listing([]), pending_count: 0 } });
});
@@ -185,6 +185,7 @@ test('offers local admin opt-in on both installer commands and keeps the one-tim
const option = enroll.getByRole('checkbox', { name: /Administratorskripte/ });
await expect(option).not.toBeChecked();
await enroll.getByRole('button', { name: 'Einmalcode erstellen' }).click();
await expect(enroll.getByRole('heading', { name: 'Linux (x86-64 und ARM64)' })).toBeVisible();
const commands = enroll.locator('pre');
await expect(commands).toHaveCount(2);
expect((await commands.allTextContents()).join(' ')).not.toMatch(/enable-admin-scripts|EnableAdministratorScripts/);
+61 -1
View File
@@ -1,5 +1,6 @@
"""Retry coverage for the HTTPS Linux bootstrap without installing on the test host."""
from contextlib import ExitStack, redirect_stdout
from datetime import datetime, timezone
from importlib.util import module_from_spec, spec_from_file_location
import io
import json
@@ -17,6 +18,40 @@ lifecycle = module_from_spec(spec)
spec.loader.exec_module(lifecycle)
class EnrollmentHeartbeat(unittest.TestCase):
def test_health_probe_waits_for_the_first_certificate_before_fetching(self):
with tempfile.TemporaryDirectory() as folder:
state = Path(folder)
certificate = state / 'certificates/current.json'
certificate.parent.mkdir()
now = datetime(2026, 11, 18, 17, tzinfo=timezone.utc)
record = {'last_contact_at': now.isoformat(),
'agent_version': '0.1.0-arm64.1', 'connection_generation': 1}
def finish_enrollment(_seconds):
probe.assert_not_called()
certificate.touch()
with patch.object(lifecycle, 'STATE', state), \
patch.object(lifecycle.time, 'time', return_value=now.timestamp()), \
patch.object(lifecycle.time, 'monotonic', side_effect=[0, 0, 2]), \
patch.object(lifecycle.time, 'sleep', side_effect=finish_enrollment) as wait, \
patch.object(lifecycle, 'installed', return_value=record) as probe, \
patch.object(lifecycle.subprocess, 'run', return_value=SimpleNamespace(returncode=0)):
self.assertTrue(lifecycle.healthy('0.1.0-arm64.1', 0))
wait.assert_called_once_with(2)
probe.assert_called_once_with()
def test_missing_certificate_still_times_out(self):
with tempfile.TemporaryDirectory() as folder, \
patch.object(lifecycle, 'STATE', Path(folder)), \
patch.object(lifecycle.time, 'monotonic', side_effect=[0, 0, 2]), \
patch.object(lifecycle.time, 'sleep'), \
patch.object(lifecycle, 'installed', return_value={}) as probe:
self.assertFalse(lifecycle.healthy('0.1.0-arm64.1', 0, duration=1))
probe.assert_not_called()
class EnrollmentRetry(unittest.TestCase):
def setUp(self):
self.stack = ExitStack()
@@ -56,9 +91,11 @@ class EnrollmentRetry(unittest.TestCase):
lifecycle.device_idle()
self.assertEqual(output.getvalue().strip(), expected)
def bootstrap_tenant(self, tenant):
def bootstrap_tenant(self, tenant, expected_platform=None):
def answer(source, route, target):
self.assertEqual(source, (self.base,'0' * 64))
if expected_platform:
self.assertEqual(route, '/agent/v1/bootstrap/current?platform=' + expected_platform)
target.write_text(json.dumps({'tenant_id': tenant}))
return self.stack.enter_context(patch.object(lifecycle,'remote',side_effect=answer))
@@ -80,6 +117,29 @@ class EnrollmentRetry(unittest.TestCase):
self.save.assert_called_once()
self.healthy.assert_called_once_with('1.0',0)
def test_arm64_install_retry_requests_arm64_release(self):
self.bootstrap_tenant(self.tenant, 'aarch64-unknown-linux-gnu')
with patch.object(lifecycle.platform, 'machine', return_value='aarch64'):
lifecycle.install(self.base, self.token, enable_admin_scripts=True)
self.save.assert_called_once()
self.provision.assert_called_once_with(True)
def test_unsupported_architecture_stops_before_enrollment(self):
with patch.object(lifecycle.platform, 'machine', return_value='armv7l'), \
patch.object(lifecycle, 'enrollment_token') as token:
with self.assertRaisesRegex(ValueError, 'Linux x86-64 or ARM64 required'):
lifecycle.install(self.base, self.token)
token.assert_not_called()
self.enable.assert_not_called()
def test_x64_release_is_rejected_before_downloading_to_arm64(self):
doc = {'manifest': {'release_id': self.tenant, 'platform': 'x86_64-unknown-linux-gnu'}}
with patch.object(lifecycle.platform, 'machine', return_value='aarch64'), \
patch.object(lifecycle, 'remote') as download:
with self.assertRaisesRegex(ValueError, 'release architecture differs'):
lifecycle.pair(lifecycle.ROOT, doc, (self.base, '0' * 64), lifecycle.ROOT / 'updater')
download.assert_not_called()
def test_timer_starts_only_after_confirmed_first_connection(self):
self.bootstrap_tenant(self.tenant)
self.healthy.return_value = False
+7 -3
View File
@@ -19,9 +19,11 @@ from urllib.parse import urlencode, urlsplit
import uuid
LINUX = 'x86_64-unknown-linux-gnu'
LINUX_ARM64 = 'aarch64-unknown-linux-gnu'
WINDOWS = 'x86_64-pc-windows-msvc'
FILES = {LINUX: ('rmm-agent', 'rmm-privileged-helper', 'rmm-agent-updater'),
WINDOWS: ('rmm-agent-windows.exe', 'rmm-helper-windows.exe', 'rmm-updater-windows.exe')}
FILES[LINUX_ARM64] = FILES[LINUX]
WINDOWS_GNU = 'x86_64-pc-windows-gnu'
FILES[WINDOWS_GNU] = FILES[WINDOWS]
LIMIT = 256 * 1024 * 1024
@@ -55,9 +57,11 @@ def verify_native_image(path, target, size):
with path.open('rb') as binary:
header = binary.read(64)
check(len(header) == 64, 'truncated binary header: ' + path.name)
if target == LINUX:
if target in (LINUX, LINUX_ARM64):
machine = 62 if target == LINUX else 183
check(header[:6] == b'\x7fELF\x02\x01' and header[16:18] in (b'\x02\x00', b'\x03\x00')
and header[18:20] == b'\x3e\x00', 'Linux x86-64 ELF image required: ' + path.name)
and int.from_bytes(header[18:20], 'little') == machine,
f'{target} ELF image required: {path.name}')
else:
pe = int.from_bytes(header[60:64], 'little')
check(header[:2] == b'MZ' and 64 <= pe <= size - 26, 'Windows PE image required: ' + path.name)
@@ -130,7 +134,7 @@ def release_label(platform, official_windows):
if official_windows:
check(platform == WINDOWS_GNU, 'official Windows releases require a GNU x64 build receipt')
return 'windows-gnu-official'
return {LINUX: 'linux', WINDOWS: 'windows', WINDOWS_GNU: 'windows-gnu'}[platform]
return {LINUX: 'linux', LINUX_ARM64: 'linux-arm64', WINDOWS: 'windows', WINDOWS_GNU: 'windows-gnu'}[platform]
def prepare(args):
+18 -11
View File
@@ -22,6 +22,12 @@ TARGETS = {
"sha256:30ae3d90753bc39b0a98a897784c662aff9598ffab7a98a6298e8aa79145c2ec",
[("rmm-server", "rmm-server"), ("rmm-time-broker-linux", "rmm-time-broker-linux")],
),
"linux-arm64": (
"linux/arm64", "aarch64-unknown-linux-gnu",
"sha256:30ae3d90753bc39b0a98a897784c662aff9598ffab7a98a6298e8aa79145c2ec",
[("rmm-agent", "rmm-agent"), ("rmm-privileged-helper", "rmm-privileged-helper"),
("rmm-updater-worker", "rmm-agent-updater")],
),
"linux-x64": (
"linux/amd64", "x86_64-unknown-linux-gnu",
"sha256:9a76ad3744ebfdddae96ca10001ce8291c1b332fb54c8df5eea0e8e999ac6fc6",
@@ -34,6 +40,7 @@ TARGETS = {
[("rmm-agent-windows", "rmm-agent-windows"), ("rmm-agent-windows", "rmm-helper-windows")],
),
}
REMOTE_TARGETS = ("server-arm64", "linux-arm64")
SOURCE_PATHS = ["Cargo.toml", "Cargo.lock", "rust-toolchain.toml", "crates", "proto",
"migrations", "tools/apt-transaction", "deploy/linux", "tests"]
@@ -140,7 +147,7 @@ def build_archive(work, archive, revision, plan):
print(f"Artifacts: {destination}\n{json.dumps(hashes, indent=2)}")
def remote_build(archive, revision, jobs):
def remote_build(archive, revision, jobs, target):
from dev_stage import ssh_prefix
# The only SSH payload is this build driver and the selected Git sources.
@@ -154,14 +161,14 @@ trap 'rm -rf -- "$stage"' EXIT
cd "$stage"
tar -xf - build.py source.tar.gz
printf '%s build.py\\n%s source.tar.gz\\n' "$1" "$2" | sha256sum -c - >/dev/null
python3 -I build.py _server_worker "$3" "$4"
python3 -I build.py _server_worker "$3" "$4" "$5"
"""
with tempfile.TemporaryFile() as bundle:
with tarfile.open(fileobj=bundle, mode="w") as package:
package.add(worker, arcname="build.py")
package.add(archive, arcname="source.tar.gz")
bundle.seek(0)
command = shlex.join(["sh", "-c", shell, "build", *checksums, revision, str(jobs)])
command = shlex.join(["sh", "-c", shell, "build", *checksums, revision, str(jobs), target])
result = subprocess.run([*ssh_prefix("server"), command], stdin=bundle)
if result.returncode:
raise SystemExit(f"ARM64 build via SSH failed (exit {result.returncode}).")
@@ -176,13 +183,13 @@ def main():
parser.add_argument("target", choices=TARGETS)
parser.add_argument("--ref", default="HEAD", help="Git commit or ref (default: HEAD). Uncommitted edits are excluded.")
parser.add_argument("--jobs", type=int, default=2, help="Maximum parallel Cargo jobs (default: 2).")
parser.add_argument("--ssh", action="store_true", help="Build server-arm64 on the configured server, in ~/rmm-dev-build/.")
parser.add_argument("--ssh", action="store_true", help="Build ARM64 binaries on the configured server, in ~/rmm-dev-build/.")
parser.add_argument("--plan", action="store_true", help="Show the build plan without connecting, writing or building.")
args = parser.parse_args()
if args.jobs < 1:
parser.error("--jobs must be positive")
if args.ssh and args.target != "server-arm64":
parser.error("--ssh applies to server-arm64")
if args.ssh and args.target not in REMOTE_TARGETS:
parser.error("--ssh applies to the ARM64 targets")
revision = git("rev-parse", "--verify", "--end-of-options", args.ref + "^{commit}")
windows_updater = args.target == "windows-gnu-x64" and git(
"ls-tree", "--name-only", revision, "crates/agent-windows/src/bin/rmm-updater-windows.rs")
@@ -196,7 +203,7 @@ def main():
archive = Path(temporary) / "source.tar.gz"
subprocess.run(["git", "archive", "-o", archive, revision, "--", *SOURCE_PATHS], cwd=ROOT, check=True)
if args.ssh:
remote_build(archive, revision, args.jobs)
remote_build(archive, revision, args.jobs, args.target)
else:
build_archive(ROOT / "devstate" / "build" / args.target, archive, revision, plan)
@@ -204,12 +211,12 @@ def main():
if __name__ == "__main__":
try:
if sys.argv[1:2] == ["_server_worker"]:
revision, jobs_arg = sys.argv[2:]
if (len(revision) not in (40, 64) or any(c not in "0123456789abcdef" for c in revision)
revision, jobs_arg, target = sys.argv[2:]
if (target not in REMOTE_TARGETS or len(revision) not in (40, 64) or any(c not in "0123456789abcdef" for c in revision)
or not jobs_arg.isascii() or not jobs_arg.isdecimal() or int(jobs_arg) < 1):
raise SystemExit("Invalid packed build request.")
work = Path.home() / "rmm-dev-build" / "server-arm64"
build_archive(work, Path("source.tar.gz").resolve(), revision, prepare("server-arm64", int(jobs_arg)))
work = Path.home() / "rmm-dev-build" / target
build_archive(work, Path("source.tar.gz").resolve(), revision, prepare(target, int(jobs_arg)))
else:
main()
except (OSError, subprocess.CalledProcessError) as error:
+3 -2
View File
@@ -17,7 +17,8 @@ from dev_stage import ssh_prefix
def publish(tenant, platform, release, official_windows=False, *, root=Path('/opt/rust-discovery/devstate/mvp-releases'),
database_container='rust-discovery-server-postgres-1', service_uid=10001):
labels = {'x86_64-pc-windows-gnu': 'windows-gnu', 'x86_64-unknown-linux-gnu': 'linux'}
labels = {'x86_64-pc-windows-gnu': 'windows-gnu', 'x86_64-unknown-linux-gnu': 'linux',
'aarch64-unknown-linux-gnu': 'linux-arm64'}
label = labels[platform]
if official_windows:
if platform != 'x86_64-pc-windows-gnu':
@@ -88,7 +89,7 @@ def publish(tenant, platform, release, official_windows=False, *, root=Path('/op
def main():
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--tenant',required=True,type=uuid.UUID)
parser.add_argument('--platform',required=True,choices=['x86_64-unknown-linux-gnu','x86_64-pc-windows-gnu'])
parser.add_argument('--platform',required=True,choices=['x86_64-unknown-linux-gnu','aarch64-unknown-linux-gnu','x86_64-pc-windows-gnu'])
parser.add_argument('--official-windows',action='store_true')
parser.add_argument('--release',required=True,type=uuid.UUID)
args=parser.parse_args()
+2 -2
View File
@@ -25,7 +25,7 @@ export function releaseEnvelope(value: unknown): ReleaseView {
if (!bytes.length || bytes.length > 16384 || signature.length !== 64) throw new Error('Agentupdate: Manifest-/Signaturlimit');
const m = record(JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)));
exact(m, ['schema_version', 'release_id', 'release_sequence', 'version', 'platform', 'published_at', 'expires_at', 'protocol_major', 'state_schema', 'minimum_updater_version', 'artifacts']);
if (m.schema_version !== 1 || !['x86_64-unknown-linux-gnu', 'x86_64-pc-windows-msvc', 'x86_64-pc-windows-gnu'].includes(String(m.platform)) || typeof m.version !== 'string' || !/^[A-Za-z0-9.+_-]{1,64}$/.test(m.version)
if (m.schema_version !== 1 || !['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu', 'x86_64-pc-windows-msvc', 'x86_64-pc-windows-gnu'].includes(String(m.platform)) || typeof m.version !== 'string' || !/^[A-Za-z0-9.+_-]{1,64}$/.test(m.version)
|| !Array.isArray(m.artifacts) || m.artifacts.length !== 2) throw new Error('Agentupdate: festes x64-Codepaar erforderlich');
const artifacts = m.artifacts.map((value, index) => { const a = record(value); exact(a, ['role', 'artifact_id', 'sha256', 'bytes']); if (a.role !== ['agent', 'helper'][index]) throw new Error('Agentupdate: Agent-/Helperreihenfolge'); return { role: a.role, artifact_id: uuid(a.artifact_id), sha256: digest(a.sha256), bytes: integer(a.bytes, 1, 268435456) }; });
if (artifacts[0]!.artifact_id === artifacts[1]!.artifact_id) throw new Error('Agentupdate: doppelte Artefakt-ID');
@@ -55,7 +55,7 @@ export function validateAgentUpdateAction(value: unknown, identity: unknown): Re
const action = record(value); exact(action, ['action', 'update']); if (action.action !== 'update_agent') throw new Error('Agentupdate: typisierte Aktion erforderlich');
const u = record(action.update); exact(u, ['schema_version', 'profile', 'release_envelope', 'release_envelope_sha256', 'manifest_sha256', 'predecessor', 'updater', 'peer_pin_transition', 'recovery', 'health_profile', 'health_timeout_seconds', 'no_reboot']);
if (u.schema_version !== 1 || u.profile !== 'fixed_code_pair_v1' || u.recovery !== 'restore_exact_predecessor_once' || u.health_profile !== 'mtls_inventory_sync_v1' || u.health_timeout_seconds !== 180 || u.no_reboot !== true) throw new Error('Agentupdate: fester Apply-/Health-/No-Reboot-Vertrag erforderlich');
const release = releaseEnvelope(u.release_envelope), linux = release.manifest.platform === 'x86_64-unknown-linux-gnu';
const release = releaseEnvelope(u.release_envelope), linux = ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu'].includes(String(release.manifest.platform));
if (identity !== (linux ? 'root' : 'system')) throw new Error('Agentupdate: Plattform und Root-/SYSTEM-Identität widersprechen sich');
const old = record(u.predecessor); exact(old, ['release_id', 'release_sequence', 'manifest_sha256', 'installed_record_sha256', 'agent_sha256', 'helper_sha256']);
const predecessor = { release_id: uuid(old.release_id), release_sequence: integer(old.release_sequence), manifest_sha256: digest(old.manifest_sha256), installed_record_sha256: digest(old.installed_record_sha256), agent_sha256: digest(old.agent_sha256), helper_sha256: digest(old.helper_sha256) };
+7 -2
View File
@@ -200,7 +200,12 @@ function DeviceEnrollment({ tenantId, auth, customerName }: { tenantId: string;
const [copied, setCopied] = useState(false);
const [adminScripts, setAdminScripts] = useState(false);
const origin = enrollment?.origin;
const linuxInstaller = origin && enrollment.platforms.includes('x86_64-unknown-linux-gnu') ? `${origin}/install/linux.sh` : null;
const linuxArchitectures = [
['x86_64-unknown-linux-gnu', 'x86-64'],
['aarch64-unknown-linux-gnu', 'ARM64'],
] as const;
const availableLinuxArchitectures = linuxArchitectures.filter(([target]) => enrollment?.platforms.includes(target)).map(([, label]) => label);
const linuxInstaller = origin && availableLinuxArchitectures.length > 0 ? `${origin}/install/linux.sh` : null;
const windowsPlatforms = ['x86_64-pc-windows-gnu', 'x86_64-pc-windows-msvc'].filter(platform => enrollment?.platforms.includes(platform));
const windowsInstaller = origin && windowsPlatforms.length > 0 ? `${origin}/install/windows.ps1` : null;
return <section aria-label="Gerät aufnehmen"><h2>Gerät aufnehmen</h2>
@@ -241,7 +246,7 @@ function DeviceEnrollment({ tenantId, auth, customerName }: { tenantId: string;
{enrollment && !origin && <p role="status">Für die Geräteaufnahme ist keine HTTPS-Downloadadresse konfiguriert.</p>}
{origin && !linuxInstaller && !windowsInstaller && <p role="status">Für diesen Kunden ist derzeit kein Linux- oder Windows-Installer verfügbar.</p>}
{linuxInstaller && <>
<h4>Linux (x86-64)</h4>
<h4>Linux ({availableLinuxArchitectures.join(' und ')})</h4>
<p>Installationsskript <a href={linuxInstaller} target="_blank" rel="noopener noreferrer">linux.sh</a></p>
<pre>{`curl --fail --show-error --silent '${linuxInstaller}' -o linux.sh && sudo sh linux.sh '${origin}'${adminScripts ? ' --enable-admin-scripts' : ''}`}</pre>
</>}