Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8757ed416 |
Generated
-1
@@ -2191,7 +2191,6 @@ dependencies = [
|
||||
"rmm-domain",
|
||||
"rmm-privileged-helper",
|
||||
"rmm-protocol",
|
||||
"rmm-updater",
|
||||
"rmm-updater-handoff",
|
||||
"rusqlite",
|
||||
"rustls",
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# Rust Discovery / RMM
|
||||
|
||||
**Stand 15. November 2026, Spezifikation 1.23.** Linux M0–M5 ist auf der
|
||||
Ubuntu-Cloud-VM im dev/test-Betrieb abgenommen. Der zusätzliche Auftrag umfasst
|
||||
die Windows-11-VM, die genehmigte Skriptkonsole und den Agent-Selbstupdater.
|
||||
Beide aktiven Geräte melden sich an `discovery.ease-technologies.de` und sind
|
||||
über MCP mit gespeicherten Inventardaten abrufbar. Das Notebook dient der
|
||||
Entwicklung. [Abgleich der Geräte nach dem Gatewaywechsel](docs/server-time-gateway-deploy.md)
|
||||
Aktueller Entwicklungsstand: **Linux-MVP M0–M5 im begrenzten dev/test-Umfang abgeschlossen**,
|
||||
Spezifikation 1.15, 2026-11-13. Der endgültige Server ist
|
||||
`discovery.ease-technologies.de`. Der Linux-Client läuft ausschließlich auf der
|
||||
Ubuntu-Cloud-VM; das Notebook dient ausschließlich der Entwicklung. Die
|
||||
Windows-11-Test-VM ist ein eigener Gast und darf parallel entwickelt werden.
|
||||
|
||||
## Tatsächlich nachgewiesen
|
||||
|
||||
@@ -87,17 +86,14 @@ Kontrolle vor und nach den Ablehnungen. Das sind keine LocalService-
|
||||
TLS-Negativnachweise. Der permanente Dienst und seine Geräteidentität blieben
|
||||
erhalten; private Schlüssel verließen die VM nicht.
|
||||
|
||||
Auf Windows laufen der passive Agent und der getrennte SYSTEM-Helper. Die
|
||||
beiderseitige Identitätsprüfung zwischen den Diensten ist nativ belegt. Der
|
||||
PowerShell-Executor und die Bindung an den genehmigten Plan sind implementiert.
|
||||
Für die erste durchgängige Abnahme fehlen der unabhängige signierte Zeitabgleich
|
||||
der beiden laufenden Rollen sowie ein WebUI-genehmigter Auftrag mit überprüfter
|
||||
Ausgabe. Selbstupdates benötigen noch eine native Aktualisierung des installierten
|
||||
Agent-/Helper-Paars unter Erhalt der Geräteidentität. APT- und MSI-Paketfälle
|
||||
prüfen die Verwaltung anderer Software. [Windows-Abnahmen](docs/windows-gates.md)
|
||||
und [Agent-Selbstupdate](docs/agent-updater-runtime-source.md).
|
||||
|
||||
Weitere Agentplattformen, PVE/PBS/Cluster/Backups und Betriebsreife
|
||||
Windows meldet weiterhin keine Jobcapability und hat keinen Jobexecutor.
|
||||
Vertrauenswürdige Uhr, gemeinsamer signierter Sync-/Journal-/Einmalverbrauchskern
|
||||
sowie plattformgebundene Interpreterpläne in Domain, Server und WebUI sind vor
|
||||
dem ersten Windowsjob offen. Entwicklungsbuilds sind unsigniert;
|
||||
Rotation, Widerruf, privilegierter Helper, Paketaktionen und Windows-Reboot
|
||||
sind noch nicht abgenommen. Die [Windows-Gates](docs/windows-gates.md) und
|
||||
[Grenze vor dem ersten Job](docs/windows-job-boundary.md) führen den nächsten
|
||||
Umfang. Weitere Agentplattformen, PVE/PBS/Cluster/Backups und Betriebsreife
|
||||
folgen außerhalb des Linux-MVP. RustDesk ist ausdrücklich ausgelassen.
|
||||
|
||||
## Projektunterlagen
|
||||
|
||||
@@ -32,5 +32,3 @@ libc = "0.2.177"
|
||||
rmm-updater-handoff = { path = "../updater-handoff" }
|
||||
base64 = "=0.22.1"
|
||||
hex.workspace = true
|
||||
|
||||
rmm-updater = { path = "../updater" }
|
||||
|
||||
@@ -1,966 +0,0 @@
|
||||
//! Passive authenticated catalog metadata only. No artifact request, preview,
|
||||
//! approval, staging, consumption, capability, service or filesystem write.
|
||||
use anyhow::{Context, Result, ensure};
|
||||
use chrono::{DateTime, Utc};
|
||||
use openssl::{
|
||||
pkey::{Id, PKey},
|
||||
sign::Verifier,
|
||||
};
|
||||
use rmm_domain::{
|
||||
agent_update::{Platform, ReleaseEnvelope, ReleaseManifest, UpdateKeyringFile},
|
||||
agent_update_provisioning::{
|
||||
BASELINE_SIGNATURE_DOMAIN, InstalledReleaseRecord, LocalUpdatePolicy,
|
||||
},
|
||||
jobs::hash,
|
||||
};
|
||||
use rmm_privileged_helper::{Binding, TrustedClock};
|
||||
use rmm_updater::{
|
||||
ActiveRelease, Platform as ReleasePlatform, ReleaseRelation, SignedRelease, TrustedContext,
|
||||
TrustedUpdateKey, UpdateKeyring, verify_release,
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use std::{
|
||||
fs::{File, OpenOptions},
|
||||
io::Read,
|
||||
net::SocketAddr,
|
||||
os::unix::fs::{MetadataExt, OpenOptionsExt},
|
||||
path::{Path, PathBuf},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use tokio::sync::oneshot;
|
||||
#[cfg(test)]
|
||||
use uuid::Uuid;
|
||||
|
||||
const POLICY: &str = "/etc/rmm-agent-updater/policy.json";
|
||||
const KEYRING: &str = "/etc/rmm-agent-updater/keyring.json";
|
||||
const RECORD: &str = "/var/lib/rmm-agent-updater/installed-record.json";
|
||||
const RESPONSE_LIMIT: usize = 64 * 1024;
|
||||
const DAY: Duration = Duration::from_secs(24 * 60 * 60);
|
||||
|
||||
use rmm_domain::agent_update::{
|
||||
CatalogCandidate as Candidate, CatalogCheckReport as Report, CatalogCheckStatus as Status,
|
||||
};
|
||||
fn empty(status: Status) -> Report {
|
||||
Report {
|
||||
schema_version: 1,
|
||||
source_id: "mtls:release-catalog-v1".into(),
|
||||
checked_at: Utc::now(),
|
||||
status,
|
||||
candidate: None,
|
||||
}
|
||||
}
|
||||
/// Old servers already accept this ordinary bounded Linux observation shape.
|
||||
/// The outer timestamp says when the cache was read; checked_at is not restamped.
|
||||
pub fn observation(report: Report, collected_at: DateTime<Utc>) -> serde_json::Value {
|
||||
let (quality, error) = match report.status {
|
||||
Status::Available | Status::Current => ("valid", None),
|
||||
Status::NotConfigured => ("unknown", Some("UPDATE_CATALOG_NOT_CONFIGURED")),
|
||||
Status::Unavailable => ("error", Some("UPDATE_CATALOG_CHECK_UNAVAILABLE")),
|
||||
};
|
||||
serde_json::json!({"scope":"linux.agent_update.catalog","source_id":"agent:cached-release-catalog-v1",
|
||||
"observed_at":collected_at,"quality":quality,"completeness":"complete","truncated":false,
|
||||
"error_code":error,"data":report})
|
||||
}
|
||||
struct Pending {
|
||||
receiver: oneshot::Receiver<Report>,
|
||||
task: tokio::task::JoinHandle<()>,
|
||||
}
|
||||
impl Drop for Pending {
|
||||
fn drop(&mut self) {
|
||||
self.task.abort();
|
||||
}
|
||||
}
|
||||
#[derive(Default)]
|
||||
pub struct Checker {
|
||||
report: Option<Report>,
|
||||
started: Option<Instant>,
|
||||
pending: Option<Pending>,
|
||||
}
|
||||
impl Checker {
|
||||
pub fn cached(&self, now: DateTime<Utc>) -> Option<Report> {
|
||||
self.report
|
||||
.as_ref()
|
||||
.filter(|report| report.validate(now, now))
|
||||
.cloned()
|
||||
}
|
||||
/// Called by the normal passive update collector. IO runs in a background
|
||||
/// task; a slow HTTPS peer never blocks heartbeat/cancel/control dispatch.
|
||||
pub fn poll(
|
||||
&mut self,
|
||||
binding: Option<&Binding>,
|
||||
clock: TrustedClock,
|
||||
address: SocketAddr,
|
||||
client: impl FnOnce() -> Result<reqwest::Client>,
|
||||
) -> Report {
|
||||
if let Some(pending) = &mut self.pending {
|
||||
match pending.receiver.try_recv() {
|
||||
Ok(report) => {
|
||||
self.report = Some(report);
|
||||
self.pending.take();
|
||||
}
|
||||
Err(oneshot::error::TryRecvError::Empty) => {}
|
||||
Err(oneshot::error::TryRecvError::Closed) => {
|
||||
self.report = Some(empty(Status::Unavailable));
|
||||
self.pending.take();
|
||||
}
|
||||
}
|
||||
}
|
||||
let interval = if self
|
||||
.report
|
||||
.as_ref()
|
||||
.is_some_and(|r| matches!(r.status, Status::Available | Status::Current))
|
||||
{
|
||||
DAY
|
||||
} else {
|
||||
Duration::from_secs(60)
|
||||
};
|
||||
if self.pending.is_none() && self.started.is_none_or(|t| t.elapsed() >= interval) {
|
||||
self.started = Some(Instant::now());
|
||||
let prepared = binding
|
||||
.map(|binding| {
|
||||
Trust::load(
|
||||
binding,
|
||||
Path::new(POLICY),
|
||||
Path::new(KEYRING),
|
||||
Path::new(RECORD),
|
||||
)
|
||||
})
|
||||
.transpose();
|
||||
match prepared {
|
||||
Ok(None | Some(None)) => self.report = Some(empty(Status::NotConfigured)),
|
||||
Err(_) => self.report = Some(empty(Status::Unavailable)),
|
||||
Ok(Some(Some(trust))) => {
|
||||
let transport = if clock.trusted() {
|
||||
client()
|
||||
} else {
|
||||
Err(anyhow::anyhow!("UPDATE_CATALOG_CLOCK_UNTRUSTED"))
|
||||
};
|
||||
match transport {
|
||||
Err(_) => self.report = Some(empty(Status::Unavailable)),
|
||||
Ok(client) => {
|
||||
let (sender, receiver) = oneshot::channel();
|
||||
let task = tokio::spawn(async move {
|
||||
let result = tokio::time::timeout(
|
||||
Duration::from_secs(35),
|
||||
request(&client, address, &trust, &clock),
|
||||
)
|
||||
.await;
|
||||
let report = result
|
||||
.ok()
|
||||
.and_then(Result::ok)
|
||||
.unwrap_or_else(|| empty(Status::Unavailable));
|
||||
let _ = sender.send(report);
|
||||
});
|
||||
self.pending = Some(Pending { receiver, task });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
self.report
|
||||
.clone()
|
||||
.unwrap_or_else(|| empty(Status::Unavailable))
|
||||
}
|
||||
}
|
||||
|
||||
/// Protected, public local records only. Missing provisioning is not an invitation
|
||||
/// to bootstrap trust from the HTTP response, current job or a writable file.
|
||||
struct Protected {
|
||||
path: PathBuf,
|
||||
file: File,
|
||||
stamp: [u64; 10],
|
||||
raw: Vec<u8>,
|
||||
limit: usize,
|
||||
}
|
||||
fn stamp(m: &std::fs::Metadata) -> [u64; 10] {
|
||||
[
|
||||
m.dev(),
|
||||
m.ino(),
|
||||
m.uid().into(),
|
||||
m.gid().into(),
|
||||
m.mode().into(),
|
||||
m.len(),
|
||||
m.mtime() as u64,
|
||||
m.ctime() as u64,
|
||||
m.mtime_nsec() as u64,
|
||||
m.ctime_nsec() as u64,
|
||||
]
|
||||
}
|
||||
fn parents(path: &Path) -> Result<()> {
|
||||
ensure!(path.is_absolute(), "UPDATE_CATALOG_ANCHOR_PATH");
|
||||
for parent in path.ancestors().skip(1) {
|
||||
let m = std::fs::symlink_metadata(parent)?;
|
||||
ensure!(
|
||||
m.is_dir() && !m.file_type().is_symlink() && m.uid() == 0 && m.mode() & 0o022 == 0,
|
||||
"UPDATE_CATALOG_ANCHOR_PARENT"
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
impl Protected {
|
||||
fn read(path: &Path, limit: usize) -> Result<Self> {
|
||||
parents(path)?;
|
||||
let mut file = OpenOptions::new()
|
||||
.read(true)
|
||||
.custom_flags(libc::O_NOFOLLOW | libc::O_NONBLOCK | libc::O_CLOEXEC)
|
||||
.open(path)?;
|
||||
let m = file.metadata()?;
|
||||
ensure!(
|
||||
m.is_file()
|
||||
&& m.uid() == 0
|
||||
&& m.mode() & 0o022 == 0
|
||||
&& m.nlink() == 1
|
||||
&& m.len() > 0
|
||||
&& m.len() <= limit as u64,
|
||||
"UPDATE_CATALOG_ANCHOR_FILE"
|
||||
);
|
||||
let before = stamp(&m);
|
||||
let mut raw = Vec::new();
|
||||
(&mut file).take(limit as u64 + 1).read_to_end(&mut raw)?;
|
||||
ensure!(
|
||||
raw.len() as u64 == m.len() && stamp(&file.metadata()?) == before,
|
||||
"UPDATE_CATALOG_ANCHOR_CHANGED"
|
||||
);
|
||||
let result = Self {
|
||||
path: path.to_owned(),
|
||||
file,
|
||||
stamp: before,
|
||||
raw,
|
||||
limit,
|
||||
};
|
||||
ensure!(
|
||||
stamp(&std::fs::symlink_metadata(path)?) == result.stamp,
|
||||
"UPDATE_CATALOG_ANCHOR_REPLACED"
|
||||
);
|
||||
Ok(result)
|
||||
}
|
||||
fn recheck(&self) -> Result<()> {
|
||||
let current = Self::read(&self.path, self.limit)?;
|
||||
ensure!(
|
||||
stamp(&self.file.metadata()?) == self.stamp
|
||||
&& current.stamp == self.stamp
|
||||
&& current.raw == self.raw,
|
||||
"UPDATE_CATALOG_ANCHOR_REPLACED"
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
struct Trust {
|
||||
files: Vec<Protected>,
|
||||
keys: UpdateKeyring,
|
||||
record: InstalledReleaseRecord,
|
||||
protocol: u32,
|
||||
state: u32,
|
||||
generation: u64,
|
||||
}
|
||||
impl Trust {
|
||||
fn load(binding: &Binding, policy: &Path, keys: &Path, record: &Path) -> Result<Option<Self>> {
|
||||
let result = (|| -> Result<Self> {
|
||||
let policy = Protected::read(policy, 65536)?;
|
||||
let (local, _) =
|
||||
LocalUpdatePolicy::from_bytes(&policy.raw).map_err(anyhow::Error::msg)?;
|
||||
ensure!(
|
||||
local.keyring_path == KEYRING && local.installed_record_path == RECORD,
|
||||
"UPDATE_CATALOG_FIXED_ANCHOR_PATHS"
|
||||
);
|
||||
let keys = Protected::read(keys, 16384)?;
|
||||
let record = Protected::read(record, 32768)?;
|
||||
let result = Self::verify(binding, &policy.raw, &keys.raw, &record.raw)?;
|
||||
Ok(Self {
|
||||
files: vec![policy, keys, record],
|
||||
..result
|
||||
})
|
||||
})();
|
||||
match result {
|
||||
Ok(value) => Ok(Some(value)),
|
||||
Err(error)
|
||||
if error
|
||||
.downcast_ref::<std::io::Error>()
|
||||
.is_some_and(|e| e.kind() == std::io::ErrorKind::NotFound) =>
|
||||
{
|
||||
Ok(None)
|
||||
}
|
||||
Err(error) => Err(error),
|
||||
}
|
||||
}
|
||||
fn verify(
|
||||
binding: &Binding,
|
||||
policy_raw: &[u8],
|
||||
keys_raw: &[u8],
|
||||
record_raw: &[u8],
|
||||
) -> Result<Self> {
|
||||
let (policy, _) = LocalUpdatePolicy::from_bytes(policy_raw).map_err(anyhow::Error::msg)?;
|
||||
ensure!(
|
||||
policy.tenant_id == binding.tenant_id
|
||||
&& policy.asset_id == binding.asset_id
|
||||
&& policy.agent_id == binding.agent_id
|
||||
&& policy.enrollment_generation == binding.enrollment_generation
|
||||
&& policy.assignment_version == binding.assignment_version,
|
||||
"UPDATE_CATALOG_LOCAL_IDENTITY"
|
||||
);
|
||||
let keys: UpdateKeyringFile = serde_json::from_slice(keys_raw)?;
|
||||
ensure!(keys.validate(), "UPDATE_CATALOG_KEYRING");
|
||||
let mut trusted = Vec::new();
|
||||
for key in &keys.keys {
|
||||
let public: [u8; 32] = hex::decode(&key.public_key_hex)?
|
||||
.try_into()
|
||||
.map_err(|_| anyhow::anyhow!("UPDATE_CATALOG_KEY_SIZE"))?;
|
||||
ensure!(
|
||||
key.platform == Platform::LinuxX64 && key.public_key_hex != binding.public_key_hex,
|
||||
"UPDATE_CATALOG_KEY_SEPARATION"
|
||||
);
|
||||
trusted.push(TrustedUpdateKey::new(
|
||||
public,
|
||||
ReleasePlatform::LinuxX64,
|
||||
key.first_sequence,
|
||||
key.last_sequence,
|
||||
key.revoked,
|
||||
)?);
|
||||
}
|
||||
let keyring = UpdateKeyring::new(keys.generation, trusted)?;
|
||||
let baseline = policy
|
||||
.initial_baseline
|
||||
.decode()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
// Only the independently signed bootstrap can currently authenticate
|
||||
// the floor here. Later Updated records require the separate guarded
|
||||
// Full history observer; do not guess a floor from parsed root JSON.
|
||||
ensure!(
|
||||
baseline.payload_bytes == record_raw
|
||||
&& hash(record_raw) == policy.initial_record_sha256,
|
||||
"UPDATE_CATALOG_GUARDED_HISTORY_REQUIRED"
|
||||
);
|
||||
let signer = keys
|
||||
.keys
|
||||
.iter()
|
||||
.find(|key| {
|
||||
hash(&hex::decode(&key.public_key_hex).unwrap_or_default())
|
||||
== policy.initial_baseline.key_id
|
||||
})
|
||||
.context("UPDATE_CATALOG_BASELINE_KEY")?;
|
||||
ensure!(!signer.revoked, "UPDATE_CATALOG_BASELINE_REVOKED");
|
||||
let public =
|
||||
PKey::public_key_from_raw_bytes(&hex::decode(&signer.public_key_hex)?, Id::ED25519)?;
|
||||
let mut signed = BASELINE_SIGNATURE_DOMAIN.to_vec();
|
||||
signed.extend_from_slice(&baseline.payload_bytes);
|
||||
ensure!(
|
||||
Verifier::new_without_digest(&public)?.verify_oneshot(&baseline.signature, &signed)?,
|
||||
"UPDATE_CATALOG_BASELINE_SIGNATURE"
|
||||
);
|
||||
let decoded = baseline
|
||||
.record
|
||||
.release_envelope
|
||||
.decode()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
let result = Self {
|
||||
files: vec![],
|
||||
keys: keyring,
|
||||
protocol: decoded.manifest.protocol_major,
|
||||
state: decoded.manifest.state_schema,
|
||||
generation: keys.generation,
|
||||
record: baseline.record,
|
||||
};
|
||||
result.release(&result.record.release_envelope, result.record.activated_at)?;
|
||||
Ok(result)
|
||||
}
|
||||
fn release(
|
||||
&self,
|
||||
envelope: &ReleaseEnvelope,
|
||||
now: u64,
|
||||
) -> Result<rmm_updater::VerifiedRelease> {
|
||||
let decoded = envelope.decode().map_err(anyhow::Error::msg)?;
|
||||
verify_release(
|
||||
SignedRelease {
|
||||
schema_version: envelope.schema_version,
|
||||
key_id: &envelope.key_id,
|
||||
payload_bytes: &decoded.payload_bytes,
|
||||
signature: &decoded.signature,
|
||||
},
|
||||
&self.keys,
|
||||
&TrustedContext {
|
||||
platform: ReleasePlatform::LinuxX64,
|
||||
now_utc_seconds: now,
|
||||
keyring_generation: self.generation,
|
||||
protocol_major: self.protocol,
|
||||
state_schema: self.state,
|
||||
updater_version: 1,
|
||||
minimum_release_sequence: self.record.activation_floor,
|
||||
active_release: Some(ActiveRelease {
|
||||
sequence: self.record.activation_floor,
|
||||
manifest_sha256: self.record.manifest_sha256.clone(),
|
||||
}),
|
||||
},
|
||||
)
|
||||
}
|
||||
fn response(&self, bytes: &[u8], now: DateTime<Utc>) -> Result<Report> {
|
||||
ensure!(
|
||||
!bytes.is_empty() && bytes.len() <= RESPONSE_LIMIT,
|
||||
"UPDATE_CATALOG_RESPONSE_LIMIT"
|
||||
);
|
||||
let response: CatalogResponse = serde_json::from_slice(bytes)?;
|
||||
ensure!(!response.job_created, "UPDATE_CATALOG_UNEXPECTED_JOB");
|
||||
match (response.status.as_str(), response.release) {
|
||||
("not_configured", None) => Ok(empty(Status::NotConfigured)),
|
||||
("available", Some(release)) => {
|
||||
ensure!(
|
||||
release
|
||||
.release_envelope
|
||||
.decode()
|
||||
.map_err(anyhow::Error::msg)?
|
||||
.manifest
|
||||
== release.manifest,
|
||||
"UPDATE_CATALOG_UNSIGNED_VIEW_CHANGED"
|
||||
);
|
||||
let verified =
|
||||
self.release(&release.release_envelope, u64::try_from(now.timestamp())?)?;
|
||||
let manifest = verified.manifest();
|
||||
Ok(Report {
|
||||
schema_version: 1,
|
||||
source_id: "mtls:release-catalog-v1".into(),
|
||||
checked_at: now,
|
||||
status: if verified.relation() == ReleaseRelation::SameActiveManifest {
|
||||
Status::Current
|
||||
} else {
|
||||
Status::Available
|
||||
},
|
||||
candidate: Some(Candidate {
|
||||
release_id: manifest.release_id,
|
||||
release_sequence: manifest.release_sequence,
|
||||
version: manifest.version.clone(),
|
||||
manifest_sha256: verified.manifest_sha256().into(),
|
||||
keyring_generation: verified.keyring_generation(),
|
||||
}),
|
||||
})
|
||||
}
|
||||
_ => anyhow::bail!("UPDATE_CATALOG_RESPONSE_SHAPE"),
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct CatalogResponse {
|
||||
status: String,
|
||||
release: Option<CatalogRelease>,
|
||||
#[serde(rename = "observed_at")]
|
||||
_observed_at: DateTime<Utc>,
|
||||
#[serde(rename = "server_time")]
|
||||
_server_time: DateTime<Utc>,
|
||||
job_created: bool,
|
||||
}
|
||||
#[derive(Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct CatalogRelease {
|
||||
release_envelope: ReleaseEnvelope,
|
||||
manifest: ReleaseManifest,
|
||||
}
|
||||
async fn request(
|
||||
client: &reqwest::Client,
|
||||
address: SocketAddr,
|
||||
trust: &Trust,
|
||||
clock: &TrustedClock,
|
||||
) -> Result<Report> {
|
||||
ensure!(clock.trusted(), "UPDATE_CATALOG_CLOCK_UNTRUSTED");
|
||||
let bytes = fetch(client, address).await?;
|
||||
ensure!(clock.trusted(), "UPDATE_CATALOG_CLOCK_UNTRUSTED");
|
||||
for file in &trust.files {
|
||||
file.recheck()?;
|
||||
}
|
||||
trust.response(&bytes, Utc::now())
|
||||
}
|
||||
|
||||
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",
|
||||
crate::https_channel::server_name()?,
|
||||
address.port()
|
||||
))
|
||||
.send()
|
||||
.await?;
|
||||
crate::https_channel::bounded_body(response, RESPONSE_LIMIT, "application/json").await
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||
use openssl::{
|
||||
pkey::Private,
|
||||
sign::Signer,
|
||||
ssl::{SslAcceptor, SslMethod, SslVerifyMode},
|
||||
};
|
||||
use rmm_domain::{
|
||||
agent_update::{ArtifactDescriptor, ArtifactRole},
|
||||
agent_update_provisioning::{ActivationEvidence, SignedBaselineRecord},
|
||||
};
|
||||
use serde_json::json;
|
||||
use std::{
|
||||
io::Write,
|
||||
net::TcpListener,
|
||||
os::unix::fs::{PermissionsExt, symlink},
|
||||
};
|
||||
|
||||
fn envelope(
|
||||
key: &PKey<Private>,
|
||||
sequence: u64,
|
||||
protocol: u32,
|
||||
state: u32,
|
||||
expires: u64,
|
||||
) -> ReleaseEnvelope {
|
||||
let manifest = ReleaseManifest {
|
||||
schema_version: 1,
|
||||
release_id: Uuid::from_u128(sequence.into()),
|
||||
release_sequence: sequence,
|
||||
version: format!("test-{sequence}"),
|
||||
platform: Platform::LinuxX64,
|
||||
published_at: 1,
|
||||
expires_at: expires,
|
||||
protocol_major: protocol,
|
||||
state_schema: state,
|
||||
minimum_updater_version: 1,
|
||||
artifacts: [
|
||||
ArtifactDescriptor {
|
||||
role: ArtifactRole::Agent,
|
||||
artifact_id: Uuid::from_u128(100),
|
||||
sha256: hash(b"test agent"),
|
||||
bytes: 10,
|
||||
},
|
||||
ArtifactDescriptor {
|
||||
role: ArtifactRole::Helper,
|
||||
artifact_id: Uuid::from_u128(101),
|
||||
sha256: hash(b"test helper"),
|
||||
bytes: 11,
|
||||
},
|
||||
],
|
||||
};
|
||||
let raw = serde_json::to_vec(&manifest).unwrap();
|
||||
let mut signed = rmm_updater::RELEASE_SIGNATURE_DOMAIN.to_vec();
|
||||
signed.extend_from_slice(&raw);
|
||||
ReleaseEnvelope {
|
||||
schema_version: 1,
|
||||
key_id: hash(&key.raw_public_key().unwrap()),
|
||||
payload_bytes: URL_SAFE_NO_PAD.encode(raw),
|
||||
signature: URL_SAFE_NO_PAD.encode(
|
||||
Signer::new_without_digest(key)
|
||||
.unwrap()
|
||||
.sign_oneshot_to_vec(&signed)
|
||||
.unwrap(),
|
||||
),
|
||||
}
|
||||
}
|
||||
struct Fixture {
|
||||
trust: Trust,
|
||||
key: PKey<Private>,
|
||||
binding: Binding,
|
||||
policy: Vec<u8>,
|
||||
keys: Vec<u8>,
|
||||
record: Vec<u8>,
|
||||
}
|
||||
fn fixture() -> Fixture {
|
||||
let key = PKey::generate_ed25519().unwrap();
|
||||
let binding = Binding {
|
||||
tenant_id: Uuid::new_v4(),
|
||||
asset_id: Uuid::new_v4(),
|
||||
agent_id: Uuid::new_v4(),
|
||||
enrollment_generation: 1,
|
||||
assignment_version: 2,
|
||||
public_key_hex: hex::encode(
|
||||
PKey::generate_ed25519().unwrap().raw_public_key().unwrap(),
|
||||
),
|
||||
};
|
||||
let release = envelope(&key, 7, 1, 1, u64::MAX);
|
||||
let record = InstalledReleaseRecord {
|
||||
schema_version: 1,
|
||||
profile: "decoder_compatible_handoff_v1".into(),
|
||||
platform: Platform::LinuxX64,
|
||||
manifest_sha256: hash(&release.decode().unwrap().payload_bytes),
|
||||
release_envelope: release,
|
||||
activation_floor: 7,
|
||||
activated_at: 2,
|
||||
previous_record_sha256: None,
|
||||
activation_evidence: ActivationEvidence::Bootstrap {
|
||||
qualification_receipt_sha256: hash(b"synthetic qualification"),
|
||||
},
|
||||
rolled_back: false,
|
||||
}
|
||||
.bytes()
|
||||
.unwrap();
|
||||
let mut signed = BASELINE_SIGNATURE_DOMAIN.to_vec();
|
||||
signed.extend_from_slice(&record);
|
||||
let baseline = SignedBaselineRecord {
|
||||
schema_version: 1,
|
||||
key_id: hash(&key.raw_public_key().unwrap()),
|
||||
payload_bytes: URL_SAFE_NO_PAD.encode(&record),
|
||||
signature: URL_SAFE_NO_PAD.encode(
|
||||
Signer::new_without_digest(&key)
|
||||
.unwrap()
|
||||
.sign_oneshot_to_vec(&signed)
|
||||
.unwrap(),
|
||||
),
|
||||
};
|
||||
let keys = serde_json::to_vec(&json!({"schema_version":1,"generation":4,"keys":[{"public_key_hex":hex::encode(key.raw_public_key().unwrap()),"platform":"x86_64-unknown-linux-gnu","first_sequence":1,"last_sequence":20,"revoked":false}]})).unwrap();
|
||||
let policy = serde_json::to_vec(&json!({"schema_version":1,"profile":"linux_general_full_v1","tenant_id":binding.tenant_id,"asset_id":binding.asset_id,"agent_id":binding.agent_id,"enrollment_generation":1,"assignment_version":2,
|
||||
"ledger_path":"/var/lib/rmm-helper/consumption.sqlite","lock_path":"/var/lib/rmm-helper/executor.lock","installed_record_path":RECORD,"keyring_path":KEYRING,"health_pin_path":"/etc/rmm-agent-updater/health-key.json","registry_path":"/etc/rmm-agent-updater/reader-registry.json","reader_registry_sha256":hash(b"fixture registry"),
|
||||
"services":[{"unit":"rmm-agent-remote.service","unit_sha256":hash(b"agent")},{"unit":"rmm-helper-cloud.service","unit_sha256":hash(b"general")},{"unit":"rmm-full-maintenance-helper.service","unit_sha256":hash(b"full")}],"updater_service":{"unit":"rmm-agent-updater.service","unit_sha256":hash(b"updater unit")},"updater_binary_sha256":hash(b"updater"),"initial_baseline":baseline,"initial_record_sha256":hash(&record),"initial_manifest_sha256":InstalledReleaseRecord::from_bytes(&record).unwrap().manifest_sha256,"initial_activation_floor":7})).unwrap();
|
||||
let trust = Trust::verify(&binding, &policy, &keys, &record).unwrap();
|
||||
Fixture {
|
||||
trust,
|
||||
key,
|
||||
binding,
|
||||
policy,
|
||||
keys,
|
||||
record,
|
||||
}
|
||||
}
|
||||
fn response(envelope: ReleaseEnvelope) -> Vec<u8> {
|
||||
serde_json::to_vec(&json!({"status":"available","release":{"manifest":envelope.decode().unwrap().manifest,"release_envelope":envelope},"observed_at":Utc::now(),"server_time":Utc::now(),"job_created":false})).unwrap()
|
||||
}
|
||||
#[test]
|
||||
fn catalog_binds_real_release_signatures_floor_protocol_expiry_and_separate_baseline() {
|
||||
let f = fixture();
|
||||
let now = Utc::now();
|
||||
assert_eq!(
|
||||
f.trust
|
||||
.response(&response(envelope(&f.key, 8, 1, 1, u64::MAX)), now)
|
||||
.unwrap()
|
||||
.status,
|
||||
Status::Available
|
||||
);
|
||||
assert_eq!(
|
||||
f.trust
|
||||
.response(&response(envelope(&f.key, 7, 1, 1, u64::MAX)), now)
|
||||
.unwrap()
|
||||
.status,
|
||||
Status::Current
|
||||
);
|
||||
for release in [
|
||||
envelope(&f.key, 6, 1, 1, u64::MAX),
|
||||
envelope(&f.key, 8, 2, 1, u64::MAX),
|
||||
envelope(&f.key, 8, 1, 2, u64::MAX),
|
||||
envelope(&f.key, 8, 1, 1, 10),
|
||||
] {
|
||||
assert!(f.trust.response(&response(release), now).is_err());
|
||||
}
|
||||
let mut bad = envelope(&f.key, 8, 1, 1, u64::MAX);
|
||||
let mut signature = URL_SAFE_NO_PAD.decode(&bad.signature).unwrap();
|
||||
signature[0] ^= 1;
|
||||
bad.signature = URL_SAFE_NO_PAD.encode(signature);
|
||||
assert!(f.trust.response(&response(bad), now).is_err());
|
||||
let mut keys: serde_json::Value = serde_json::from_slice(&f.keys).unwrap();
|
||||
keys["keys"][0]["revoked"] = json!(true);
|
||||
assert!(
|
||||
Trust::verify(
|
||||
&f.binding,
|
||||
&f.policy,
|
||||
&serde_json::to_vec(&keys).unwrap(),
|
||||
&f.record
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
let mut policy: serde_json::Value = serde_json::from_slice(&f.policy).unwrap();
|
||||
policy["initial_baseline"]["signature"] = json!("A".repeat(86));
|
||||
assert!(
|
||||
Trust::verify(
|
||||
&f.binding,
|
||||
&serde_json::to_vec(&policy).unwrap(),
|
||||
&f.keys,
|
||||
&f.record
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
let mut binding = f.binding.clone();
|
||||
binding.public_key_hex = hex::encode(f.key.raw_public_key().unwrap());
|
||||
assert!(Trust::verify(&binding, &f.policy, &f.keys, &f.record).is_err());
|
||||
}
|
||||
#[test]
|
||||
fn catalog_rejects_unsigned_view_extra_fields_and_unqualified_record_floor() {
|
||||
let f = fixture();
|
||||
let now = Utc::now();
|
||||
let raw = response(envelope(&f.key, 8, 1, 1, u64::MAX));
|
||||
for field in ["job", "view", "unknown", "missing"] {
|
||||
let mut changed: serde_json::Value = serde_json::from_slice(&raw).unwrap();
|
||||
match field {
|
||||
"job" => changed["job_created"] = json!(true),
|
||||
"view" => changed["release"]["manifest"]["version"] = json!("unsigned"),
|
||||
"unknown" => changed["trusted"] = json!(true),
|
||||
_ => changed["release"] = serde_json::Value::Null,
|
||||
}
|
||||
assert!(
|
||||
f.trust
|
||||
.response(&serde_json::to_vec(&changed).unwrap(), now)
|
||||
.is_err()
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
f.trust
|
||||
.response(&vec![b' '; RESPONSE_LIMIT + 1], now)
|
||||
.is_err()
|
||||
);
|
||||
let mut record = InstalledReleaseRecord::from_bytes(&f.record).unwrap();
|
||||
record.activated_at += 1;
|
||||
assert!(Trust::verify(&f.binding, &f.policy, &f.keys, &record.bytes().unwrap()).is_err());
|
||||
let mut binding = f.binding.clone();
|
||||
binding.assignment_version += 1;
|
||||
assert!(Trust::verify(&binding, &f.policy, &f.keys, &f.record).is_err());
|
||||
let empty = serde_json::to_vec(&json!({"status":"not_configured","release":null,"observed_at":now,"server_time":now,"job_created":false})).unwrap();
|
||||
assert_eq!(
|
||||
f.trust.response(&empty, now).unwrap().status,
|
||||
Status::NotConfigured
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn public_anchors_are_read_only_protected_and_missing_configuration_never_builds_client() {
|
||||
// Normal unprivileged cargo test exercises rejection without requiring
|
||||
// chown/sudo. An isolated root run additionally covers the genuine
|
||||
// protected positive file/recheck branch; report that coverage separately.
|
||||
let root_fixture = unsafe { libc::geteuid() } == 0;
|
||||
let root = if root_fixture {
|
||||
PathBuf::from("/run")
|
||||
} else {
|
||||
std::env::temp_dir()
|
||||
}
|
||||
.join(format!("rmm-catalog-test-{}", Uuid::new_v4()));
|
||||
std::fs::create_dir(&root).unwrap();
|
||||
std::fs::set_permissions(&root, std::fs::Permissions::from_mode(0o700)).unwrap();
|
||||
let path = root.join("public.json");
|
||||
std::fs::write(&path, b"public synthetic trust bytes").unwrap();
|
||||
std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o600)).unwrap();
|
||||
let before = std::fs::metadata(&path).unwrap();
|
||||
if !root_fixture {
|
||||
assert!(Protected::read(&path, 128).is_err());
|
||||
assert_eq!(before.ino(), std::fs::metadata(&path).unwrap().ino());
|
||||
std::fs::remove_dir_all(&root).unwrap();
|
||||
} else {
|
||||
let held = Protected::read(&path, 128).unwrap();
|
||||
held.recheck().unwrap();
|
||||
assert_eq!(before.ino(), std::fs::metadata(&path).unwrap().ino());
|
||||
let alias = root.join("alias");
|
||||
symlink(&path, &alias).unwrap();
|
||||
assert!(Protected::read(&alias, 128).is_err());
|
||||
std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o622)).unwrap();
|
||||
assert!(Protected::read(&path, 128).is_err());
|
||||
std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o600)).unwrap();
|
||||
std::fs::write(&path, b"different synthetic public bytes").unwrap();
|
||||
assert!(held.recheck().is_err());
|
||||
drop(held);
|
||||
std::fs::remove_dir_all(&root).unwrap();
|
||||
}
|
||||
let mut checker = Checker::default();
|
||||
let report = checker.poll(
|
||||
None,
|
||||
TrustedClock::new(),
|
||||
"127.0.0.1:1".parse().unwrap(),
|
||||
|| panic!("missing anchor must not load device TLS keys"),
|
||||
);
|
||||
assert_eq!(report.status, Status::NotConfigured);
|
||||
let again = checker.poll(
|
||||
None,
|
||||
TrustedClock::new(),
|
||||
"127.0.0.1:1".parse().unwrap(),
|
||||
|| panic!("cadence must not create client"),
|
||||
);
|
||||
assert_eq!(report.checked_at, again.checked_at);
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn actual_mtls_catalog_fetch_keeps_fixed_route_and_bounds_untrusted_http() {
|
||||
let f = fixture();
|
||||
let name = crate::https_channel::server_name().unwrap();
|
||||
let (ca, ca_key) = crate::runtime_tests::certificate("catalog test CA", None, false);
|
||||
let (server, server_key) =
|
||||
crate::runtime_tests::certificate(&name, Some((&ca, &ca_key)), true);
|
||||
let (device, device_key) =
|
||||
crate::runtime_tests::certificate("catalog test device", Some((&ca, &ca_key)), false);
|
||||
let cases = [
|
||||
("200 OK", response(envelope(&f.key, 8, 1, 1, u64::MAX))),
|
||||
("302 Found", b"no redirect".to_vec()),
|
||||
("200 OK", vec![b'x'; RESPONSE_LIMIT + 1]),
|
||||
];
|
||||
for (index, (status, body)) in cases.into_iter().enumerate() {
|
||||
let mut acceptor = SslAcceptor::mozilla_intermediate(SslMethod::tls_server()).unwrap();
|
||||
acceptor.set_certificate(&server).unwrap();
|
||||
acceptor.set_private_key(&server_key).unwrap();
|
||||
acceptor.cert_store_mut().add_cert(ca.clone()).unwrap();
|
||||
acceptor.set_verify(SslVerifyMode::PEER | SslVerifyMode::FAIL_IF_NO_PEER_CERT);
|
||||
let acceptor = acceptor.build();
|
||||
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
|
||||
let address = listener.local_addr().unwrap();
|
||||
let worker = std::thread::spawn(move || {
|
||||
let (socket, _) = listener.accept().unwrap();
|
||||
socket
|
||||
.set_read_timeout(Some(Duration::from_secs(5)))
|
||||
.unwrap();
|
||||
let mut tls = acceptor.accept(socket).unwrap();
|
||||
assert!(tls.ssl().peer_certificate().is_some());
|
||||
let mut request = Vec::new();
|
||||
let mut byte = [0];
|
||||
while !request.ends_with(b"\r\n\r\n") {
|
||||
tls.read_exact(&mut byte).unwrap();
|
||||
request.push(byte[0]);
|
||||
assert!(request.len() < 8192);
|
||||
}
|
||||
let headers = String::from_utf8(request).unwrap();
|
||||
assert!(headers.starts_with(
|
||||
"GET /agent/v1/releases/current?platform=x86_64-unknown-linux-gnu HTTP/1.1\r\n"
|
||||
));
|
||||
assert!(!headers.to_ascii_lowercase().contains("authorization:"));
|
||||
let wire = format!(
|
||||
"HTTP/1.1 {status}\r\nContent-Type: application/json\r\nContent-Length: {}\r\nLocation: https://unexpected.invalid/\r\nConnection: close\r\n\r\n",
|
||||
body.len()
|
||||
);
|
||||
tls.write_all(wire.as_bytes()).unwrap();
|
||||
let _ = tls.write_all(&body);
|
||||
});
|
||||
let client = crate::https_channel::mtls_client(
|
||||
address,
|
||||
&ca.to_pem().unwrap(),
|
||||
&device.to_pem().unwrap(),
|
||||
&device_key.private_key_to_pem_pkcs8().unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
let result = fetch(&client, address).await;
|
||||
if index == 0 {
|
||||
assert_eq!(
|
||||
f.trust
|
||||
.response(&result.unwrap(), Utc::now())
|
||||
.unwrap()
|
||||
.status,
|
||||
Status::Available
|
||||
);
|
||||
} else {
|
||||
assert!(result.is_err());
|
||||
}
|
||||
worker.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod wire_tests {
|
||||
use super::*;
|
||||
use prost::Message;
|
||||
use rmm_protocol::{Envelope, InventorySnapshot, Payload};
|
||||
use serde_json::json;
|
||||
use sha2::Digest;
|
||||
#[test]
|
||||
fn catalog_wire_shape_is_accepted_by_original_linux_observation_contract() {
|
||||
let original = include_bytes!("../../../tests/agent_update/catalog-check-inventory.json");
|
||||
let now = "2026-11-15T12:00:00Z".parse().unwrap();
|
||||
let stored =
|
||||
rmm_domain::inventory_document::validate_for_scope(original, now, "linux.base")
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
stored,
|
||||
serde_json::from_slice::<serde_json::Value>(original).unwrap()
|
||||
);
|
||||
let report: Report =
|
||||
serde_json::from_value(stored["observations"][0]["data"].clone()).unwrap();
|
||||
let document = serde_json::to_vec(&report).unwrap();
|
||||
assert_eq!(serde_json::from_slice::<Report>(&document).unwrap(), report);
|
||||
assert!(report.validate(now, now));
|
||||
}
|
||||
#[test]
|
||||
fn normal_linux_snapshot_carries_cached_check_through_existing_scope_without_restamping_it() {
|
||||
let now = Utc::now();
|
||||
let report = Report {
|
||||
schema_version: 1,
|
||||
source_id: "mtls:release-catalog-v1".into(),
|
||||
checked_at: now - chrono::Duration::hours(2),
|
||||
status: Status::Unavailable,
|
||||
candidate: None,
|
||||
};
|
||||
let base = json!({"os":"Linux","hostname":"synthetic-codec","architecture":"x86_64","root_total_bytes":2,"root_available_bytes":1,"root_available_inodes":1,
|
||||
"collection_started_at":now,"collection_completed_at":now,"observations":[observation(report.clone(),now)]});
|
||||
let data = serde_json::to_vec(&base).unwrap();
|
||||
let envelope = Envelope {
|
||||
protocol_major: 1,
|
||||
protocol_minor: 0,
|
||||
message_id: Uuid::new_v4().to_string(),
|
||||
agent_id: Uuid::new_v4().to_string(),
|
||||
enrollment_generation: 1,
|
||||
connection_generation: 1,
|
||||
boot_id: Uuid::new_v4().to_string(),
|
||||
sequence: 1,
|
||||
observed_at: now.timestamp_millis(),
|
||||
payload: Some(Payload::InventorySnapshot(InventorySnapshot {
|
||||
snapshot_id: Uuid::new_v4().to_string(),
|
||||
scope: "linux.base".into(),
|
||||
schema_version: 1,
|
||||
chunk_index: 0,
|
||||
chunk_count: 1,
|
||||
sha256: sha2::Sha256::digest(&data).to_vec(),
|
||||
data,
|
||||
completeness: "partial".into(),
|
||||
})),
|
||||
};
|
||||
let decoded = Envelope::decode(envelope.encode_to_vec().as_slice()).unwrap();
|
||||
let Some(Payload::InventorySnapshot(snapshot)) = decoded.payload else {
|
||||
panic!("snapshot")
|
||||
};
|
||||
let stored = rmm_domain::inventory_document::validate_for_scope(
|
||||
&snapshot.data,
|
||||
now,
|
||||
&snapshot.scope,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(stored, base);
|
||||
assert_eq!(
|
||||
stored["observations"][0]["data"]["checked_at"],
|
||||
json!(report.checked_at)
|
||||
);
|
||||
// Exact pre-existing outer keys/scopes: old validators already support
|
||||
// bounded generic linux.* observations; no agent.update extension is sent.
|
||||
assert!(!stored.as_object().unwrap().contains_key("catalog_check"));
|
||||
assert_eq!(
|
||||
stored["observations"][0]["scope"],
|
||||
"linux.agent_update.catalog"
|
||||
);
|
||||
for field in ["candidate", "schema", "time", "unknown"] {
|
||||
let mut bad = base.clone();
|
||||
match field {
|
||||
"candidate" => bad["observations"][0]["data"]["candidate"] = json!({}),
|
||||
"schema" => bad["observations"][0]["data"]["schema_version"] = json!(2),
|
||||
"time" => {
|
||||
bad["observations"][0]["data"]["checked_at"] =
|
||||
json!(now + chrono::Duration::seconds(2))
|
||||
}
|
||||
_ => bad["observations"][0]["data"]["ready"] = json!(true),
|
||||
}
|
||||
assert!(
|
||||
rmm_domain::inventory_document::validate_for_scope(
|
||||
&serde_json::to_vec(&bad).unwrap(),
|
||||
now,
|
||||
"linux.base"
|
||||
)
|
||||
.is_err(),
|
||||
"catalog field must be denied: {field}"
|
||||
);
|
||||
}
|
||||
let original = json!({"agent_update":rmm_domain::agent_update::AgentUpdateObservation::not_configured(Platform::LinuxX64,now)});
|
||||
assert!(
|
||||
rmm_domain::inventory_document::validate_for_scope(
|
||||
&serde_json::to_vec(&original).unwrap(),
|
||||
now,
|
||||
"agent.update"
|
||||
)
|
||||
.is_ok()
|
||||
);
|
||||
let mut no_catalog = base;
|
||||
no_catalog.as_object_mut().unwrap().remove("observations");
|
||||
no_catalog
|
||||
.as_object_mut()
|
||||
.unwrap()
|
||||
.remove("collection_started_at");
|
||||
no_catalog
|
||||
.as_object_mut()
|
||||
.unwrap()
|
||||
.remove("collection_completed_at");
|
||||
assert!(
|
||||
rmm_domain::inventory_document::validate_for_scope(
|
||||
&serde_json::to_vec(&no_catalog).unwrap(),
|
||||
now,
|
||||
"linux.base"
|
||||
)
|
||||
.is_ok()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
mod agent_update_catalog;
|
||||
mod agent_update_health;
|
||||
mod apt;
|
||||
mod bootstrap;
|
||||
@@ -61,7 +60,6 @@ struct Agent<C: reconcile::SyncClock = reconcile::NativeClock> {
|
||||
mode: wire_channel::Mode,
|
||||
certificates: certificate_rotation::RotationStore,
|
||||
rotation_policy: certificate_rotation::RotationPolicy,
|
||||
catalog: agent_update_catalog::Checker,
|
||||
}
|
||||
#[derive(Default)]
|
||||
struct EffectFence {
|
||||
@@ -497,9 +495,7 @@ impl<C: reconcile::SyncClock> Agent<C> {
|
||||
let sender = self.inventory_tx.clone();
|
||||
let extended = env::var("RMM_EXTENDED_INVENTORY").unwrap_or_else(|_| "1".into()) == "1";
|
||||
let binding = self.binding.clone();
|
||||
let catalog = self.catalog.cached(Utc::now());
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let collected_at = Utc::now();
|
||||
let result = rmm_agent_linux::wire::snapshot(extended).and_then(|mut inventory| {
|
||||
if extended {
|
||||
inventory["observations"]
|
||||
@@ -508,17 +504,6 @@ impl<C: reconcile::SyncClock> Agent<C> {
|
||||
.push(apt::planning_observation(binding.as_ref()));
|
||||
inventory["collection_completed_at"] = serde_json::json!(Utc::now());
|
||||
}
|
||||
if let Some(report) = catalog {
|
||||
if inventory.get("observations").is_none() {
|
||||
inventory["observations"] = serde_json::json!([]);
|
||||
inventory["collection_started_at"] = serde_json::json!(collected_at);
|
||||
}
|
||||
inventory["observations"]
|
||||
.as_array_mut()
|
||||
.context("INVENTORY_OBSERVATIONS")?
|
||||
.push(agent_update_catalog::observation(report, Utc::now()));
|
||||
inventory["collection_completed_at"] = serde_json::json!(Utc::now());
|
||||
}
|
||||
let bytes = serde_json::to_vec(&inventory)?;
|
||||
ensure!(bytes.len() <= 512 * 1024, "INVENTORY_WIRE_LIMIT");
|
||||
Ok((bytes, Utc::now().timestamp_millis()))
|
||||
@@ -537,19 +522,6 @@ impl<C: reconcile::SyncClock> Agent<C> {
|
||||
rmm_domain::agent_update::Platform::LinuxX64,
|
||||
Utc::now(),
|
||||
);
|
||||
let address = self.address;
|
||||
let ca = &self.ca;
|
||||
let certificates = &self.certificates;
|
||||
self.catalog
|
||||
.poll(self.binding.as_ref(), self.clock.clone(), address, || {
|
||||
let identity = certificates.current(Utc::now().timestamp())?;
|
||||
https_channel::mtls_client(
|
||||
address,
|
||||
ca,
|
||||
&identity.certificate_pem,
|
||||
&identity.private_key_pem,
|
||||
)
|
||||
});
|
||||
let data = serde_json::to_vec(&serde_json::json!({"agent_update":observation}))?;
|
||||
let envelope = self.envelope(
|
||||
generation,
|
||||
@@ -1016,7 +988,6 @@ async fn main() -> Result<()> {
|
||||
mode,
|
||||
certificates,
|
||||
rotation_policy,
|
||||
catalog: agent_update_catalog::Checker::default(),
|
||||
};
|
||||
agent.recover_interrupted()?;
|
||||
let mut backoff = 1_u64;
|
||||
|
||||
@@ -150,7 +150,6 @@ fn new_process_persists_interruption_before_helper_io_without_unlock_or_repeat()
|
||||
mode: wire_channel::Mode::Wss,
|
||||
certificates,
|
||||
rotation_policy: certificate_rotation::RotationPolicy::default(),
|
||||
catalog: agent_update_catalog::Checker::default(),
|
||||
};
|
||||
// A forged local consumption/start cannot become a purported grant result.
|
||||
agent
|
||||
@@ -220,7 +219,7 @@ impl reconcile::SyncClock for Clock {
|
||||
Ok(Utc::now())
|
||||
}
|
||||
}
|
||||
pub(super) fn certificate(
|
||||
fn certificate(
|
||||
name: &str,
|
||||
issuer: Option<(&X509, &PKey<openssl::pkey::Private>)>,
|
||||
server: bool,
|
||||
@@ -538,7 +537,6 @@ async fn run(mode: wire_channel::Mode, trusted: bool, forged: bool, rounds: u64)
|
||||
mode,
|
||||
certificates,
|
||||
rotation_policy: certificate_rotation::RotationPolicy::default(),
|
||||
catalog: agent_update_catalog::Checker::default(),
|
||||
};
|
||||
for _ in 0..rounds {
|
||||
assert!(
|
||||
|
||||
@@ -780,63 +780,3 @@ pub fn job_health_public_key(job: &crate::jobs::JobPayload) -> Result<[u8; 32],
|
||||
.try_into()
|
||||
.map_err(|_| "UPDATE_HEALTH_KEY")
|
||||
}
|
||||
|
||||
/// Diagnostic catalog metadata inside the existing linux.base observations
|
||||
/// vector. This is never an AgentUpdateObservation/CandidatePreview or authority.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CatalogCheckStatus {
|
||||
NotConfigured,
|
||||
Unavailable,
|
||||
Available,
|
||||
Current,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct CatalogCandidate {
|
||||
pub release_id: Uuid,
|
||||
pub release_sequence: u64,
|
||||
pub version: String,
|
||||
pub manifest_sha256: String,
|
||||
pub keyring_generation: u64,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct CatalogCheckReport {
|
||||
pub schema_version: u32,
|
||||
pub source_id: String,
|
||||
/// Actual authenticated check, not the later cache/inventory collection.
|
||||
pub checked_at: chrono::DateTime<chrono::Utc>,
|
||||
pub status: CatalogCheckStatus,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub candidate: Option<CatalogCandidate>,
|
||||
}
|
||||
impl CatalogCheckReport {
|
||||
pub fn validate(
|
||||
&self,
|
||||
collected_at: chrono::DateTime<chrono::Utc>,
|
||||
now: chrono::DateTime<chrono::Utc>,
|
||||
) -> bool {
|
||||
self.schema_version == 1
|
||||
&& self.source_id == "mtls:release-catalog-v1"
|
||||
&& self.checked_at <= collected_at + chrono::Duration::seconds(1)
|
||||
&& self.checked_at <= now + chrono::Duration::seconds(45)
|
||||
&& self.checked_at >= now - chrono::Duration::hours(72)
|
||||
&& match (&self.status, &self.candidate) {
|
||||
(CatalogCheckStatus::Available | CatalogCheckStatus::Current, Some(candidate)) => {
|
||||
!candidate.release_id.is_nil()
|
||||
&& candidate.release_sequence > 0
|
||||
&& candidate.keyring_generation > 0
|
||||
&& digest(&candidate.manifest_sha256)
|
||||
&& !candidate.version.is_empty()
|
||||
&& candidate.version.len() <= 64
|
||||
&& candidate
|
||||
.version
|
||||
.bytes()
|
||||
.all(|b| b.is_ascii_alphanumeric() || b".-+_".contains(&b))
|
||||
}
|
||||
(CatalogCheckStatus::NotConfigured | CatalogCheckStatus::Unavailable, None) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,26 +150,6 @@ pub fn validate_for_scope(
|
||||
.data
|
||||
.get("host_reboot_required")
|
||||
.is_some_and(|v| !v.is_boolean());
|
||||
if o.scope == "linux.agent_update.catalog" {
|
||||
let report: crate::agent_update::CatalogCheckReport =
|
||||
serde_json::from_value(o.data.clone())
|
||||
.map_err(|_| "INVALID_AGENT_UPDATE_CATALOG_REPORT")?;
|
||||
let quality = match report.status {
|
||||
crate::agent_update::CatalogCheckStatus::Available
|
||||
| crate::agent_update::CatalogCheckStatus::Current => "valid",
|
||||
crate::agent_update::CatalogCheckStatus::NotConfigured => "unknown",
|
||||
crate::agent_update::CatalogCheckStatus::Unavailable => "error",
|
||||
};
|
||||
if scope != "linux.base"
|
||||
|| o.source_id != "agent:cached-release-catalog-v1"
|
||||
|| o.quality != quality
|
||||
|| o.completeness != "complete"
|
||||
|| o.truncated
|
||||
|| !report.validate(o.observed_at, now)
|
||||
{
|
||||
return Err("INVALID_AGENT_UPDATE_CATALOG_REPORT");
|
||||
}
|
||||
}
|
||||
if !o.scope.starts_with(prefix)
|
||||
|| o.scope.len() > 64
|
||||
|| !(o
|
||||
|
||||
@@ -520,36 +520,8 @@ mod tests {
|
||||
os::unix::fs::OpenOptionsExt,
|
||||
time::Duration,
|
||||
};
|
||||
// The production census correctly denies a changing descriptor table.
|
||||
// Other parallel unit tests open/close files in this same test process;
|
||||
// exercise each actual /proc fixture in a separate exact-test process.
|
||||
fn in_isolated_fixture(name: &str) -> bool {
|
||||
const CHILD: &str = "RMM_CENSUS_EXACT_TEST_PROCESS";
|
||||
if std::env::var_os(CHILD).as_deref() == Some(std::ffi::OsStr::new(name)) {
|
||||
return true;
|
||||
}
|
||||
let output = std::process::Command::new(std::env::current_exe().unwrap())
|
||||
.args(["--exact", name, "--test-threads=1"])
|
||||
.env(CHILD, name)
|
||||
.output()
|
||||
.unwrap();
|
||||
assert!(
|
||||
output.status.success()
|
||||
&& String::from_utf8_lossy(&output.stdout).contains("1 passed; 0 failed"),
|
||||
"isolated census fixture: {:?}\n{}\n{}",
|
||||
output.status.code(),
|
||||
String::from_utf8_lossy(&output.stdout),
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
false
|
||||
}
|
||||
#[test]
|
||||
fn private_thread_fd_table_cannot_hide_a_reader_from_the_group_probe() {
|
||||
if !in_isolated_fixture(
|
||||
"census_process::tests::private_thread_fd_table_cannot_hide_a_reader_from_the_group_probe",
|
||||
) {
|
||||
return;
|
||||
}
|
||||
assert_eq!(unsafe { libc::geteuid() }, 0);
|
||||
let path = std::path::Path::new("/run")
|
||||
.join(format!("rmm-census-thread-{}", uuid::Uuid::new_v4()));
|
||||
@@ -653,11 +625,6 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn actual_proc_probe_detects_existing_descriptors_and_mapped_inode_without_exporting_paths() {
|
||||
if !in_isolated_fixture(
|
||||
"census_process::tests::actual_proc_probe_detects_existing_descriptors_and_mapped_inode_without_exporting_paths",
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// An isolated network-none container process, not a host-wide scan,
|
||||
// service/namespace qualification or admission-positive fixture.
|
||||
assert_eq!(unsafe { libc::geteuid() }, 0);
|
||||
|
||||
@@ -81,13 +81,7 @@ pub fn verify_history(
|
||||
let mut signed = BASELINE_SIGNATURE_DOMAIN.to_vec();
|
||||
signed.extend_from_slice(&initial.payload_bytes);
|
||||
verifier.verify_strict(&signed, &Signature::from_bytes(&initial.signature))?;
|
||||
verify_record_release(
|
||||
&keyring,
|
||||
protected_keyring.generation,
|
||||
&initial.record,
|
||||
initial_release.manifest.protocol_major,
|
||||
initial_release.manifest.state_schema,
|
||||
)?;
|
||||
verify_record_release(&keyring, protected_keyring.generation, &initial.record)?;
|
||||
|
||||
ensure!(
|
||||
predecessor_records.len() < MAX_RECORDS
|
||||
@@ -162,13 +156,7 @@ pub fn verify_history(
|
||||
&& record.activated_at >= parent.activated_at,
|
||||
"UPDATE_HISTORY_FLOOR_OR_ROLLBACK"
|
||||
);
|
||||
verify_record_release(
|
||||
&keyring,
|
||||
protected_keyring.generation,
|
||||
record,
|
||||
initial_release.manifest.protocol_major,
|
||||
initial_release.manifest.state_schema,
|
||||
)?;
|
||||
verify_record_release(&keyring, protected_keyring.generation, record)?;
|
||||
let grant = verify_update(db, guard, binding, raw, record, parent_digest, parent)?;
|
||||
ensure!(grants.insert(grant), "UPDATE_HISTORY_REUSED_GRANT");
|
||||
ensure!(*digest == hash(raw), "UPDATE_HISTORY_RECORD_CHANGED");
|
||||
@@ -292,8 +280,6 @@ fn verify_record_release(
|
||||
keys: &UpdateKeyring,
|
||||
generation: u64,
|
||||
record: &InstalledReleaseRecord,
|
||||
baseline_protocol_major: u32,
|
||||
baseline_state_schema: u32,
|
||||
) -> Result<()> {
|
||||
ensure!(
|
||||
!record.rolled_back,
|
||||
@@ -320,11 +306,8 @@ fn verify_record_release(
|
||||
platform,
|
||||
now_utc_seconds: record.activated_at,
|
||||
keyring_generation: generation,
|
||||
// Anchor compatibility to the separately signed, qualified
|
||||
// bootstrap. A signed successor cannot attest its own decoder
|
||||
// compatibility by supplying both sides of this comparison.
|
||||
protocol_major: baseline_protocol_major,
|
||||
state_schema: baseline_state_schema,
|
||||
protocol_major: decoded.manifest.protocol_major,
|
||||
state_schema: decoded.manifest.state_schema,
|
||||
updater_version: 1,
|
||||
minimum_release_sequence: record.activation_floor,
|
||||
active_release: Some(ActiveRelease {
|
||||
@@ -803,9 +786,6 @@ mod tests {
|
||||
active: Vec<u8>,
|
||||
}
|
||||
fn fixture() -> Fixture {
|
||||
fixture_target_contract(1, 1)
|
||||
}
|
||||
fn fixture_target_contract(protocol_major: u32, state_schema: u32) -> Fixture {
|
||||
let release = SigningKey::from_bytes(&[71; 32]); // public synthetic TEST seed
|
||||
let jobs = SigningKey::from_bytes(&[72; 32]);
|
||||
let health = SigningKey::from_bytes(&[73; 32]);
|
||||
@@ -821,13 +801,8 @@ mod tests {
|
||||
let Action::UpdateAgent { update } = &mut job.action else {
|
||||
panic!("fixture action")
|
||||
};
|
||||
let mut target_manifest = update.manifest().unwrap();
|
||||
target_manifest.protocol_major = protocol_major;
|
||||
target_manifest.state_schema = state_schema;
|
||||
let target = envelope(target_manifest, 2, &release);
|
||||
let target = envelope(update.manifest().unwrap(), 2, &release);
|
||||
let mut old = target.decode().unwrap().manifest;
|
||||
old.protocol_major = 1;
|
||||
old.state_schema = 1;
|
||||
old.release_id = update.predecessor.release_id;
|
||||
old.artifacts[0].artifact_id = Uuid::from_u128(901);
|
||||
old.artifacts[1].artifact_id = Uuid::from_u128(902);
|
||||
@@ -1429,150 +1404,6 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn signed_successor_cannot_self_attest_compatibility_with_retained_baseline() {
|
||||
// These fixtures contain genuine release, baseline, job and health
|
||||
// signatures and a complete consumed/native publication chain. Only
|
||||
// the successor's decoder contract differs from the original baseline.
|
||||
for (protocol, schema, error) in [
|
||||
(2, 1, "incompatible release protocol"),
|
||||
(1, 2, "incompatible release state schema"),
|
||||
] {
|
||||
let f = fixture_target_contract(protocol, schema);
|
||||
let before = f.db.total_changes();
|
||||
let rejected = verify_history(
|
||||
&f.db,
|
||||
&f.guard,
|
||||
&f.binding,
|
||||
&f.keys,
|
||||
&f.baseline,
|
||||
&[],
|
||||
&f.active,
|
||||
)
|
||||
.unwrap_err();
|
||||
assert!(rejected.to_string().contains(error), "{rejected:#}");
|
||||
assert_eq!(f.db.total_changes(), before);
|
||||
assert_eq!(
|
||||
InstalledReleaseRecord::from_bytes(&f.initial)
|
||||
.unwrap()
|
||||
.activation_floor,
|
||||
1
|
||||
);
|
||||
assert_eq!(
|
||||
InstalledReleaseRecord::from_bytes(&f.active)
|
||||
.unwrap()
|
||||
.activation_floor,
|
||||
2
|
||||
);
|
||||
}
|
||||
let f = fixture();
|
||||
let before = f.db.total_changes();
|
||||
assert_eq!(
|
||||
verify_history(
|
||||
&f.db,
|
||||
&f.guard,
|
||||
&f.binding,
|
||||
&f.keys,
|
||||
&f.baseline,
|
||||
&[],
|
||||
&f.active,
|
||||
)
|
||||
.unwrap()
|
||||
.bytes()
|
||||
.unwrap(),
|
||||
f.active
|
||||
);
|
||||
assert_eq!(f.db.total_changes(), before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retained_predecessor_is_not_a_rollback_receipt_and_unknown_stays_closed() {
|
||||
let f = fixture();
|
||||
// Even a genuine release-signed exact predecessor with the retained
|
||||
// higher floor is only metadata. V1 has no rollback activation witness.
|
||||
let active = InstalledReleaseRecord::from_bytes(&f.active).unwrap();
|
||||
let mut returned = InstalledReleaseRecord::from_bytes(&f.initial).unwrap();
|
||||
returned.activation_floor = active.activation_floor;
|
||||
returned.activated_at = active.activated_at + 1;
|
||||
returned.previous_record_sha256 = Some(hash(&f.active));
|
||||
returned.activation_evidence = active.activation_evidence.clone();
|
||||
returned.rolled_back = true;
|
||||
let returned = returned.bytes().unwrap();
|
||||
let before = f.db.total_changes();
|
||||
assert!(
|
||||
verify_history(
|
||||
&f.db,
|
||||
&f.guard,
|
||||
&f.binding,
|
||||
&f.keys,
|
||||
&f.baseline,
|
||||
std::slice::from_ref(&f.active),
|
||||
&returned,
|
||||
)
|
||||
.unwrap_err()
|
||||
.to_string()
|
||||
.contains("UPDATE_HISTORY_FLOOR_OR_ROLLBACK")
|
||||
);
|
||||
assert!(
|
||||
verify_history(
|
||||
&f.db,
|
||||
&f.guard,
|
||||
&f.binding,
|
||||
&f.keys,
|
||||
&f.baseline,
|
||||
&[],
|
||||
&f.initial,
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert_eq!(f.db.total_changes(), before);
|
||||
assert_eq!(
|
||||
InstalledReleaseRecord::from_bytes(&returned)
|
||||
.unwrap()
|
||||
.activation_floor,
|
||||
2
|
||||
);
|
||||
|
||||
// A previously stored Unknown is never reclassified from a retained
|
||||
// healthy target or a proposed predecessor return. This is a synthetic
|
||||
// local fixture mutation; the verifier itself performs no writes.
|
||||
let unknown = serde_json::to_vec(&Outcome::unknown("synthetic unresolved update")).unwrap();
|
||||
f.db.execute("UPDATE execution_evidence SET outcome=?1", [&unknown])
|
||||
.unwrap();
|
||||
f.db.execute("UPDATE consumed SET result=?1", [&unknown])
|
||||
.unwrap();
|
||||
let before = f.db.total_changes();
|
||||
assert!(
|
||||
verify_history(
|
||||
&f.db,
|
||||
&f.guard,
|
||||
&f.binding,
|
||||
&f.keys,
|
||||
&f.baseline,
|
||||
&[],
|
||||
&f.active,
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert!(
|
||||
verify_history(
|
||||
&f.db,
|
||||
&f.guard,
|
||||
&f.binding,
|
||||
&f.keys,
|
||||
&f.baseline,
|
||||
std::slice::from_ref(&f.active),
|
||||
&returned,
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
let retained: Vec<u8> =
|
||||
f.db.query_row("SELECT outcome FROM execution_evidence", [], |r| r.get(0))
|
||||
.unwrap();
|
||||
assert_eq!(retained, unknown);
|
||||
assert_eq!(f.db.total_changes(), before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completed_history_rejects_file_only_rollback_forks_and_tampered_activation_without_writes() {
|
||||
let f = fixture();
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#requires -Version 5.1
|
||||
#requires -RunAsAdministrator
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)][DateTimeOffset]$PreviousExpiry,
|
||||
[Parameter(Mandatory)][DateTimeOffset]$Until
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$utcNow = [DateTimeOffset]::UtcNow
|
||||
if ($PreviousExpiry -ge $utcNow -or $Until -le $utcNow -or $Until -gt $utcNow.AddHours(4)) {
|
||||
throw 'Expected an expired previous window and a new deadline within four hours.'
|
||||
}
|
||||
$dir = 'C:\ProgramData\RmmDevAccess'
|
||||
$configPath = Join-Path $dir 'bootstrap-public.json'
|
||||
$raw = [IO.File]::ReadAllText($configPath)
|
||||
$cfg = $raw | ConvertFrom-Json
|
||||
$user = Get-LocalUser -Name 'rmm-dev'
|
||||
$task = Get-ScheduledTask -TaskPath '\' -TaskName 'RmmDevReverseTunnel'
|
||||
if ($task.State -ne 'Ready' -or !$user.Enabled -or !$user.AccountExpires -or
|
||||
$user.AccountExpires.ToUniversalTime() -ne $PreviousExpiry.UtcDateTime -or
|
||||
[DateTimeOffset]::Parse($cfg.expires_at) -ne $PreviousExpiry -or
|
||||
$cfg.server -cne 'discovery.ease-technologies.de' -or (Get-Service sshd).Status -ne 'Running') {
|
||||
throw 'Unexpected account, task, server or previous expiry.'
|
||||
}
|
||||
$pinned = (Get-Content -LiteralPath (Join-Path $dir 'known_hosts') -Raw).Trim()
|
||||
if ($pinned -cne ('discovery.ease-technologies.de ' + $cfg.server_host_key)) {
|
||||
throw 'Unexpected SSH host pin.'
|
||||
}
|
||||
$listeners = @(Get-NetTCPConnection -State Listen -LocalPort 22222)
|
||||
if ($listeners.Count -ne 1 -or $listeners[0].LocalAddress -ne '127.0.0.1') {
|
||||
throw 'Expected only the original loopback SSH listener.'
|
||||
}
|
||||
$backup = Join-Path $dir ('console-window-' + [guid]::NewGuid().ToString() + '.bak')
|
||||
$candidate = $backup + '.new'
|
||||
$cfg.expires_at = $Until.ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:sszzz')
|
||||
[IO.File]::WriteAllText($candidate, ($cfg | ConvertTo-Json -Compress), (New-Object Text.UTF8Encoding($false)))
|
||||
$sshArgs = @('-F','NUL','-N','-T','-o','BatchMode=yes','-o','IdentitiesOnly=yes',
|
||||
'-o','ForwardAgent=no','-o','StrictHostKeyChecking=yes','-o','GlobalKnownHostsFile=NUL',
|
||||
'-o',('UserKnownHostsFile=' + $dir + '\known_hosts'),'-o','ExitOnForwardFailure=yes',
|
||||
'-o','ConnectTimeout=10','-o','ServerAliveInterval=15','-o','ServerAliveCountMax=2',
|
||||
'-i',($dir + '\tunnel_ed25519'),'-R','127.0.0.1:22240:127.0.0.1:22222',
|
||||
'rmm-win-tunnel@discovery.ease-technologies.de')
|
||||
$ssh = $null
|
||||
$disabled = $false
|
||||
$accountChanged = $false
|
||||
try {
|
||||
Disable-ScheduledTask -InputObject $task | Out-Null
|
||||
$disabled = $true
|
||||
if ((Get-ScheduledTask -TaskPath '\' -TaskName $task.TaskName).State -ne 'Disabled' -or
|
||||
[IO.File]::ReadAllText($configPath) -cne $raw) { throw 'Existing bootstrap changed.' }
|
||||
[IO.File]::Replace($candidate, $configPath, $backup)
|
||||
Set-LocalUser -SID $user.SID -AccountExpires $Until.LocalDateTime
|
||||
$accountChanged = $true
|
||||
if ((Get-LocalUser -SID $user.SID).AccountExpires.ToUniversalTime() -ne $Until.UtcDateTime) {
|
||||
throw 'Unexpected account expiry after renewal.'
|
||||
}
|
||||
$ssh = Start-Process -FilePath "$env:WINDIR\System32\OpenSSH\ssh.exe" -ArgumentList $sshArgs -PassThru -NoNewWindow
|
||||
if ($ssh.WaitForExit(1500)) { throw "SSH exited with code $($ssh.ExitCode)." }
|
||||
Write-Host "Tunnelfenster gestartet bis $($Until.LocalDateTime). Zum Beenden Strg+C druecken."
|
||||
while ([DateTimeOffset]::UtcNow -lt $Until) {
|
||||
if ($ssh.WaitForExit(500)) { throw "SSH exited with code $($ssh.ExitCode)." }
|
||||
}
|
||||
} finally {
|
||||
if ($null -ne $ssh) {
|
||||
try { if (!$ssh.HasExited) { $ssh.Kill(); $ssh.WaitForExit() } } finally { $ssh.Dispose() }
|
||||
}
|
||||
if ($accountChanged) { Set-LocalUser -SID $user.SID -AccountExpires $PreviousExpiry.LocalDateTime }
|
||||
if (Test-Path -LiteralPath $backup) { [IO.File]::Replace($backup, $configPath, ($backup + '.closed')) }
|
||||
if ($disabled -and [IO.File]::ReadAllText($configPath) -ceq $raw) { Enable-ScheduledTask -InputObject $task | Out-Null }
|
||||
if (Test-Path -LiteralPath $candidate) { Remove-Item -LiteralPath $candidate }
|
||||
}
|
||||
@@ -230,9 +230,3 @@ Use those same arguments with `-Mode Build -ExpectedPreflight <actual-receipt>`.
|
||||
Populate the isolated public Cargo cache explicitly before an offline build;
|
||||
there is no automatic fetch/retry in the builder. Native setup, native MIDL/ABI,
|
||||
unit execution and deployment results are still outstanding until actually run.
|
||||
|
||||
On November 15, 2026 a read-only check on the running Windows test VM found
|
||||
both CBS and Windows Update restart markers, 96 GiB free on C:, no vswhere
|
||||
at its standard installer path, and no rustc on the development user's PATH.
|
||||
No installer was launched. This check does not determine why the markers are
|
||||
present. Receipt `04a56e7d8a8bf00a110558344248fbb0ca0c2234c5c1ea6e347306bcc84d5c55`.
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Prepare the preserving passive Windows pair with fixed actual route evidence.
|
||||
"""Local-only preparation of a new preserving passive Windows code-pair controller.
|
||||
|
||||
Preparation reads only the public expires_at from the current protected access
|
||||
configuration. Before effects the guest must match that same expiration in its
|
||||
existing account and bootstrap-public configuration, with a full first-stop
|
||||
budget and a smaller remaining budget at the second stop. No account/tunnel
|
||||
change, RMM job, reboot or clock configuration is performed by this generator.
|
||||
No SSH, staging or target action is exposed here. The generated controller's
|
||||
enter phase remains closed until a separate reviewed source generation binds
|
||||
actual server source/broker/public-time-key/mTLS-route qualification. Original
|
||||
14fb evidence and Main indices are read-only; no time pins or calibration exist
|
||||
in this package. Source review and native PS AST/C# compile remain separate.
|
||||
"""
|
||||
import argparse
|
||||
import base64
|
||||
import datetime as dt
|
||||
import re
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
@@ -32,11 +30,11 @@ RUNTIME_INDEX = 'e49231e72aff7b001189b8507200c6c701f73e47f77c29194116cf1da41ca0c
|
||||
COMPONENT_INDEX = '005317e652f50de3e1277be3bc42717318226208015e7c8011e1b73469cc7562'
|
||||
ORIGINAL_RESULT = 'd5c4996821911a5bdac5014e9f985c56bbb592b803f2e33411dd28bb986b8eed'
|
||||
ORIGINAL_INTENT = '374adc97bec41bd798409f7c4f8c7716b085e20d2b6fb64b33f7ab675e6483e2'
|
||||
CANDIDATE = ROOT / 'devstate/windows-signed-clock/trusted-os-candidate-link-542cbf43-afb2-4994-b141-06e003e5e2e8'
|
||||
CANDIDATE_RECEIPT = '04ed34e6e850aca77c1fd4677ddb271f7ccd9492a97f5d4e00ead4c1f032f29d'
|
||||
QUALIFICATION = '96b05fe13f4d459b4b3ef78292beea33827b1ea47293ffb5921c685940e82a4d'
|
||||
NEW_AGENT = '26dc9d2f6928c5a41050ac9324e041c065e7a9ae52324416f3bb6222c002ae6b'
|
||||
NEW_HELPER = '59675a3cbb3a5d213fc764f38379d6b81baaf9d47a7124470cc2767d4985763e'
|
||||
CANDIDATE = ROOT / 'devstate/windows-signed-clock/freshness-candidate-link-917425d6-412b-4f70-a7db-bc02de6b9b2a'
|
||||
CANDIDATE_RECEIPT = '2abf7fe56633e68864469de2ff9ded21888301bdc737e53211d024cfd044e22e'
|
||||
QUALIFICATION = '6a624ee9b795ce67d80a91536ba242835be9757a2f502d2d9fbc545532e1b560'
|
||||
NEW_AGENT = '751657ee873c4f4d013abc4ea6daaa4641fea2fe55838fb1c701e6a71b57c192'
|
||||
NEW_HELPER = 'acf1e3f3b1609a97e0d5e88a43a421bed530a09a236bfc0dec1b1abbb22d4413'
|
||||
PROBE = '727732fb4b38ac5431a330527bd52a3ab80af8f189ae75a7b48eceb1d4b69cac'
|
||||
SYSTEM_PROBE = '77a344912c61b7ac4a92152ae1b534ca7c36fe6f7dc4675783f20558c3a7f434'
|
||||
require = prior.require
|
||||
@@ -63,7 +61,7 @@ def controller():
|
||||
marker = "foreach($field in @('old_agent'"
|
||||
index = prefix.index(marker)
|
||||
prefix = prefix[:index] + ("# No caller flag or staged file can replace missing server qualification.\n"
|
||||
"# Enter effects require the fixed actual protocol/exit proof below.\n"
|
||||
"if($p.action-ceq'enter'){throw 'SERVER_TIME_QUALIFICATION_NOT_BOUND'}\n"
|
||||
"if($p.new_agent-cne'"+NEW_AGENT+"'-or$p.new_helper-cne'"+NEW_HELPER+
|
||||
"'){throw 'Fixed signed-clock freshness candidate pair'}\n") + prefix[index:]
|
||||
# Require explicit absence; this bootstrap never creates or adopts a
|
||||
@@ -77,35 +75,36 @@ def controller():
|
||||
boundary = "if((Test-Path -LiteralPath $folder)-or(Test-Path -LiteralPath $active)){throw 'Existing pipe intent: readback only'}"
|
||||
phases = replace_once(phases, boundary,
|
||||
"if($p.action-cne'enter'){throw 'EXACT_ENTER_ACTION_REQUIRED'}\n"
|
||||
"RequireQualifiedTimeRoute\nRequireAccessBudget 420\n" + boundary)
|
||||
phases = phases.replace(" $live=Service $role;", " if($role-ceq'agent'){RequireAccessBudget 420}else{RequireAccessBudget 300}\n $live=Service $role;", 1)
|
||||
route_gate = r'''function RequireAccessBudget([int]$minimumSeconds=420){
|
||||
if($p.access_expiry_utc-isnot[string]-or$p.access_expiry_utc-cnotmatch'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,7})?Z$'){throw 'Exact protected access expiry'}
|
||||
$limit=[DateTimeOffset]::Parse($p.access_expiry_utc,[Globalization.CultureInfo]::InvariantCulture).UtcDateTime;$actual=(Get-LocalUser -Name 'rmm-dev').AccountExpires.ToUniversalTime()
|
||||
$configPath='C:\ProgramData\RmmDevAccess\bootstrap-public.json';CheckControl $configPath $false;if((Get-Item -LiteralPath $configPath).Length-gt32768){throw 'Bounded public access config'}
|
||||
$public=Get-Content -LiteralPath $configPath -Raw|ConvertFrom-Json;$configured=[DateTimeOffset]::Parse($public.expires_at,[Globalization.CultureInfo]::InvariantCulture).UtcDateTime
|
||||
if($actual-ne$limit-or$configured-ne$limit-or($limit-[DateTime]::UtcNow).TotalSeconds-lt$minimumSeconds){throw 'Insufficient or mismatched actual SSH access budget before service stop'}
|
||||
}
|
||||
function RequireQualifiedTimeRoute{
|
||||
$route='C:\ProgramData\RustDiscoveryBootstrap\time-route\68b841a5-784f-4a34-a8a4-060b267713f0';$control='C:\ProgramData\RustDiscoveryBootstrap\time-route-control\68b841a5-784f-4a34-a8a4-060b267713f0'
|
||||
CheckControl $route $true;CheckControl $control $true
|
||||
foreach($entry in @(@((Join-Path $route 'TimeRouteProbe.exe'),'4ef3fc85f5d140f2ad0ff14745dc5d5453a058203d785235d7dabafdf522b088'),@((Join-Path $route 'report.json'),'9f1635c19c801f95c9828e9e31071a487b430f105a61977ee2d60f076f3d3623'),@((Join-Path $control 'exit.json'),'6d131d2796936913f53286573e56f7fb3e515d04ebbd55ae9d6794440e6053b5'),@((Join-Path $route 'context.json'),'3c0e4ff3b16b86fb4e98d2ff163686305ea533570c40ae3bef1270ab89648ed3'),@((Join-Path $route 'time-public-key.json'),'c31d31d2d61f881d04f55f704abbbf98f4822650c016f39e39d4d2318bc3f6e2'))){CheckControl $entry[0] $false;if((Hash $entry[0])-cne$entry[1]){throw 'Actual passive route and kernel-exit proof changed'}}
|
||||
$report=Get-Content -LiteralPath (Join-Path $route 'report.json') -Raw|ConvertFrom-Json;$exit=Get-Content -LiteralPath (Join-Path $control 'exit.json') -Raw|ConvertFrom-Json
|
||||
if($report.case_id-cne'68b841a5-784f-4a34-a8a4-060b267713f0'-or$report.verified-ne$true-or$report.service_role_proven-ne$false-or$report.trusted_clock_proven-ne$false-or($report.reports.http_status-join',')-cne'200,403,409'-or$report.reports[0].signature_verified-ne$true-or$report.reports[0].whole_request_context_bound-ne$true-or$exit.kernel_process_exited-ne$true-or$exit.exit_code-ne0-or$exit.timed_out-ne$false){throw 'Fixed actual passive protocol proof only'}
|
||||
}
|
||||
'''
|
||||
phases = route_gate+phases
|
||||
"throw 'SERVER_TIME_QUALIFICATION_NOT_BOUND'\n" + boundary)
|
||||
# Only the existing fixed passive journal witnesses and authenticated Probe
|
||||
# are used. No helper Snapshot/Apply/Execute or time control operation.
|
||||
return prefix+'\n'+native+prior.READBACK_SERVICE+'\n'+phases
|
||||
|
||||
|
||||
def source_guards(script):
|
||||
require("$p.action-isnot[string]-or$p.action-cnotin@('baseline','enter','finish','readback')" in script and "$p.action-notin@" not in script,'exact case sensitive actions')
|
||||
require("if($p.action-cne'enter'){throw 'EXACT_ENTER_ACTION_REQUIRED'}\nRequireQualifiedTimeRoute\nRequireAccessBudget 420\n" in script,'actual route and access bound before effects')
|
||||
require(" if($role-ceq'agent'){RequireAccessBudget 420}else{RequireAccessBudget 300}\n $live=Service $role;" in script,'access budget before each actual stop')
|
||||
require('9f1635c19c801f95c9828e9e31071a487b430f105a61977ee2d60f076f3d3623' in script and '6d131d2796936913f53286573e56f7fb3e515d04ebbd55ae9d6794440e6053b5' in script,'actual route report and exit binding')
|
||||
require('TimeBegin' not in script and 'TimeComplete' not in script and 'Restart-Computer' not in script,'no clock/job/reboot scope')
|
||||
require("if($p.action-ceq'enter'){throw 'SERVER_TIME_QUALIFICATION_NOT_BOUND'}" in script,
|
||||
'target effects closed pending actual independently reviewed server evidence')
|
||||
require("$p.action-isnot[string]-or$p.action-cnotin@('baseline','enter','finish','readback')" in script
|
||||
and "$p.action-notin@" not in script, 'strict string and case-sensitive action whitelist')
|
||||
boundary = ("if($p.action-cne'enter'){throw 'EXACT_ENTER_ACTION_REQUIRED'}\n"
|
||||
"throw 'SERVER_TIME_QUALIFICATION_NOT_BOUND'\n"
|
||||
"if((Test-Path -LiteralPath $folder)-or(Test-Path -LiteralPath $active))")
|
||||
require(script.count(boundary) == 1 and script.index(boundary) < script.index(" StopHeld 'agent'"),
|
||||
'explicit exact enter and unconditional qualification gate before all effect flow')
|
||||
require('RmmPipeNative' not in script and 'RmmPipeUpgradePayload' not in script,
|
||||
'only the new controller class and payload identifiers')
|
||||
require(script.count('Start-Service -Name $name') == script.count('Stop-Service -Name $name') == 1,
|
||||
'one fixed-role service-control primitive only')
|
||||
positions = [script.index(x) for x in (" StopHeld 'agent'", " Backup 'agent'", "Backup 'pin'",
|
||||
" Swap 'agent'", "Swap 'pin'", '$swapped=ActualState $true', " StartOnce 'helper'", "StartOnce 'agent'")]
|
||||
require(positions == sorted(positions), 'backups then all four CAS replacements then helper/agent starts')
|
||||
require('[IO.File]::Replace($candidate,$destination,$nativeBackup)' in script,
|
||||
'explicit native original backup, no null backup')
|
||||
require(all(x not in script for x in ('Restart-Service', 'Restart-Computer', 'Stop-Computer',
|
||||
'Set-Service', 'New-Service', 'Remove-Item', 'Invoke-Expression', 'Bypass',
|
||||
'TimeBegin', 'TimeComplete', 'TimeClose', 'ExecutionPolicy Bypass')), 'no extra effect or time-control scope')
|
||||
require('function Snapshot' not in script and 'function Apply' not in script,
|
||||
'no clock-dependent helper synchronization in passive witness')
|
||||
|
||||
|
||||
def protected(path, expected):
|
||||
@@ -157,21 +156,15 @@ def write(path, raw):
|
||||
|
||||
def prepare(script):
|
||||
result, old_intent, settings, pin, policy = original()
|
||||
grant = prior.cb.contract.protected_json(MAIN/'credentials/windows-dev-access.json')
|
||||
expiry = grant.get('expires_at')
|
||||
require(type(expiry) is str and re.fullmatch(r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,7})?(?:Z|\+00:00)',expiry) is not None,'protected current access expiry')
|
||||
expiry = expiry.removesuffix('+00:00')+'Z' if expiry.endswith('+00:00') else expiry
|
||||
deadline = dt.datetime.fromisoformat(expiry.replace('Z','+00:00'))
|
||||
require((deadline-dt.datetime.now(dt.timezone.utc)).total_seconds() >= 420,'current authorization window has insufficient total maintenance/readback budget')
|
||||
receipt = protected(CANDIDATE/'receipt.json', CANDIDATE_RECEIPT)
|
||||
require(receipt['source_receipt_sha256'] == QUALIFICATION and receipt['input_count'] == 202
|
||||
and receipt['link_exit'] == 0 and receipt['target_called'] is False
|
||||
and receipt['link_exit'] == 0 and receipt['target_execution'] is False
|
||||
and receipt['artifacts']['rmm-agent-windows.exe']['sha256'] == NEW_AGENT
|
||||
and receipt['artifacts']['rmm-helper-windows.exe']['sha256'] == NEW_HELPER,
|
||||
'actual new offline-linked freshness pair, no native qualification inferred')
|
||||
ident = str(uuid.uuid4()); folder = STATE/ident; folder.mkdir(mode=0o700,parents=True)
|
||||
script_sha = raw_sha(script.encode())
|
||||
draft = dict(id=ident,access_expiry_utc=expiry,old_agent=OLD_AGENT,old_helper=OLD_HELPER,old_policy=OLD_POLICY,old_pin=OLD_PIN,
|
||||
draft = dict(id=ident,old_agent=OLD_AGENT,old_helper=OLD_HELPER,old_policy=OLD_POLICY,old_pin=OLD_PIN,
|
||||
new_agent=NEW_AGENT,new_helper=NEW_HELPER,new_policy=policy,new_pin=raw_sha(pin),
|
||||
config_sha256=result['native']['config_sha256'],probe_sha256=PROBE,system_probe_sha256=SYSTEM_PROBE,
|
||||
manifest_sha256=CANDIDATE_RECEIPT,qualification_sha256=QUALIFICATION,script_sha256=script_sha,
|
||||
@@ -193,13 +186,13 @@ def prepare(script):
|
||||
original_runtime_index_sha256=RUNTIME_INDEX,original_component_index_sha256=COMPONENT_INDEX,
|
||||
candidate_receipt_sha256=CANDIDATE_RECEIPT,qualification_sha256=QUALIFICATION,
|
||||
artifacts={name:receipt['artifacts'][name] for name in ('rmm-agent-windows.exe','rmm-helper-windows.exe')},
|
||||
access_expiry_utc=expiry,access_expiry_source='protected current windows-dev-access.json public expires_at; exact VM account/bootstrap-public match before effects',
|
||||
server_qualification_bound=True,enter_enabled=True,time_configuration_created=False,
|
||||
server_qualification_bound=False,enter_enabled=False,time_configuration_created=False,
|
||||
calibration_created=False,target_called=False,main_indices_modified=False,
|
||||
remaining=['fresh current authorized SSH window and exact VM account/public expiry match',
|
||||
'fresh native baseline and closed server witnesses','once-only preserving maintenance and independent readback'])
|
||||
remaining=['independent source review','native PS AST/C# compile-only',
|
||||
'actual server quality/broker/public-time-key/mTLS-route gate binding in separately reviewed source',
|
||||
'fresh native baseline and closed server witnesses','new once-only stage/enter/read operator'])
|
||||
write(folder/'manifest.json',canonical(manifest));print(json.dumps(dict(id=ident,prepared_locally=True,
|
||||
controller_sha256=script_sha,enter_enabled=True,target_called=False)))
|
||||
controller_sha256=script_sha,enter_enabled=False,target_called=False)))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
"""Local contract fixtures only; no native qualification or target calls."""
|
||||
import base64
|
||||
import copy
|
||||
import json
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import time_profile_config as t
|
||||
from vm_mvp_acceptance import GuardError
|
||||
|
||||
|
||||
def fixture():
|
||||
binding = {'tenant_id':'11111111-1111-4111-8111-111111111111',
|
||||
'agent_id':'22222222-2222-4222-8222-222222222222',
|
||||
'asset_id':'33333333-3333-4333-8333-333333333333',
|
||||
'enrollment_generation':1,'assignment_version':1,'public_key_hex':'11'*32}
|
||||
public = {'public-binding.json':binding,'qualified-time-public-key.json':{
|
||||
'key_generation':1,'server_instance':'44444444-4444-4444-8444-444444444444',
|
||||
'key_id':'local_fixture_only','public_key_hex':'22'*32},'public-platform.json':{'fixture_only':True}}
|
||||
agent_sid = 'S-1-5-80-1-2-3-4-5';helper_sid = 'S-1-5-80-1-2-3-4-6'
|
||||
result = {'id':'55555555-5555-4555-8555-555555555555','verified':True,'completed':True,
|
||||
'no_jobs':True,'windows_jobs_enabled':False,'helper_effects_enabled':False,
|
||||
'clock_authority_not_proven':True,'private_key_read':False}
|
||||
native = dict(agent_id=binding['agent_id'],asset_id=binding['asset_id'],
|
||||
binary_sha256=t.IMAGES['agent'],helper_sha256=t.IMAGES['system_helper'],
|
||||
policy_sha256='a'*64,pin_sha256='b'*64,files={})
|
||||
for role, service, kernel, label, user, image in (
|
||||
('agent','service','agent_kernel','agent','S-1-5-19','rmm-agent-windows.exe'),
|
||||
('system_helper','helper_service','helper_kernel','helper','S-1-5-18','rmm-helper-windows.exe')):
|
||||
native[service] = dict(state='Running',pid=42,creation_filetime='123',owner_sid=user)
|
||||
native[kernel] = dict(pid=42,creation_filetime='123',owner_sid=user,service_sid=agent_sid if role=='agent' else helper_sid,
|
||||
kernel_handle_bound=True,service_sid_enabled=True,
|
||||
image='C:\\Program Files\\RustDiscovery\\'+image)
|
||||
native['files'][label] = dict(file_id='a'*32,sha256=t.IMAGES[role])
|
||||
result['native'] = native
|
||||
settings = dict(binding=binding,enable_effects=False,agent=dict(service_sid=agent_sid),helper=dict(service_sid=helper_sid))
|
||||
payload = dict(new_agent=t.IMAGES['agent'],new_helper=t.IMAGES['system_helper'],
|
||||
new_policy='a'*64,new_pin='b'*64,qualification_sha256=t.LINK_RECEIPT,
|
||||
manifest_sha256=t.LINK_RECEIPT,settings_base64=base64.b64encode(t.canonical(settings)).decode())
|
||||
return public,result,payload,{'local-service':{'fixture_only':True},'system':{'fixture_only':True}}
|
||||
|
||||
|
||||
class PublicProfileContract(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.values = fixture()
|
||||
self.pair = patch.object(t,'PAIR_ID',self.values[1]['id']);self.pair.start();self.addCleanup(self.pair.stop)
|
||||
|
||||
def render(self, values=None):
|
||||
return t.produce(*(values or self.values),'c'*64,'d'*64)[0]
|
||||
|
||||
def test_v2_fixture_links_both_exact_roles_without_runtime_success(self):
|
||||
items = self.render();config=json.loads(items['time-attestation.json'])
|
||||
self.assertEqual(config['schema_version'],2)
|
||||
self.assertNotIn('base_error_ns',config)
|
||||
for role in config['trusted_os_active_guest']['qualifications']:
|
||||
raw=items[role['role']+'-qualification.json'];value=json.loads(raw)
|
||||
self.assertEqual(t.sha(raw),role['qualification_sha256'])
|
||||
self.assertFalse(value['signed_runtime_verified']);self.assertFalse(value['physical_calibration_claimed'])
|
||||
self.assertEqual(value['source_sha256'],t.SOURCE_SHA if role['role']=='agent' else t.ORIGINAL_SOURCE_SHA)
|
||||
|
||||
def test_missing_or_not_completed_actual_pair_is_denied(self):
|
||||
for field in ('verified','completed','no_jobs'):
|
||||
values=copy.deepcopy(self.values);values[1].pop(field)
|
||||
with self.assertRaises(GuardError):self.render(values)
|
||||
|
||||
def test_wrong_kernel_birth_account_sid_image_or_fileid_is_denied(self):
|
||||
for field,value in [('creation_filetime','124'),('owner_sid','S-1-5-18'),
|
||||
('service_sid_enabled',False),('kernel_handle_bound',False),
|
||||
('service_sid','S-1-5-18'),('image','C:\\wrong.exe')]:
|
||||
values=copy.deepcopy(self.values);values[1]['native']['agent_kernel'][field]=value
|
||||
with self.assertRaises(GuardError):self.render(values)
|
||||
values=copy.deepcopy(self.values);values[1]['native']['files']['agent']['file_id']='bad'
|
||||
with self.assertRaises(GuardError):self.render(values)
|
||||
|
||||
def test_image_build_policy_and_identity_drift_is_denied(self):
|
||||
for field in ('new_agent','new_helper','new_policy','new_pin','qualification_sha256','manifest_sha256'):
|
||||
values=copy.deepcopy(self.values);values[2][field]='0'*64
|
||||
with self.assertRaises(GuardError):self.render(values)
|
||||
values=copy.deepcopy(self.values);values[0]['public-binding.json']['agent_id']='99999999-9999-4999-8999-999999999999'
|
||||
with self.assertRaises(GuardError):self.render(values)
|
||||
|
||||
def test_no_actual_pair_pins_blocks_before_creating_any_case(self):
|
||||
with tempfile.TemporaryDirectory() as root, patch.object(t,'STATE',Path(root)/'absent'),patch.object(t,'PAIR_ID',None):
|
||||
with self.assertRaises(GuardError):t.prepare()
|
||||
self.assertFalse(t.STATE.exists())
|
||||
|
||||
def test_bounded_nofollow_read_duplicate_json_and_createonce(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
path=Path(root)/'value.json';t.write(path,b'{"a":1}\n')
|
||||
self.assertEqual(t.read(path)[1],{'a':1})
|
||||
with self.assertRaises(FileExistsError):t.write(path,b'{}')
|
||||
with self.assertRaises(GuardError):t.read(path,'0'*64)
|
||||
link=Path(root)/'link';link.symlink_to(path)
|
||||
with self.assertRaises(OSError):t.read(link)
|
||||
bad=Path(root)/'duplicate.json';t.write(bad,b'{"a":1,"a":2}')
|
||||
with self.assertRaises(GuardError):t.read(bad)
|
||||
with self.assertRaises(GuardError):t.read(path,limit=1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -1,531 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""First public V2 time pin for one actual qualified Windows product pair.
|
||||
|
||||
prepare/guards are local only. No target operation happens on import.
|
||||
Missing native product-role/readback evidence blocks preparation; diagnostics
|
||||
are never relabelled as calibrated product clocks or signed runtime success.
|
||||
"""
|
||||
import argparse
|
||||
import base64
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import stat
|
||||
import uuid
|
||||
|
||||
import system_pipe_upgrade as prior
|
||||
import signed_clock_capture_acceptance as raw_capture
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
CLOCK = ROOT.parent / 'rust-discovery-signed-clock'
|
||||
MAIN = ROOT.parent / 'rust-discovery'
|
||||
STATE = ROOT / 'devstate/windows-time-profile-config'
|
||||
PUBLIC = CLOCK / 'devstate/windows-time-profile-public-preparation/c3077acf-12da-410e-9f55-e75a1cd0a75f'
|
||||
PAIR_ID = '4887940a-4c9c-4807-aaf2-6fbc94faad46'
|
||||
PAIR_RESULT_SHA = '2898a72b4b0d84159cc11d80765cbfa4206faf7038d0e860429c8b1a57538ee2'
|
||||
PAIR_INTENT_SHA = '40e9cd557225504429b51dcecd4322b32d7f0973bcbb8e2a2e52516917907b85'
|
||||
PAIR_READBACK_SHA = '63e453fb915cadee028407a6aeaa8c7d209ae88ed12a6d4d4307d4fd25e4c539'
|
||||
PAIR_ROOT = CLOCK / 'devstate/windows-signed-clock/passive-pair-upgrade'
|
||||
SOURCE_CASE = CLOCK / 'devstate/windows-signed-clock/trusted-os-qualification-c4679433-b632-4d6e-8668-f0f2fb54a542'
|
||||
LINK_CASE = MAIN / 'devstate/windows-client/operator-window-20261115/observed-agent-build'
|
||||
ORIGINAL_SOURCE_SHA = 'd8594c1eba2c2cc5d5fde4a462b2110aa2e7e64081452b742c4ed81a2cfb477d'
|
||||
SOURCE_SHA = '342494c4f9e7eca439c059745591a8e907026da20f56b223fcb0eb0707aa6d82'
|
||||
SOURCE_RECEIPT = '96b05fe13f4d459b4b3ef78292beea33827b1ea47293ffb5921c685940e82a4d'
|
||||
LINK_RECEIPT = 'f04024f78c2f11f5c66bbdf9278467f5bcc50da5c2bd7336623851bca42dd446'
|
||||
LINK_INPUTS = '11717fab51bd1d6bf103b1821cc1e2a84699f46cac21f2cc614acf4b68381fa4'
|
||||
ORIGINAL_LINK_RECEIPT = '04ed34e6e850aca77c1fd4677ddb271f7ccd9492a97f5d4e00ead4c1f032f29d'
|
||||
NATIVE_RESULTS = {
|
||||
'linux': ('84592e7a-6554-4a7d-a73f-2bdebdb9e9a8', '150954b0ab290d8e9fbda5616f6df071168efd88a9f1d8b48b2bd8a5f5de7c20'),
|
||||
'windows': ('44059065-c17e-43c3-86aa-d4d131454ccb', 'b235bdd444c112ff91cbc5f160d39d69ef79fb419b9b2ab7ccdcec06009d5c6b')}
|
||||
ORIGINAL_IMAGES = {'agent': '26dc9d2f6928c5a41050ac9324e041c065e7a9ae52324416f3bb6222c002ae6b',
|
||||
'system_helper': '59675a3cbb3a5d213fc764f38379d6b81baaf9d47a7124470cc2767d4985763e'}
|
||||
IMAGES = {'agent': '0549d9ebea73cff996938f859b92192cc333de194128d7c6859a3f1d2e85893c',
|
||||
'system_helper': ORIGINAL_IMAGES['system_helper']}
|
||||
ASSUMPTION = 'active_guest_no_pause_save_restore_snapshot_migration_host_suspend'
|
||||
PUBLIC_SHAS = {'qualified-time-public-key.json': 'c31d31d2d61f881d04f55f704abbbf98f4822650c016f39e39d4d2318bc3f6e2',
|
||||
'public-platform.json': '94ae865e0e3449f6901f4d5f593aacbd5829b06340e296e19e6f0159a157cba3',
|
||||
'public-binding.json': '9239ee9f4142735867e77451478bf309fbf449d730a0ede6c958bc8018830dde',
|
||||
'input-provenance.json': '1c0db66cd0692024f68bddd71949692d274380a86e4b880fea0756479ceb5d0c',
|
||||
'receipt.json': '97e4db147f31f3cff134d2bc596d7d73ea5330b8b5a87971f215bb03a9751391'}
|
||||
RAW = CLOCK / 'devstate/windows-signed-clock-capture-completion/ccba6d8f-c58f-4d2d-a51c-1efb3bfbabdf'
|
||||
RAW_RECEIPTS = {'local-service': '10dd411be265d018489bf9477747ce2d5846ac04128f583425aec4b3c9d5252b',
|
||||
'system': '7409309ea6d586566373f570d6950c60ce2597cf939f261e6d2ea4def004a22f'}
|
||||
require = prior.require
|
||||
|
||||
def sha(raw):
|
||||
return hashlib.sha256(raw).hexdigest()
|
||||
|
||||
def canonical(value):
|
||||
return (json.dumps(value, sort_keys=True, separators=(',', ':'), ensure_ascii=False) + '\n').encode()
|
||||
|
||||
def strict_object(items):
|
||||
value = {}
|
||||
for key, item in items:
|
||||
require(key not in value, 'duplicate public JSON field')
|
||||
value[key] = item
|
||||
return value
|
||||
|
||||
def read(path, expected=None, limit=2*1024*1024, decode=True, public=False):
|
||||
fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK)
|
||||
with os.fdopen(fd, 'rb') as stream:
|
||||
before = os.fstat(stream.fileno())
|
||||
modes = (0o600,0o644,0o664) if public and expected is not None else (0o600,)
|
||||
require(stat.S_ISREG(before.st_mode) and before.st_uid == os.getuid() and before.st_nlink == 1
|
||||
and stat.S_IMODE(before.st_mode) in modes and 0 < before.st_size <= limit,
|
||||
'private bounded actual public evidence')
|
||||
raw = stream.read(limit + 1); after = os.fstat(stream.fileno())
|
||||
require((before.st_dev,before.st_ino,before.st_size,before.st_mtime_ns,before.st_ctime_ns)
|
||||
== (after.st_dev,after.st_ino,after.st_size,after.st_mtime_ns,after.st_ctime_ns)
|
||||
and len(raw) == before.st_size and (expected is None or sha(raw) == expected),
|
||||
'unchanged independently pinned public evidence')
|
||||
return raw, json.loads(raw, object_pairs_hook=strict_object) if decode else None
|
||||
|
||||
def write(path, raw):
|
||||
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)
|
||||
with os.fdopen(fd,'wb') as stream:
|
||||
stream.write(raw); stream.flush(); os.fsync(stream.fileno())
|
||||
fd = os.open(path.parent,os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW)
|
||||
try: os.fsync(fd)
|
||||
finally: os.close(fd)
|
||||
|
||||
def public_inputs():
|
||||
values = {name: read(PUBLIC/name,digest)[1] for name,digest in PUBLIC_SHAS.items()}
|
||||
pin, platform, binding = (values[n] for n in ('qualified-time-public-key.json','public-platform.json','public-binding.json'))
|
||||
require(set(pin) == {'algorithm','schema_version','key_generation','key_id','server_instance','public_key_hex'}
|
||||
and pin['algorithm'] == 'Ed25519' and pin['schema_version'] == 1
|
||||
and type(pin['key_generation']) is int and pin['key_generation'] > 0
|
||||
and re.fullmatch('[A-Za-z0-9_-]{1,64}',pin['key_id'])
|
||||
and re.fullmatch('[a-f0-9]{64}',pin['public_key_hex']), 'actual separate public time key')
|
||||
require(str(uuid.UUID(pin['server_instance'])) == pin['server_instance'] and uuid.UUID(pin['server_instance']).int > 0,
|
||||
'actual server instance')
|
||||
require(set(binding) == {'tenant_id','asset_id','agent_id','enrollment_generation','assignment_version','public_key_hex'}
|
||||
and all(str(uuid.UUID(binding[k])) == binding[k] and uuid.UUID(binding[k]).int > 0 for k in ('tenant_id','asset_id','agent_id'))
|
||||
and type(binding['enrollment_generation']) is int and binding['enrollment_generation'] == 1
|
||||
and type(binding['assignment_version']) is int and binding['assignment_version'] == 1
|
||||
and bytes.fromhex(pin['public_key_hex']) != bytes.fromhex(binding['public_key_hex']), 'unchanged actual identity and distinct time/job keys')
|
||||
require(platform['schema'] == 1 and platform['hypervisor'] == 'kvm' and platform['state'] == 'running'
|
||||
and platform['domain_uuid'] == '1ec0d319-24bc-4953-a6b2-52b85449be07'
|
||||
and platform['has_genid'] is False
|
||||
and {'name':'hypervclock','present':'yes'} in platform['timers'], 'actual selectively observed active KVM platform')
|
||||
provenance = values['input-provenance.json']
|
||||
require(provenance['candidate_images'] == ORIGINAL_IMAGES and provenance['operating_assumption'] == ASSUMPTION
|
||||
and provenance['platform'] == 'kvm_qemu_hypervclock' and provenance['roles_qualified'] is False
|
||||
and provenance['time_config_created'] is False and provenance['target_called'] is False,
|
||||
'original incomplete public preparation stays incomplete and unchanged')
|
||||
return values
|
||||
|
||||
def source_inputs():
|
||||
_, source = read(SOURCE_CASE/'receipt.json',SOURCE_RECEIPT)
|
||||
read(SOURCE_CASE/'source/crates/agent-windows/src/signed_clock.rs',ORIGINAL_SOURCE_SHA,decode=False)
|
||||
_, link = read(LINK_CASE/'receipt.json',LINK_RECEIPT)
|
||||
_, inputs = read(LINK_CASE/'source-inputs.json',LINK_INPUTS)
|
||||
require(len(inputs) == 202 and len({item['path'] for item in inputs}) == 202,
|
||||
'exact updated source input set')
|
||||
clock = [item for item in inputs if item['path'] == 'crates/agent-windows/src/signed_clock.rs']
|
||||
require(len(clock) == 1 and clock[0]['sha256'] == SOURCE_SHA, 'same qualified V2 clock source')
|
||||
read(LINK_CASE/'source/crates/agent-windows/src/signed_clock.rs',SOURCE_SHA,decode=False)
|
||||
original_path = CLOCK/'devstate/windows-signed-clock/trusted-os-candidate-link-542cbf43-afb2-4994-b141-06e003e5e2e8'
|
||||
_, original = read(original_path/'receipt.json',ORIGINAL_LINK_RECEIPT)
|
||||
require(source['source_sha256'] == original['source_sha256'] == ORIGINAL_SOURCE_SHA
|
||||
and source['input_count'] == link['input_count'] == 202
|
||||
and source['inputs_sha256'] == original['inputs_sha256']
|
||||
and original['source_receipt_sha256'] == SOURCE_RECEIPT
|
||||
and link['source_receipt_sha256'] == ORIGINAL_LINK_RECEIPT
|
||||
and link['source_inputs_sha256'] == LINK_INPUTS
|
||||
and source['inputs_verified_before_after'] is True and link['source_verified_before_after'] is True
|
||||
and source['checks']['linux_signed_clock_guards']['passed'] == 8
|
||||
and link['link_exit'] == 0 and link['original_helper_sha256'] == IMAGES['system_helper']
|
||||
and link['target'] == 'x86_64-pc-windows-gnu' and link['patches'] == ['656102b','cc82124'],
|
||||
'actual fixed V2 source and linked product pair, no runtime success inferred')
|
||||
for artifact, role in ((link['artifacts']['rmm-agent-windows.exe'],'agent'),
|
||||
(original['artifacts']['rmm-helper-windows.exe'],'system_helper')):
|
||||
require(artifact['sha256'] == IMAGES[role] and artifact['machine'] == 'PE_AMD64', 'same actual linked role image')
|
||||
for platform in ('linux','windows'):
|
||||
case, binary_sha = NATIVE_RESULTS[platform]
|
||||
_, result = read(LINK_CASE.parent/case/'result.json',link[platform+'_result_sha256'],public=True)
|
||||
output = result['stdout'] if platform == 'linux' else '\n'.join(result['lines'])
|
||||
names = re.findall(r'^test (signed_clock::tests::[a-z_]+) \.\.\. ok$', output, re.MULTILINE)
|
||||
expected = set(source['checks']['linux_signed_clock_guards']['selected']) | {
|
||||
'signed_clock::tests::passive_sampling_requires_a_profile_and_uses_heartbeat_cadence'}
|
||||
require(result['test_binary_sha256'] == binary_sha
|
||||
and result['exit' if platform=='linux' else 'exit_code'] == 0
|
||||
and len(names) == 9 and set(names) == expected
|
||||
and '9 passed; 0 failed; 0 ignored' in output, 'same-source actual native nine guards')
|
||||
return source,link
|
||||
|
||||
def raw_inputs():
|
||||
require(sha(Path(raw_capture.__file__).read_bytes()) ==
|
||||
'dd6c575a119751429448e40e6f306cf79efa3a86c49bf2cd32a7783937177770',
|
||||
'unchanged original raw-role decoder')
|
||||
records = {}
|
||||
for role, digest in RAW_RECEIPTS.items():
|
||||
_, receipt = read(RAW/('start-'+role+'-receipt.json'),digest)
|
||||
raw_link = receipt['raw_reply']
|
||||
require(raw_link['filename'] == 'start-'+role+'-reply.json', 'fixed original raw role namespace')
|
||||
_, reply = read(RAW/raw_link['filename'],raw_link['sha256'])
|
||||
require(receipt['calibrated'] is False and receipt['clock_authority'] is False
|
||||
and reply['calibrated'] is False and reply['clock_authority'] is False,
|
||||
'raw probe is never a product calibration')
|
||||
for key in ('native_witness','server_witness','preservation'):
|
||||
item = receipt[key]
|
||||
require(Path(item['filename']).name == item['filename'], 'fixed sibling evidence leaf')
|
||||
read(RAW/item['filename'],item['sha256'])
|
||||
raw_capture.validate_role(role,reply['roles'][role],'efd17b43-7e04-49a7-9bd4-862d13365eec')
|
||||
records[role] = {'receipt_sha256':digest,'probe_image_sha256':raw_capture.EXE_SHA,
|
||||
'raw_report_sha256':reply['roles'][role]['raw_report_sha256']}
|
||||
return records
|
||||
|
||||
def validate_pair(result, intent):
|
||||
require(result.get('id') == PAIR_ID and result.get('verified') is True and result.get('completed') is True
|
||||
and result.get('no_jobs') is True and result.get('windows_jobs_enabled') is False
|
||||
and result.get('helper_effects_enabled') is False and result.get('clock_authority_not_proven') is True
|
||||
and result.get('private_key_read') is False, 'actual completed passive pair required; no missing or dummy result')
|
||||
payload = intent.get('payload',intent)
|
||||
require(payload['new_agent'] == IMAGES['agent'] and payload['new_helper'] == IMAGES['system_helper']
|
||||
and payload['qualification_sha256'] == LINK_RECEIPT and payload['manifest_sha256'] == LINK_RECEIPT,
|
||||
'actual exact V2 pair source chain')
|
||||
native = result['native']
|
||||
require(native['binary_sha256'] == IMAGES['agent'] and native['helper_sha256'] == IMAGES['system_helper']
|
||||
and native['policy_sha256'] == payload['new_policy'] and native['pin_sha256'] == payload['new_pin'], 'complete native image/pin pair')
|
||||
qualifications = []
|
||||
for role,service,kernel,label,user in [('agent','service','agent_kernel','agent','S-1-5-19'),('system_helper','helper_service','helper_kernel','helper','S-1-5-18')]:
|
||||
s,k,f = native[service],native[kernel],native['files'][label]
|
||||
require(s['state'] == 'Running' and type(s['pid']) is int and s['pid'] > 0
|
||||
and k['pid'] == s['pid'] and k['creation_filetime'] == s['creation_filetime']
|
||||
and k['owner_sid'] == s['owner_sid'] == user and k['service_sid_enabled'] is True
|
||||
and k['kernel_handle_bound'] is True and f['sha256'] == IMAGES[role]
|
||||
and k['image'] == ('C:\\Program Files\\RustDiscovery\\rmm-agent-windows.exe' if role=='agent'
|
||||
else 'C:\\Program Files\\RustDiscovery\\rmm-helper-windows.exe')
|
||||
and re.fullmatch(r'S-1-5-80-(?:[0-9]+-){4}[0-9]+',k['service_sid'])
|
||||
and re.fullmatch('[0-9]+',k['creation_filetime']) and re.fullmatch('[a-f0-9]{32}',f['file_id']),
|
||||
'actual SCM/kernel account, enabled service SID, birth and image FileID')
|
||||
qualifications.append({'role':role,'binary_sha256':IMAGES[role],'service':copy.deepcopy(s),
|
||||
'kernel':copy.deepcopy(k),'image_file':copy.deepcopy(f)})
|
||||
return native,payload,qualifications
|
||||
|
||||
def produce(public, pair_result, pair_intent, raw, result_sha, intent_sha):
|
||||
native,payload,roles = validate_pair(pair_result,pair_intent)
|
||||
binding = public['public-binding.json']; pin=public['qualified-time-public-key.json']
|
||||
require(native['agent_id'] == binding['agent_id'] and native['asset_id'] == binding['asset_id'], 'same actual device binding')
|
||||
settings = json.loads(base64.b64decode(payload['settings_base64'],validate=True),object_pairs_hook=strict_object)
|
||||
require(settings['binding'] == binding and settings['enable_effects'] is False
|
||||
and settings['agent']['service_sid'] == roles[0]['kernel']['service_sid']
|
||||
and settings['helper']['service_sid'] == roles[1]['kernel']['service_sid']
|
||||
and settings['agent']['service_sid'] != settings['helper']['service_sid'], 'actual reciprocal settings and distinct service roles')
|
||||
platform = {'profile':'rmm.windows.trusted-os.platform-provenance.v1','operating_assumption':ASSUMPTION,
|
||||
'platform':'kvm_qemu_hypervclock','public_platform_sha256':PUBLIC_SHAS['public-platform.json'],
|
||||
'original_public_preparation_sha256':PUBLIC_SHAS['input-provenance.json'],
|
||||
'source_sha256':SOURCE_SHA,'source_receipt_sha256':SOURCE_RECEIPT,
|
||||
'product_pair_receipt_sha256':LINK_RECEIPT,'pair_result_sha256':result_sha,
|
||||
'pair_intent_sha256':intent_sha,'independent_pair_readback_sha256':PAIR_READBACK_SHA,
|
||||
'independent_physical_calibration_claimed':False}
|
||||
items={'platform-provenance.json':canonical(platform),'public-platform.json':canonical(public['public-platform.json'])}
|
||||
# The original platform file is separately retained below using its actual
|
||||
# bytes; this canonical descriptive copy is never mislabelled as its hash.
|
||||
references=[]
|
||||
for role in roles:
|
||||
role.update(profile='rmm.windows.trusted-os.product-role-prerequisite.v1',pair_case_id=PAIR_ID,
|
||||
pair_result_sha256=result_sha,pair_intent_sha256=intent_sha,
|
||||
independent_pair_readback_sha256=PAIR_READBACK_SHA,
|
||||
source_sha256=SOURCE_SHA if role['role']=='agent' else ORIGINAL_SOURCE_SHA,
|
||||
original_source_receipt_sha256=SOURCE_RECEIPT,product_pair_receipt_sha256=LINK_RECEIPT,
|
||||
platform_provenance_sha256=sha(items['platform-provenance.json']),
|
||||
raw_capture=raw['local-service' if role['role']=='agent' else 'system'],
|
||||
signed_runtime_verified=False,physical_calibration_claimed=False)
|
||||
name=role['role']+'-qualification.json';items[name]=canonical(role)
|
||||
references.append({'role':role['role'],'binary_sha256':role['binary_sha256'],'qualification_sha256':sha(items[name])})
|
||||
value={'schema_version':2,'key_generation':pin['key_generation'],'server_instance':pin['server_instance'],
|
||||
'binding':binding,'public_keys_hex':{pin['key_id']:pin['public_key_hex']},
|
||||
'trusted_os_active_guest':{'operating_assumption':ASSUMPTION,'platform':'kvm_qemu_hypervclock',
|
||||
'platform_provenance_sha256':sha(items['platform-provenance.json']),'qualifications':references}}
|
||||
items['time-attestation.json']=canonical(value)
|
||||
require(len(items['time-attestation.json'])<=16384, 'real bounded public V2 configuration')
|
||||
return items,native,payload
|
||||
|
||||
# Controller and transport are defined below; no remote action on import.
|
||||
|
||||
HEADER = r'''
|
||||
$ErrorActionPreference='Stop';$request=$global:RmmTimeProfilePayload
|
||||
if(!$request-or$request.action-isnot[string]-or$request.action-cnotin@('install','read')-or[guid]::ParseExact($request.id,'D').ToString()-cne$request.id-or$request.profile-cne'rmm.windows.initial-public-time-profile.v2'){throw 'Exact initial time-profile operation'}
|
||||
$p=$request.pair_payload
|
||||
$boot='C:\ProgramData\RustDiscoveryBootstrap';$folder=Join-Path $boot ('time-profile-'+$request.id)
|
||||
$agentRoot='C:\ProgramData\RustDiscovery';$agentState=Join-Path $agentRoot 'state';$helperRoot='C:\ProgramData\RustDiscoverySystem';$helperState=Join-Path $helperRoot 'state'
|
||||
$config=Join-Path $agentRoot 'config.json';$settings=Join-Path $helperRoot 'helper.json';$pin=Join-Path $helperRoot 'agent-pin.json'
|
||||
$agentBinary='C:\Program Files\RustDiscovery\rmm-agent-windows.exe';$helperBinary='C:\Program Files\RustDiscovery\rmm-helper-windows.exe'
|
||||
$agentName='RmmDiscoveryWindows';$helperName='RmmDiscoverySystemHelper';$sys='S-1-5-18';$admin='S-1-5-32-544'
|
||||
$agentSid=(New-Object Security.Principal.NTAccount('NT SERVICE',$agentName)).Translate([Security.Principal.SecurityIdentifier]).Value
|
||||
$helperSid=(New-Object Security.Principal.NTAccount('NT SERVICE',$helperName)).Translate([Security.Principal.SecurityIdentifier]).Value
|
||||
$target=Join-Path $helperRoot 'time-attestation.json';$active=Join-Path $boot 'time-profile-initial-active.json'
|
||||
'''
|
||||
|
||||
BODY = r'''
|
||||
function ReadAcl($path,[bool]$directory){
|
||||
Check $path $directory;$acl=Get-Acl -LiteralPath $path
|
||||
if($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value-cnotin@($sys,$admin)){throw 'Public pin owner must remain SYSTEM/Administrators'}
|
||||
$seen=@{};foreach($rule in $acl.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])){
|
||||
$id=$rule.IdentityReference.Value;$rights=[int64]$rule.FileSystemRights
|
||||
if($rule.AccessControlType-cne'Allow'-or$id-cnotin@($sys,$admin,$agentSid,$helperSid)-or($id-cnotin@($sys,$admin)-and($rights-band(-bnot 0x1200a9))-ne0)){throw 'Only exact native reader rights, no foreign writer'}
|
||||
$seen[$id]=$true
|
||||
};foreach($id in @($sys,$admin)){if(!$seen[$id]){throw 'Privileged public-pin role missing'}}
|
||||
return $acl
|
||||
}
|
||||
function GrantRootReaders{
|
||||
$acl=ReadAcl $helperRoot $true
|
||||
foreach($id in @($agentSid,$helperSid)){
|
||||
$present=$false;foreach($rule in $acl.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])){if($rule.IdentityReference.Value-ceq$id-and([int64]$rule.FileSystemRights-band0x1200a9)-eq0x1200a9){$present=$true}}
|
||||
if(!$present){$acl.AddAccessRule((New-Object Security.AccessControl.FileSystemAccessRule((New-Object Security.Principal.SecurityIdentifier($id)),[Security.AccessControl.FileSystemRights]0x1200a9,'None','None','Allow')))}
|
||||
}
|
||||
# This-folder-only ACEs: do not expose state/PKI/ledger/intent descendants.
|
||||
Set-Acl -LiteralPath $helperRoot -AclObject $acl;$null=ReadAcl $helperRoot $true
|
||||
}
|
||||
function SetPinAcl($path){
|
||||
$acl=New-Object Security.AccessControl.FileSecurity;$acl.SetSecurityDescriptorSddlForm(('O:BAG:BAD:P(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;'+$agentSid+')(A;;0x1200a9;;;'+$helperSid+')'))
|
||||
Set-Acl -LiteralPath $path -AclObject $acl;$null=ReadAcl $path $false
|
||||
}
|
||||
function NewPrivateCase{
|
||||
[RmmTimeProfileCase]::CreatePrivateOnce($folder);CheckControl $folder $true
|
||||
}
|
||||
function FileVolume($path){
|
||||
$handle=[RmmPipeNative]::CreateFile($path,0x80,7,[IntPtr]::Zero,3,0x2200000,[IntPtr]::Zero)
|
||||
try{if($handle.IsInvalid){throw 'Protected directory identity handle'};$id=New-Object RmmPipeNative+FileId;if(![RmmPipeNative]::GetFileInformationByHandleEx($handle,18,[ref]$id,24)){throw 'Protected directory volume'};return $id.Volume.ToString([Globalization.CultureInfo]::InvariantCulture)}finally{$handle.Dispose()}
|
||||
}
|
||||
function SameLive($before,$after){
|
||||
Preserved $before $after $false
|
||||
foreach($field in @('files','service','helper_service','agent_kernel','helper_kernel')){if(!(JsonEqual $before.$field $after.$field)){throw 'Same original data/PKI/FileIDs/services/process generations required'}}
|
||||
}
|
||||
function ConfigBytes{
|
||||
$bytes=[Convert]::FromBase64String($request.config_base64)
|
||||
if($bytes.Length-gt16384-or$bytes.Length-lt1-or(BytesHash $bytes)-cne$request.config_sha256){throw 'Fixed complete public config bytes'}
|
||||
$value=[Text.Encoding]::UTF8.GetString($bytes)|ConvertFrom-Json
|
||||
if($value.schema_version-ne2-or$value.key_generation-ne$request.key_generation-or$value.server_instance-cne$request.server_instance-or!(JsonEqual $value.binding $request.binding)-or$value.trusted_os_active_guest.operating_assumption-cne'active_guest_no_pause_save_restore_snapshot_migration_host_suspend'-or$value.trusted_os_active_guest.platform-cne'kvm_qemu_hypervclock'-or@($value.trusted_os_active_guest.qualifications).Count-ne2-or$value.trusted_os_active_guest.qualifications[0].role-cne'agent'-or$value.trusted_os_active_guest.qualifications[0].binary_sha256-cne$p.new_agent-or$value.trusted_os_active_guest.qualifications[1].role-cne'system_helper'-or$value.trusted_os_active_guest.qualifications[1].binary_sha256-cne$p.new_helper){throw 'Closed real schema2/profile/role binding'}
|
||||
return ,$bytes
|
||||
}
|
||||
CheckControl $boot $true
|
||||
if($PSCommandPath-cne(Join-Path (Join-Path $boot $request.script_sha256) 'InstallPublicTimeProfile.ps1')-or(Hash $PSCommandPath)-cne$request.script_sha256){throw 'Exact reviewed public-pin controller'}
|
||||
CheckControl $PSCommandPath $false
|
||||
$expected=$request.expected_native
|
||||
$before=ActualState $true;SameLive $expected $before
|
||||
if($before.agent_kernel.service_sid-cne$agentSid-or$before.helper_kernel.service_sid-cne$helperSid){throw 'Same actual qualified service SIDs'}
|
||||
$null=ReadAcl $helperRoot $true
|
||||
if($request.action-ceq'read'){
|
||||
$records=[ordered]@{};if(Test-Path -LiteralPath $folder){CheckControl $folder $true;foreach($name in @('intent.json','directory-acl-intent.json','directory-acl-done.json','publish-intent.json','result.json')){$path=Join-Path $folder $name;$records[$name]=$null;if(Test-Path -LiteralPath $path){CheckControl $path $false;if((Get-Item -LiteralPath $path -Force).Length-gt2097152){throw 'Bounded original public-pin history'};$records[$name]=Get-Content -LiteralPath $path -Raw|ConvertFrom-Json}}}
|
||||
if($records['intent.json']){foreach($field in $request.PSObject.Properties.Name){if($field-cne'action'-and!(JsonEqual $records['intent.json'].request.$field $request.$field)){throw 'Same original public-pin intent only'}}}
|
||||
$activeRecord=$null;if(Test-Path -LiteralPath $active){CheckControl $active $false;if((Get-Item -LiteralPath $active -Force).Length-gt8192){throw 'Bounded public-pin active marker'};$activeRecord=Get-Content -LiteralPath $active -Raw|ConvertFrom-Json;if($activeRecord.id-cne$request.id-or$activeRecord.config_sha256-cne$request.config_sha256-or$activeRecord.script_sha256-cne$request.script_sha256){throw 'Another initial public-pin case; no adoption'}}
|
||||
$current=$null;if(Test-Path -LiteralPath $target){$null=ReadAcl $target $false;$current=FileIdentity $target;if($current.sha256-cne$request.config_sha256){throw 'Unexpected existing configuration; no adoption'}}
|
||||
@{id=$request.id;read_only=$true;records=$records;active=$activeRecord;configuration=$current;native=$before;root_sddl=(Get-Acl -LiteralPath $helperRoot).Sddl;clock_runtime_qualified=$false;no_jobs=$true}|ConvertTo-Json -Depth 50 -Compress;exit0
|
||||
}
|
||||
if($request.action-cne'install'){throw 'Exact install action only'}
|
||||
if((Test-Path -LiteralPath $target)-or(Test-Path -LiteralPath $folder)-or(Test-Path -LiteralPath $active)){throw 'Existing initial time profile or partial attempt: original read only'}
|
||||
$bytes=ConfigBytes
|
||||
$rootSddl=(Get-Acl -LiteralPath $helperRoot).Sddl
|
||||
$heldAgent=[RmmPipeNative]::Open([int]$before.service.pid);$heldHelper=[RmmPipeNative]::Open([int]$before.helper_service.pid)
|
||||
try{
|
||||
$null=Kernel 'agent' $before.service $heldAgent;$null=Kernel 'helper' $before.helper_service $heldHelper
|
||||
$installNotBefore=[DateTime]::UtcNow.ToString('o')
|
||||
NewPrivateCase
|
||||
WriteNew (Join-Path $folder 'intent.json') @{id=$request.id;request=$request;before=$before;original_root_sddl=$rootSddl;install_not_before=$installNotBefore;no_retry=$true}
|
||||
WriteNew $active @{id=$request.id;config_sha256=$request.config_sha256;script_sha256=$request.script_sha256;no_retry=$true}
|
||||
foreach($item in $request.provenance.PSObject.Properties){if($item.Name-cnotmatch'^(platform-provenance|public-platform|original-public-platform|agent-qualification|system_helper-qualification|qualified-time-public-key|public-binding)\.json$'){throw 'Closed public provenance leaves'};$raw=[Convert]::FromBase64String($item.Value);if($raw.Length-gt65536){throw 'Bounded public provenance'};WriteBytes (Join-Path $folder $item.Name) $raw}
|
||||
$staged=Join-Path $folder 'time-attestation.candidate.json';WriteBytes $staged $bytes;SetPinAcl $staged
|
||||
if((FileIdentity $staged).sha256-cne$request.config_sha256-or(FileVolume $folder)-cne(FileVolume $helperRoot)){throw 'Verified complete same-volume public pin'}
|
||||
SameLive $before (ActualState $true)
|
||||
if((Get-Acl -LiteralPath $helperRoot).Sddl-cne$rootSddl){throw 'Immediate directory ACL CAS'}
|
||||
WriteNew (Join-Path $folder 'directory-acl-intent.json') @{old_sddl=$rootSddl;readers=@($agentSid,$helperSid);this_folder_only=$true}
|
||||
GrantRootReaders
|
||||
WriteNew (Join-Path $folder 'directory-acl-done.json') @{sddl=(Get-Acl -LiteralPath $helperRoot).Sddl}
|
||||
SameLive $before (ActualState $true)
|
||||
$null=Kernel 'agent' $before.service $heldAgent;$null=Kernel 'helper' $before.helper_service $heldHelper
|
||||
if(Test-Path -LiteralPath $target){throw 'Target appeared before no-overwrite publication'}
|
||||
$stagedId=FileIdentity $staged
|
||||
WriteNew (Join-Path $folder 'publish-intent.json') @{config_sha256=$request.config_sha256;staged=$stagedId;create_once=$true}
|
||||
[IO.File]::Move($staged,$target)
|
||||
$null=ReadAcl $target $false;$published=FileIdentity $target
|
||||
if(!(JsonEqual $published $stagedId)){throw 'Exact same file identity/hash/ACL after publication'}
|
||||
$after=ActualState $true;SameLive $before $after
|
||||
$null=Kernel 'agent' $before.service $heldAgent;$null=Kernel 'helper' $before.helper_service $heldHelper
|
||||
$result=@{id=$request.id;installed=$true;install_not_before=$installNotBefore;configuration=$published;native=$after;original_root_sddl=$rootSddl;root_sddl=(Get-Acl -LiteralPath $helperRoot).Sddl;no_jobs=$true;clock_runtime_qualified=$false;services_changed=$false;private_key_read=$false}
|
||||
WriteNew (Join-Path $folder 'result.json') $result;$result|ConvertTo-Json -Depth 50 -Compress
|
||||
}finally{$heldAgent.Dispose();$heldHelper.Dispose()}
|
||||
'''.replace('exit0','exit 0')
|
||||
|
||||
|
||||
def controller():
|
||||
"""Reuse only existing read-only witnesses, not any old phase/repair code."""
|
||||
require(sha(Path(prior.__file__).read_bytes()) == 'e466576673a0e5c332cfc1613ae88a62f5b526015ced76b1d22473e292a995e0'
|
||||
and sha(Path(prior.u.__file__).read_bytes()) == 'f8dc1c8fbc064e253b1fbe130fb628afef58cf45c2bafb6837d6716125b42d38', 'unchanged reviewed original readonly witness sources')
|
||||
source = prior.u.SCRIPT
|
||||
# Every selected section ends at the next named function. No StartOnce,
|
||||
# StopPinned, Swap, Backup, original phase, or old payload dispatch is copied.
|
||||
names = ['Check','BytesHash','Hash','AclHash','CheckControl','Service','Probe','Diagnostic','RawAgentProbe','EmptyIntentStore','State','Preserved']
|
||||
functions=[]
|
||||
for name in names:
|
||||
start=source.index('function '+name+'(') if 'function '+name+'(' in source else source.index('function '+name+'{')
|
||||
end=source.find('\nfunction ',start+1)
|
||||
require(end>start, 'closed existing readonly witness boundary')
|
||||
functions.append(source[start:end])
|
||||
# File writers are new, closed by the controller's fixed namespace only.
|
||||
writers=r'''function WriteBytes($path,[byte[]]$bytes){$file=[IO.File]::Open($path,[IO.FileMode]::CreateNew,[IO.FileAccess]::Write,[IO.FileShare]::Read);try{$file.Write($bytes,0,$bytes.Length);$file.Flush($true)}finally{$file.Dispose()}}
|
||||
function WriteNew($path,$value){WriteBytes $path ([Text.Encoding]::UTF8.GetBytes(($value|ConvertTo-Json -Depth 50 -Compress)))}'''
|
||||
return HEADER+'\n'+STRUCTURAL+'\n'+'\n'.join(functions)+'\n'+prior.NATIVE+'\n'+CASE_NATIVE+'\n'+writers+'\n'+BODY
|
||||
|
||||
# Same reviewed structural comparison as e6debe5; member order is not identity.
|
||||
STRUCTURAL = r'''function CanonicalStateValue($value,[int]$depth=0){
|
||||
if($depth-gt40){throw 'Bounded state comparison depth'}
|
||||
if($null-eq$value){return $null}
|
||||
# ETS wrapping does not turn a CLR JSON scalar into a JSON object.
|
||||
$base=$value.PSObject.BaseObject;$culture=[Globalization.CultureInfo]::InvariantCulture
|
||||
if($base-is[string]){return [string]::new($base.ToCharArray())}
|
||||
if($base-is[char]){return [string]::new([char[]]@($base))}
|
||||
if($base-is[bool]){return [bool]::Parse($base.ToString())}
|
||||
if($base-is[sbyte]-or$base-is[int16]-or$base-is[int32]-or$base-is[int64]){return [int64]::Parse($base.ToString($culture),$culture)}
|
||||
if($base-is[byte]-or$base-is[uint16]-or$base-is[uint32]-or$base-is[uint64]){return [uint64]::Parse($base.ToString($culture),$culture)}
|
||||
if($base-is[single]-or$base-is[double]){$number=[double]::Parse($base.ToString('R',$culture),$culture);if([double]::IsNaN($number)-or[double]::IsInfinity($number)){throw 'Finite JSON state number required'};return $number}
|
||||
if($base-is[decimal]){return [decimal]::Parse($base.ToString($culture),$culture)}
|
||||
if($value-is[Collections.IDictionary]){$result=[ordered]@{};foreach($key in @($value.Keys|Sort-Object -CaseSensitive)){if($key-isnot[string]-or$result.Contains($key)){throw 'Nonunique state object key'};$result[$key]=CanonicalStateValue $value[$key] ($depth+1)};return $result}
|
||||
if($value-is[pscustomobject]){$result=[ordered]@{};foreach($property in @($value.PSObject.Properties|Sort-Object -Property Name -CaseSensitive)){if($property.Name-isnot[string]-or$result.Contains($property.Name)){throw 'Nonunique state object key'};$result[$property.Name]=CanonicalStateValue $property.Value ($depth+1)};return $result}
|
||||
if($value-is[Collections.IEnumerable]-and$value-isnot[string]){$result=New-Object 'Collections.Generic.List[object]';foreach($item in $value){$result.Add((CanonicalStateValue $item ($depth+1)))};return ,$result.ToArray()}
|
||||
return $value
|
||||
}
|
||||
function JsonEqual($a,$b){return((ConvertTo-Json -InputObject (CanonicalStateValue $a) -Depth 40 -Compress)-ceq(ConvertTo-Json -InputObject (CanonicalStateValue $b) -Depth 40 -Compress))}'''
|
||||
CASE_NATIVE = r'''Add-Type -TypeDefinition @'
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.AccessControl;
|
||||
public static class RmmTimeProfileCase {
|
||||
[StructLayout(LayoutKind.Sequential)] struct Attributes {public int Length;public IntPtr Descriptor;public int Inherit;}
|
||||
[DllImport("kernel32.dll",EntryPoint="CreateDirectoryW",ExactSpelling=true,CharSet=CharSet.Unicode,SetLastError=true)]
|
||||
[return:MarshalAs(UnmanagedType.Bool)] static extern bool CreateDirectory(string path,ref Attributes security);
|
||||
public static void CreatePrivateOnce(string path){
|
||||
RawSecurityDescriptor sd=new RawSecurityDescriptor("O:BAG:BAD:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)");
|
||||
byte[] raw=new byte[sd.BinaryLength];sd.GetBinaryForm(raw,0);GCHandle pin=GCHandle.Alloc(raw,GCHandleType.Pinned);
|
||||
try{Attributes attributes=new Attributes{Length=Marshal.SizeOf(typeof(Attributes)),Descriptor=pin.AddrOfPinnedObject(),Inherit=0};
|
||||
if(!CreateDirectory(path,ref attributes))throw new Win32Exception(Marshal.GetLastWin32Error(),"TIME_PROFILE_PRIVATE_CREATE_ONCE");
|
||||
}finally{pin.Free();}
|
||||
}
|
||||
}
|
||||
'@'''
|
||||
|
||||
LAUNCH = r'''$ErrorActionPreference='Stop';$request=([Console]::In.ReadLine()|ConvertFrom-Json)
|
||||
if(!$request-or$request.action-isnot[string]-or$request.action-cnotin@('install','read')-or$request.script_sha256-cnotmatch'^[a-f0-9]{64}$'){throw 'Fixed public-pin launch'}
|
||||
$script=Join-Path (Join-Path 'C:\ProgramData\RustDiscoveryBootstrap' $request.script_sha256) 'InstallPublicTimeProfile.ps1'
|
||||
$item=Get-Item -LiteralPath $script -Force;if($item.PSIsContainer-or($item.Attributes-band[IO.FileAttributes]::ReparsePoint)-or$item.Length-gt100000-or(Get-FileHash -LiteralPath $script -Algorithm SHA256).Hash.ToLowerInvariant()-cne$request.script_sha256){throw 'Exact bounded immutable time-pin script'}
|
||||
$acl=Get-Acl -LiteralPath $script;if($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value-cnotin@('S-1-5-18','S-1-5-32-544')){throw 'Private launch owner'}
|
||||
foreach($rule in $acl.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])){if($rule.AccessControlType-cne'Allow'-or$rule.IdentityReference.Value-cnotin@('S-1-5-18','S-1-5-32-544')){throw 'Private launch DACL'}}
|
||||
$global:RmmTimeProfilePayload=$request;& $script
|
||||
'''
|
||||
|
||||
def guards():
|
||||
script=controller()
|
||||
for forbidden in ('Stop-Service','Start-Service','Restart-Computer','Set-Date','AdjustTokenPrivileges',
|
||||
'function Swap','function Backup','function StartOnce','CreateService(', 'DeleteService('):
|
||||
require(forbidden not in script, 'no service/clock/job effect imported')
|
||||
require("$request.action-cnotin@('install','read')" in script
|
||||
and "if($request.action-cne'install')" in script
|
||||
and '[IO.File]::Move($staged,$target)' in script
|
||||
and script.index("'publish-intent.json') @") < script.index('[IO.File]::Move($staged,$target)')
|
||||
and 'This-folder-only ACEs' in script and '0x1200a9' in script
|
||||
and 'CreatePrivateOnce' in script, 'closed create-once public-pin effects')
|
||||
return script
|
||||
|
||||
def prepare():
|
||||
# All prerequisites are checked BEFORE creating a local installation case.
|
||||
# Source/link/role constants deliberately remain unset until actual evidence.
|
||||
require(PAIR_ID is not None and str(uuid.UUID(PAIR_ID)) == PAIR_ID
|
||||
and all(isinstance(value,str) and re.fullmatch('[a-f0-9]{64}',value)
|
||||
for value in (PAIR_RESULT_SHA,PAIR_INTENT_SHA,PAIR_READBACK_SHA)),
|
||||
'actual completed new pair and independently pinned role readback required')
|
||||
public=public_inputs(); source_inputs(); raw=raw_inputs()
|
||||
pair=PAIR_ROOT/PAIR_ID
|
||||
result_raw,result=read(pair/'result.json',PAIR_RESULT_SHA)
|
||||
intent_path=pair/'intent.json'
|
||||
if not intent_path.exists(): intent_path=pair/'bound-payload.json'
|
||||
intent_raw,intent=read(intent_path,PAIR_INTENT_SHA)
|
||||
_, independent=read(pair/'independent-readback.json',PAIR_READBACK_SHA)
|
||||
require(independent.get('id') == PAIR_ID and independent.get('completed') is True
|
||||
and independent.get('read_only') is True and independent.get('no_job') is True
|
||||
and independent.get('no_service_action') is True
|
||||
and result['independent_readback_sha256'] == PAIR_READBACK_SHA
|
||||
and result['intent_sha256'] == PAIR_INTENT_SHA
|
||||
and all(independent['native'][key] == result['native'][key]
|
||||
for key in ('files','service','helper_service','agent_kernel','helper_kernel')),
|
||||
'original independent same-generation role and file readback')
|
||||
items,native,payload=produce(public,result,intent,raw,sha(result_raw),sha(intent_raw))
|
||||
items['original-public-platform.json']=read(PUBLIC/'public-platform.json',PUBLIC_SHAS['public-platform.json'])[0]
|
||||
for name in ('qualified-time-public-key.json','public-binding.json'):
|
||||
items[name]=read(PUBLIC/name,PUBLIC_SHAS[name])[0]
|
||||
script=guards().encode(); ident=str(uuid.uuid4()); script_sha=sha(script)
|
||||
keep=('old_agent','old_helper','new_agent','new_helper','old_policy','old_pin','new_policy','new_pin',
|
||||
'config_sha256','probe_sha256','system_probe_sha256','intent_leaves')
|
||||
public_payload={key:payload[key] for key in keep}
|
||||
request={'profile':'rmm.windows.initial-public-time-profile.v2','id':ident,'action':'read',
|
||||
'script_sha256':script_sha,'config_sha256':sha(items['time-attestation.json']),
|
||||
'config_base64':base64.b64encode(items.pop('time-attestation.json')).decode(),
|
||||
'pair_payload':public_payload,'expected_native':native,'binding':public['public-binding.json'],
|
||||
'key_generation':public['qualified-time-public-key.json']['key_generation'],
|
||||
'server_instance':public['qualified-time-public-key.json']['server_instance'],
|
||||
'provenance':{name:base64.b64encode(value).decode() for name,value in items.items()}}
|
||||
# Existing transport passes the payload on stdin, not on the command line.
|
||||
require(len(canonical(request))<=128*1024,'bounded public bootstrap request')
|
||||
STATE.mkdir(mode=0o700,parents=True,exist_ok=True);ident_dir=STATE/ident;ident_dir.mkdir(mode=0o700)
|
||||
write(ident_dir/'InstallPublicTimeProfile.ps1',script)
|
||||
write(ident_dir/'time-attestation.json',base64.b64decode(request['config_base64'],validate=True))
|
||||
for name,value in items.items(): write(ident_dir/name,value)
|
||||
manifest={'profile':request['profile'],'id':ident,'generator_sha256':sha(Path(__file__).read_bytes()),
|
||||
'script_sha256':script_sha,'request':request,'pair_result_sha256':sha(result_raw),
|
||||
'pair_intent_sha256':sha(intent_raw),'source_receipt_sha256':SOURCE_RECEIPT,
|
||||
'product_link_receipt_sha256':LINK_RECEIPT,'target_called':False,'clock_runtime_qualified':False,
|
||||
'files':{name:{'sha256':sha(value),'bytes':len(value)} for name,value in items.items()}}
|
||||
write(ident_dir/'manifest.json',canonical(manifest))
|
||||
print(json.dumps({'id':ident,'prepared_locally':True,'target_called':False,
|
||||
'config_sha256':request['config_sha256'],'manifest_sha256':sha(canonical(manifest))}))
|
||||
|
||||
def load_case(ident):
|
||||
require(str(uuid.UUID(ident))==ident and uuid.UUID(ident).version==4,'canonical original time-pin case')
|
||||
folder=STATE/ident; _,manifest=read(folder/'manifest.json')
|
||||
require(manifest['id']==ident and manifest['generator_sha256']==sha(Path(__file__).read_bytes())
|
||||
and manifest['script_sha256']==sha(guards().encode()),'same exact reviewed operator and case')
|
||||
require(read(folder/'InstallPublicTimeProfile.ps1',decode=False)[0]==guards().encode(), 'same controller bytes')
|
||||
request=manifest['request'];read(folder/'time-attestation.json',request['config_sha256'])
|
||||
for name,item in manifest['files'].items(): read(folder/name,item['sha256'])
|
||||
return folder,manifest
|
||||
|
||||
def target(action,ident):
|
||||
"""Only Root invokes these explicit phases after independent review."""
|
||||
folder,manifest=load_case(ident)
|
||||
require(action in ('stage','install','read'),'closed public-pin phase')
|
||||
if action!='read':
|
||||
write(folder/(action+'-attempt.json'),canonical({'id':ident,'action':action,'once':True,'lost_reply_read_original_case_only':True}))
|
||||
access=raw_capture.CaptureAccess(MAIN)
|
||||
if action=='stage':
|
||||
path=folder/'InstallPublicTimeProfile.ps1';digest=manifest['script_sha256']
|
||||
stage=prior.u.transport.PREPARE_SCRIPT.replace('TransportAcceptance.ps1',path.name)
|
||||
observed=access.powershell(stage,{'sha256':digest})
|
||||
if not observed['already_uploaded']:
|
||||
import subprocess
|
||||
config=prior.cb.contract.protected_json(MAIN/'credentials/windows-dev-access.json')
|
||||
prefix=config['ssh_prefix'];args=['sftp']+[p for p in prefix[1:-1] if p!='-T']+['-b','-',prefix[-1]]
|
||||
remote='/C:/ProgramData/RustDiscoveryBootstrap/'+digest+'/'+path.name
|
||||
reply=subprocess.run(args,input=('put '+json.dumps(str(path.resolve()))+' '+json.dumps(remote)+'\n').encode(),capture_output=True,timeout=60)
|
||||
write(folder/'stage-transport.json',canonical({'returncode':reply.returncode,'stdout_b64':base64.b64encode(reply.stdout).decode(),'stderr_b64':base64.b64encode(reply.stderr).decode()}))
|
||||
require(reply.returncode==0,'once-only fixed script transfer; lost reply read only')
|
||||
observed=access.powershell(stage,{'sha256':digest})
|
||||
require(observed['already_uploaded'] is True and observed['sha256']==digest,'exact staged public-pin controller')
|
||||
result={'id':ident,'staged':True,'script_sha256':digest,'configuration_installed':False}
|
||||
else:
|
||||
request=copy.deepcopy(manifest['request']);request['action']=action
|
||||
result=access.powershell(LAUNCH,request,timeout=120)
|
||||
require(result['id']==ident and result.get('no_jobs') is True and result.get('clock_runtime_qualified') is False,
|
||||
'same native public-pin result, never clock readiness')
|
||||
output=folder/((action+'-'+str(uuid.uuid4()) if action=='read' else action)+'-reply.json')
|
||||
write(output,canonical(result))
|
||||
print(json.dumps({'id':ident,'action':action,'reply_sha256':sha(canonical(result)),'clock_runtime_qualified':False}))
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('action',choices=('guards','prepare','stage','install','read'));parser.add_argument('--case');arguments=parser.parse_args()
|
||||
if arguments.action=='guards': guards();print('PASS closed public-profile source guards; no target action')
|
||||
elif arguments.action=='prepare': prepare()
|
||||
else: target(arguments.action,arguments.case)
|
||||
@@ -19,7 +19,7 @@ EXE_BYTES=19172660
|
||||
PIN=ROOT/'devstate/server-time-source-bootstrap/qualified-time-public-key.json'
|
||||
PIN_SHA='c31d31d2d61f881d04f55f704abbbf98f4822650c016f39e39d4d2318bc3f6e2'
|
||||
# Root pins {id, receipt_sha256} only after the actual post-deploy collector read.
|
||||
CONTEXT_GATE={'id':'68b841a5-784f-4a34-a8a4-060b267713f0','receipt_sha256':'658fa5ffa63c6e412237f5feb718b745bb560230f17c54e437ad8bd98e9ad65b'}
|
||||
CONTEXT_GATE=None
|
||||
require,save,load,sha=original.require,original.save,original.load,original.sha
|
||||
|
||||
SCRIPT=r'''$ErrorActionPreference='Stop';$p=([Console]::In.ReadLine()|ConvertFrom-Json)
|
||||
@@ -187,96 +187,3 @@ if __name__=='__main__':
|
||||
if a.action=='guards':guards();print('PASS source guards; no target call')
|
||||
elif a.action=='prepare':require(a.case is None,'actual sealed context determines own case');prepare()
|
||||
else:require(a.case is not None,'original case required');run(a.action,a.case)
|
||||
|
||||
# Direct, read-only recovery of this original staged case after the historical
|
||||
# upgrade finish reader timed out. No historical manifest or reply is rewritten.
|
||||
DIRECT_CASE='68b841a5-784f-4a34-a8a4-060b267713f0'
|
||||
DIRECT_MANIFEST='22f3bc7c143a893729f193133858696f377a84296c5843bde8b1354c1493389b'
|
||||
DIRECT_OPERATOR='a817f45b43fa15feaa24a8ec8d4eea404f0e2bcf75ff252da166aebfa63b5c55'
|
||||
|
||||
|
||||
def direct_source():
|
||||
prior=original.pipe
|
||||
checks=prior.PREFIX.split('function Check(',1)[1].split('function PrivateBackupAcl',1)[0]
|
||||
service=prior.PREFIX.split('function Service($role){',1)[1].split('function Probe(',1)[0]
|
||||
native=prior.NATIVE.split('function FileIdentity(',1)[0]
|
||||
identity=prior.NATIVE.split('function FileIdentity(',1)[1].split('function Kernel(',1)[0]
|
||||
kernel=prior.NATIVE.split('function Kernel(',1)[1].split('function ActualState',1)[0]
|
||||
metadata=prior.NATIVE.split('function FileIdentityMetadata(',1)[1].split('function SameOriginal',1)[0]
|
||||
return r'''$ErrorActionPreference='Stop';$p=$global:RmmRouteDirectPreservationPayload
|
||||
if((($p.PSObject.Properties.Name|Sort-Object)-join',')-cne'kind'-or$p.kind-cne'fixed-time-route-direct-preservation'){throw 'Fixed readonly observation'}
|
||||
$agentName='RmmDiscoveryWindows';$helperName='RmmDiscoverySystemHelper';$sys='S-1-5-18';$admin='S-1-5-32-544'
|
||||
$agentRoot='C:\ProgramData\RustDiscovery';$agentState=Join-Path $agentRoot 'state';$helperRoot='C:\ProgramData\RustDiscoverySystem';$helperState=Join-Path $helperRoot 'state'
|
||||
$agentBinary='C:\Program Files\RustDiscovery\rmm-agent-windows.exe';$helperBinary='C:\Program Files\RustDiscovery\rmm-helper-windows.exe'
|
||||
$agentSid=(New-Object Security.Principal.NTAccount('NT SERVICE',$agentName)).Translate([Security.Principal.SecurityIdentifier]).Value
|
||||
$helperSid=(New-Object Security.Principal.NTAccount('NT SERVICE',$helperName)).Translate([Security.Principal.SecurityIdentifier]).Value
|
||||
'''+'function JsonEqual($a,$b){return(($a|ConvertTo-Json -Depth 40 -Compress)-ceq($b|ConvertTo-Json -Depth 40 -Compress))}\n'+'function Check('+checks+'function Service($role){'+service+'\n'+native+'function FileIdentity('+identity+'function Kernel('+kernel+'function FileIdentityMetadata('+metadata+r'''
|
||||
$services=[ordered]@{};$kernels=[ordered]@{};foreach($role in @('agent','helper')){$s=Service $role;if($s.state-cne'Running'){throw 'Both original services running'};$h=[RmmPipeNative]::Open([int]$s.pid);try{$kernels[$role]=Kernel $role $s $h;if(!(JsonEqual $s (Service $role))){throw 'Actual service race'}}finally{$h.Dispose()};$services[$role]=$s}
|
||||
$files=[ordered]@{};foreach($entry in @(@('agent',$agentBinary),@('helper',$helperBinary),@('settings',(Join-Path $helperRoot 'helper.json')),@('pin',(Join-Path $helperRoot 'agent-pin.json')),@('config',(Join-Path $agentRoot 'config.json')),@('ca',(Join-Path $agentRoot 'server-ca.pem')),@('identity',(Join-Path $agentState 'identity.json')),@('certificate',(Join-Path $agentState 'device.pem')))){$files[$entry[0]]=FileIdentity $entry[1] ($entry[0]-in@('ca','identity','certificate'))}
|
||||
$files.private_key=FileIdentityMetadata (Join-Path $agentState 'device.key')
|
||||
$db=[ordered]@{};foreach($entry in @(@('telemetry',(Join-Path $agentState 'telemetry.sqlite')),@('helper',(Join-Path $helperState 'ledger.sqlite')),@('lock',(Join-Path $helperState 'executor.lock')))){$m=FileIdentityMetadata $entry[1];$i=Get-Item -LiteralPath $entry[1];$db[$entry[0]]=@{volume_serial=$m.volume_serial;file_id=$m.file_id;creation_filetime=$i.CreationTimeUtc.ToFileTimeUtc().ToString();acl_sha256=$m.acl_sha256}}
|
||||
@{files=$files;services=$services;kernels=$kernels;database_identities=$db;read_only=$true;private_key_read=$false;database_content_read=$false;services_changed=$false}|ConvertTo-Json -Depth 25 -Compress
|
||||
'''
|
||||
|
||||
|
||||
def direct_witness(access,baseline):
|
||||
source=direct_source();require(all(v not in source for v in ('Start-Service','Stop-Service','WriteNew','PrivateBackupAcl','function Probe','function State')),'direct observation has no old probe or mutation')
|
||||
digest=hashlib.sha256(source.encode()).hexdigest()
|
||||
launcher=r'''$ErrorActionPreference='Stop';$q=([Console]::In.ReadLine()|ConvertFrom-Json)
|
||||
$raw=[Convert]::FromBase64String($q.source_base64);$h=[Security.Cryptography.SHA256]::Create();try{$sha=([BitConverter]::ToString($h.ComputeHash($raw))).Replace('-','').ToLowerInvariant()}finally{$h.Dispose()}
|
||||
if($sha-cne'FIXED_SOURCE_SHA'){throw 'Exact direct reader source'}
|
||||
$global:RmmRouteDirectPreservationPayload=$q.payload
|
||||
& ([scriptblock]::Create([Text.Encoding]::UTF8.GetString($raw)))
|
||||
'''.replace('FIXED_SOURCE_SHA',digest)
|
||||
value=access.powershell(launcher,dict(source_base64=base64.b64encode(source.encode()).decode(),payload=dict(kind='fixed-time-route-direct-preservation')),timeout=45)
|
||||
save(STATE/DIRECT_CASE/('direct-observed-'+str(uuid.uuid4())+'.json'),value)
|
||||
old=baseline['native'];stable=old['stable']
|
||||
require(value['read_only'] is True and value['private_key_read'] is False and value['database_content_read'] is False
|
||||
and value['files']==stable['files'],'actual original public file bytes/FileIDs/ACLs and private-key metadata')
|
||||
for role,name in [('agent','service'),('helper','helper_service')]:
|
||||
require(value['services'][role]==stable[name] and value['kernels'][role]==stable[role+'_kernel'],'same running original service/kernel PID/birth/image/account')
|
||||
telemetry=value['database_identities']['telemetry'];old_id=old['journal']['database_file_id'];old_birth=old['journal']['database_creation']
|
||||
require(int(telemetry['volume_serial'])&0xffffffff==old_id['volume']
|
||||
and int.from_bytes(bytes.fromhex(telemetry['file_id'])[:8],'little')==((old_id['high']<<32)|old_id['low'])
|
||||
and int(telemetry['creation_filetime'])==((old_birth['high']<<32)|old_birth['low']),'original telemetry native identity/creation')
|
||||
value['historical_helper_metadata_comparison']={}
|
||||
for name,previous in [('helper',stable['helper_witness']['helper_ledger']['file']),('lock',stable['helper_witness']['executor_lock'])]:
|
||||
current=value['database_identities'][name]
|
||||
value['historical_helper_metadata_comparison'][name]=dict(volume_equal=current['volume_serial']==previous['file_id']['volume_serial'],file_id_equal=current['file_id']==previous['file_id']['id_hex'],creation_equal=current['creation_filetime']==previous['creation_filetime'],acl_digest_equal=current['acl_sha256']==previous['acl_sha256'],historical_probe_not_repeated=True)
|
||||
return value
|
||||
|
||||
|
||||
def direct(action):
|
||||
require(action in ('run-direct','read-direct'),'fixed passive recovery phase');guards()
|
||||
folder=STATE/DIRECT_CASE;manifest=load(folder/'manifest.json');baseline=load(folder/'baseline.json')
|
||||
require(sha(folder/'manifest.json')==DIRECT_MANIFEST and manifest['operator_sha256']==DIRECT_OPERATOR
|
||||
and manifest['context_gate']==CONTEXT_GATE and manifest['dependencies']==original.dependencies()
|
||||
and sha(folder/'TimeRouteProbe.exe')==EXE_SHA and sha(folder/'time-public-key.json')==PIN_SHA
|
||||
and sha(folder/'context.json')==manifest['context_sha256'] and sha(folder/'TimeRouteAcceptance.ps1')==hashlib.sha256(SCRIPT.encode()).hexdigest(),'fixed original staged case only')
|
||||
stage=load(folder/'stage-reply.json');require(stage==dict(id=DIRECT_CASE,manifest_sha256=DIRECT_MANIFEST,staged=True),'actual original stage response')
|
||||
original.original_main();access=original.CaptureAccess(original.ACCESS_ROOT)
|
||||
operation='run-direct' if action=='run-direct' else 'read-direct-'+str(uuid.uuid4())
|
||||
if action=='run-direct':
|
||||
require(not (folder/'run-attempt.json').exists(),'original automatic run was never attempted')
|
||||
gate_id,context,receipt=gate();require(gate_id==DIRECT_CASE,'same actual context gate')
|
||||
require(collector.rpc(access,dict(id=DIRECT_CASE,deployment_result_sha256=receipt['deployment_result_sha256'],image=collector.IMAGE),folder)==load(context/'response.json'),'actual context still exact')
|
||||
intent_name=operation+'-intent.json'
|
||||
if (folder/intent_name).exists():intent_name=operation+'-preflight-'+str(uuid.uuid4())+'.json'
|
||||
save(folder/intent_name,dict(action=action,operator_sha256=sha(__file__),original_manifest_sha256=DIRECT_MANIFEST,
|
||||
direct_source_sha256=hashlib.sha256(direct_source().encode()).hexdigest(),read_only=action=='read-direct',historical_stage_witness_timeout_retained=True))
|
||||
before_server=original.server_closed(access);require(before_server==baseline['server'],'same closed server original counts and flags')
|
||||
before=direct_witness(access,baseline);save(folder/(operation+'-before.json'),before)
|
||||
payload=dict(action='run' if action=='run-direct' else 'read',id=DIRECT_CASE,manifest_sha256=DIRECT_MANIFEST,context_sha256=manifest['context_sha256'],context_base64=base64.b64encode((folder/'context.json').read_bytes()).decode(),pin_base64=base64.b64encode((folder/'time-public-key.json').read_bytes()).decode())
|
||||
if action=='run-direct':save(folder/'run-direct-start-intent.json',dict(action='run',once=True,no_retry=True,operator_sha256=sha(__file__),direct_before_sha256=sha(folder/(operation+'-before.json'))))
|
||||
try:response=access.powershell(SCRIPT,payload,timeout=45)
|
||||
except subprocess.TimeoutExpired:
|
||||
save(folder/(operation+'-timeout.json'),dict(error='SSH_TIMEOUT_45_SECONDS',result_unknown=True,repeat_run=False));raise RuntimeError('passive response missing; original read only') from None
|
||||
save(folder/(operation+'-reply.json'),response)
|
||||
after_server=original.server_closed(access);after=direct_witness(access,baseline)
|
||||
save(folder/(operation+'-after.json'),after);require(before==after and before_server==after_server,'actual service/PKI/config/native DB identities and closed server counts preserved')
|
||||
save(folder/(operation+'-preservation.json'),dict(id=DIRECT_CASE,operation=operation,operator_sha256=sha(__file__),original_manifest_sha256=DIRECT_MANIFEST,
|
||||
raw_reply_sha256=sha(folder/(operation+'-reply.json')),before_sha256=sha(folder/(operation+'-before.json')),after_sha256=sha(folder/(operation+'-after.json')),
|
||||
server_before=before_server,server_after=after_server,direct_native_preserved=True,old_finish_timeout_remains=True,no_jobs_created=True,no_service_action=True))
|
||||
require(response['id']==DIRECT_CASE and response['manifest_sha256']==DIRECT_MANIFEST,'actual own original reply')
|
||||
if action=='run-direct' or 'report.json' in response.get('records',{}):validate(response,manifest)
|
||||
print(json.dumps(dict(id=DIRECT_CASE,operation=operation,verified='report.json' in response.get('records',{}),preserved=True)))
|
||||
|
||||
@@ -14,7 +14,8 @@ import signed_clock_capture_acceptance as original
|
||||
ROOT=original.ROOT
|
||||
STATE=ROOT/'devstate/windows-time-route-context'
|
||||
# Root binds the actual successful deployment result SHA after its separate read.
|
||||
DEPLOYMENT_RESULT_SHA='3017634f101ee8aff62988f195ccb3a7a8b9e03eaa48b8fb339af9ceb3ad2b4b'
|
||||
DEPLOYMENT_RESULT_SHA=None
|
||||
DEPLOYMENT_PATH='/opt/rust-discovery/devstate/time-gateway-deploy-fb87aa88-2b67-4cff-9c90-4cd713380889/result.json'
|
||||
IMAGE='sha256:422c2c28a91ac512e9317908f4d1fb22247eef857ca95d45e1b1880598b0d611'
|
||||
BINDING_SHA='05c5678fed81e0a2a7cdaaeaf18c64f9837cfbe76c140699a47306c9b4598a18'
|
||||
require,save,load,sha=original.require,original.save,original.load,original.sha
|
||||
@@ -29,7 +30,7 @@ def server_read(p):
|
||||
need(str(uuid.UUID(p['id']))==p['id'] and isinstance(p['deployment_result_sha256'],str) and len(p['deployment_result_sha256'])==64
|
||||
and all(v in '0123456789abcdef' for v in p['deployment_result_sha256'])
|
||||
and p['image']=='sha256:422c2c28a91ac512e9317908f4d1fb22247eef857ca95d45e1b1880598b0d611')
|
||||
path=Path('/opt/rust-discovery/devstate/time-gateway-deploy-fb87aa88-2b67-4cff-9c90-4cd713380889/continue-backend-v1/result.json')
|
||||
path=Path('/opt/rust-discovery/devstate/time-gateway-deploy-fb87aa88-2b67-4cff-9c90-4cd713380889/result.json')
|
||||
metadata=path.lstat();need(stat.S_ISREG(metadata.st_mode) and metadata.st_uid==0 and metadata.st_nlink==1
|
||||
and stat.S_IMODE(metadata.st_mode)==0o600 and metadata.st_size<=65536)
|
||||
def identity(m):return(m.st_dev,m.st_ino,m.st_mode,m.st_uid,m.st_gid,m.st_nlink,m.st_size,m.st_mtime_ns,m.st_ctime_ns)
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
# Normaler passiver Releasekatalogcheck
|
||||
|
||||
Stand2026-11-15. Der Linux-Agent ruft den vorhandenen Releasekatalog jetzt aus
|
||||
seinem normalen `queue_update_observation`-Pfad auf. Dies ist ein passiver
|
||||
Metadatencheck, kein Artefaktbezug, Staging, Job oder ausgeführtes Selbstupdate.
|
||||
|
||||
## Aufruf, Vertrauen und Grenzen
|
||||
|
||||
Der Collector startet höchstens einen Hintergrundrequest. Erfolgreiche Checks
|
||||
werden nach24h erneuert; fehlende Konfiguration oder Fehler frühestens nach60s.
|
||||
35s Gesamtfrist und64KiB Antwortlimit gelten zusätzlich zu den vorhandenen
|
||||
mTLS-/HTTPgrenzen. Heartbeats, Cancel und SignedSync warten nicht auf HTTP.
|
||||
Die URL bleibt `/agent/v1/releases/current` am bereits konfigurierten TLSnamen;
|
||||
der vorhandene Connectoverride ändert ausschließlich das TCPziel. Keine
|
||||
Weiterleitung, Umgebungsproxy-, System-CA- oder Jobsigner-Ersatzannahme.
|
||||
|
||||
Verwendet werden ausschließlich die bereits vorgesehenen geschützten öffentlichen
|
||||
Dateien `/etc/rmm-agent-updater/policy.json`, `keyring.json` und
|
||||
`/var/lib/rmm-agent-updater/installed-record.json`. Eigentümer/Eltern sindRoot,
|
||||
keine Symlinks oder gruppen-/weltbeschreibbaren Pfade; reguläre Dateien,
|
||||
ein Hardlink, feste Größenlimits. Gehaltene FD-/Inode-/Metadaten-/Rawbytezeugen
|
||||
werden nach dem Request erneut geprüft. Es entstehen keine lokalen Dateien,
|
||||
keine Schlüsselprovisionierung und keine geänderten Dateirechte.
|
||||
|
||||
Policyidentität muss zum vorhandenen Gerätebinding passen. Separater
|
||||
Releasekeyring, aktuelle Widerrufe/Sequenzbereiche, echte Baseline- und
|
||||
Releasesignaturen, Linuxplattform, qualifizierter Protokoll-/Statevertrag,
|
||||
Updaterversion, Fristen und unveränderter Floor werden unabhängig geprüft.
|
||||
Serverzeit und die zusätzliche unsignierte Manifestansicht ersetzen keine
|
||||
lokale TrustedClock oder signierten Originalbytes; beide Manifestansichten
|
||||
müssen übereinstimmen. Fehlende Anker ergeben `not_configured`, Transport-/TLS-/
|
||||
Prüfprobleme `unavailable`; gültige Metadaten ergeben `available` oder `current`.
|
||||
|
||||
Dieser enge Erstanschluss akzeptiert als Flooranker ausschließlich die exakten
|
||||
separat signierten Bootstrap-InstalledRecordbytes. Ein späterer `Updated`-Record
|
||||
benötigt die noch fehlende unabhängig authentisierte read-only Fullhelper-
|
||||
Historybeobachtung; bloßes Parsen der neueren Recorddatei erzeugt keine
|
||||
Vertrauens- oder Floorfreigabe. Eine tatsächliche geschützte Konfiguration muss
|
||||
für den unprivilegierten Agent lesbar provisioniert sein. Unlesbare Dateien
|
||||
bleiben ehrlich unavailable; dieser Code lockert keine ACL.
|
||||
|
||||
## Übertragung und Darstellung mit älteren Servern
|
||||
|
||||
Der unveränderte `agent.update`-Snapshot erhält **kein zusätzliches Top-Level-
|
||||
Feld**. Seine qualifizierte Vorgänger-/Fullpreview bleibt `not_configured`;
|
||||
Katalogmetadaten sind keine `CandidatePreview` und eröffnen keine Check-/Applycap.
|
||||
|
||||
Der gespeicherte Katalogbericht wird ausschließlich beim ohnehin geplanten
|
||||
normalen Linuxinventar als begrenzte bestehende Unterbeobachtung
|
||||
`linux.agent_update.catalog` übertragen. Kein zusätzlicher Basiscollect wird
|
||||
angefordert. Dieser `linux.base`-/`observations`-Vertrag wird bereits von älteren
|
||||
Servern angenommen; kein neues Protobuftag und keine neue Servercap sind nötig.
|
||||
Die äußere Beobachtungszeit bezeichnet das Lesen des Caches. Das innere
|
||||
`checked_at` bleibt die tatsächliche ursprüngliche Checkzeit und wird beim
|
||||
Übertragen nicht erneuert. Über72h alte Cachewerte werden nicht neu angehängt.
|
||||
|
||||
Der aktuelle Domain-Ingest validiert zusätzlich den bekannten Berichtstyp,
|
||||
Qualität, Zeit, Kandidatenform und geschlossene Feldmenge. Altclients ohne diese
|
||||
Beobachtung bleiben gültig. Die bestehende tenantgebundene Inventoryspeicherung
|
||||
und Geräte-API transportieren dieselben geprüften Daten. Die WebUI zeigt Status,
|
||||
echten Checkzeitpunkt, spätere Cachelesezeit und gegebenenfalls Version/Hash als
|
||||
Text. Sie erzeugt keine Requests oder Bedienung zur Ausführung aus dem Bericht.
|
||||
Gemeinsame synthetische Codecfixture:
|
||||
`tests/agent_update/catalog-check-inventory.json`.
|
||||
|
||||
## Tatsächliche lokale Prüfungen
|
||||
|
||||
Im vorhandenen isolierten Rust1.99.1-Buildcontainer, Netzwerk aus:
|
||||
|
||||
```text
|
||||
cargo test --release --locked --offline -p rmm-agent -p rmm-domain --all-targets
|
||||
cargo clippy --locked --offline -p rmm-agent -p rmm-domain --all-targets -- -D warnings
|
||||
cargo fmt -p rmm-agent -p rmm-domain --check
|
||||
```
|
||||
|
||||
Abschließend89Tests bestanden,0Fehler/ignorierte/gefilterte im gesamten Lauf
|
||||
(Agentbinary32, weitere Agentintegration34, Domain23). Clippy und Formatcheck
|
||||
bestanden. Web55/55 und Typecheck bestanden. Die sechs gezielten neuen Fälle
|
||||
enthalten echte synthetische Ed25519-Baseline-/Releasebytes und einen tatsächlich
|
||||
laufenden lokalen mTLS-Testserver mit eigener CA/Geräteidentität: fester Pfad,
|
||||
Clientzertifikat, Antwort-/Redirect-/Größenverweigerung, Floor/Protokoll/Schema/
|
||||
Ablauf/Keywiderruf, fehlender Anker, falsche Baseline und unzulässige Recordbytes.
|
||||
Der Wirefall durchläuft echte Protobufbytes bis zum tatsächlichen
|
||||
`validate_for_scope`; UI und Rust benutzen dieselbe statische Datenfixture.
|
||||
|
||||
Zusätzlich wurde exakt der positive Kompatibilitätsfall mit dem ursprünglich
|
||||
unveränderten Ingestvalidator aus `c1d8eea` als privatem Datei-Mount ausgeführt:
|
||||
1/1 bestanden. Nach diesem Altvalidatorlauf schlug ein nachfolgender Negativfall
|
||||
zunächst fehl. Nach gezieltem Bereinigen der beiden betroffenen Pakete im eigenen
|
||||
Buildcache und vollständigem Neubuild bestand der gesamte89er-Lauf. Die
|
||||
Altvalidator-, erste Fehler- und abschließenden Logs bleiben getrennt erhalten;
|
||||
der fehlgeschlagene Lauf ist kein Erfolgsbeleg. Ein erster unbenutzter Import
|
||||
wurde ohne Warnungsunterdrückung korrigiert.
|
||||
|
||||
Der öffentliche Datei-Guardtest benötigt keinRoot: Unprivilegiert beweist er die
|
||||
Verweigerung des eigenen unprivilegierten/beschreibbaren Pfads. Nur der gesonderte
|
||||
lokale Rootlauf prüft zusätzlich ein eigenes geschütztes positives Dateifixture.
|
||||
Keine ungekennzeichnete Rootpflicht im neuen Test. Lokale Belege:
|
||||
`devstate/updater-passive-catalog-d86dc473-3e5f-48d4-a196-3a0d618a8e4e/`.
|
||||
|
||||
## Tatsächliche Cloud-Linux-Qualifikation
|
||||
|
||||
Root führte auf der festgelegten Cloud-Linux-Test-VM am2026-11-15 um13:07:09UTC
|
||||
exakt die sechs `agent_update_catalog::`-Fälle alsUID65534 aufx86-64 aus:
|
||||
6bestanden,0Fehler,0ignorierte,26übrige Tests bewusst gefiltert, Exit0,
|
||||
0stderr-Bytes. Der unprivilegierte Datei-Verweigerungszweig ist hierbei geprüft;
|
||||
der privilegierte positive Dateizweig stammt ausschließlich aus dem lokalen
|
||||
Rootlauf. mTLS verwendet auch auf der VM nur den eigenen Loopback-Testserver.
|
||||
Dies ist kein Katalogabruf durch den installierten Produktagenten gegen den
|
||||
Internetserver, keine Clock-/Fullhelper-/Applyqualifikation und kein Windowsbeleg.
|
||||
|
||||
Exakte Testbinary-SHA256:
|
||||
`e8fc4249db06510b6b680f5ddf7e1d539305c54741d1dea2fdc348883f205956`.
|
||||
Erhaltener privater nativer Beleg:
|
||||
`devstate/updater-passive-catalog-linux/4f3e5a4b-98a9-4acf-9106-dcdd4d5d1823/result.json`,
|
||||
SHA256 `332c8903506bf17fa8c9a9a0f512bb64ad82867513d2885359a54a80e4750e6d`.
|
||||
|
||||
## Nächster tatsächlicher Lieferweg
|
||||
|
||||
Noch offen sind der qualifizierte read-only Fullobserver für aktuelle
|
||||
Vorgänger-/Pin-/Historypreview, die normale unverbrauchte Fulladmission,
|
||||
Agent-/Helper-Artefaktstaging vor Handoff, stabiler Updaterbootstrap und der
|
||||
vollständige dauerhafte Rückweg. Agent `supported/accept` und Fullpolicy geben
|
||||
weiterhin keinen Updatejob frei. Es wurde kein Agent installiert, Dienst
|
||||
geändert, Code getauscht, Job angelegt oder genehmigt. Notebook nur Entwicklung.
|
||||
@@ -1,89 +0,0 @@
|
||||
# Erhaltener Decodervertrag und weiterhin gesperrte Rückkehr
|
||||
|
||||
Stand2026-11-15, enger lokaler Quellschnitt im bestehenden Worker. Keine neue
|
||||
Journalversion, kein gestarteter Updater, keine VM- oder Applyabnahme.
|
||||
|
||||
## Konkreter Befund und Änderung
|
||||
|
||||
`history::verify_history` authentisiert die separat release-signierte
|
||||
Bootstrapbaseline, die vollständige aufsteigende InstalledRecord-Kette und die
|
||||
ursprünglichen Job-/Handoff-/Health-/Publikationszeugen im erhaltenen Helperledger.
|
||||
Die bisherige Releaseprüfung übernahm jedoch Protokollhauptversion und
|
||||
Zustandsschema aus genau dem Nachfolgermanifest, dessen Kompatibilität sie prüfte.
|
||||
Eine echte Signatur authentisiert einen Releaseinhalt; sie beweist nicht, dass
|
||||
dieser Inhalt den Decodervertrag des erhaltenen Zustands unterstützt.
|
||||
|
||||
Die bestehende Prüfung bekommt jetzt beide Vergleichswerte ausschließlich aus
|
||||
dem separat signierten qualifizierten Bootstrapmanifest. Jeder historische
|
||||
Nachfolger muss diese Werte erhalten. Aktuelle Keywiderrufe, Schlüsselbereiche,
|
||||
Manifest-/Job-/Healthsignaturen, unveränderte Originalbytes und monotoner Floor
|
||||
bleiben zusätzliche Bedingungen. Die Funktion schreibt weiterhin keine SQLzeile.
|
||||
Es gibt keinen neuen Manifest-/Job-/Handoffcodec und keine Datenmigration.
|
||||
|
||||
Dies schließt eine konkrete Kompatibilitätslücke in einem bereits aufgerufenen
|
||||
Reader: `TrustState::qualify_history` verwendet `verify_history` vor neuer
|
||||
Admission sowie unter dem übernommenen Guard vor dem Austausch. Es ist keine
|
||||
Aussage, dass gleiche Versionsnummern die gesamte tatsächliche Decoderfähigkeit
|
||||
beweisen; diese bleibt Bestandteil der unabhängig qualifizierten Bootstrap- und
|
||||
Releaseartefakte. Eine zukünftige ausdrücklich beauftragte Protokoll- oder
|
||||
Zustandsmigration braucht einen eigenen Vertrag.
|
||||
|
||||
## Weshalb damit noch kein Rollback freigegeben ist
|
||||
|
||||
Im vorhandenen Datenvertrag existiert kein normierter V2-Rückkehrzeuge:
|
||||
|
||||
- `Handoff`, `Event` und `Journal` verstehen nur Schema1 und die Vorwärtsfolge.
|
||||
Ein endgültiges `Unknown` bleibt terminal.
|
||||
- `ActivationEvidence` kennt `Bootstrap` und `Updated` mit positivem Healthbeleg;
|
||||
das Feld `rolled_back` allein authentisiert keine Rückkehrwirkung.
|
||||
- Core verweigert `NativeEffect::RestorePredecessor` sowohl beim Claim als auch
|
||||
bei der Beobachtung. Ein vorhandener Linux-Dateiport ist keine Genehmigung.
|
||||
- History verweigert rückkehrende Records und alte Recorddateien, welche die
|
||||
inzwischen vollständig abgeschlossenen Verbräuche/Publikationen auslassen.
|
||||
|
||||
Der ursprüngliche signierte Job bindet bereits
|
||||
`restore_exact_predecessor_once`. Es fehlen jedoch dessen vollständig gebundene
|
||||
dauerhafte Rückwegphasen, belegter eindeutiger Fehlstart, exklusive Guard-/Owner-
|
||||
Übergabe, jede einzelne native Rückkehrbeobachtung, neuer Prozess-/Healthbeleg,
|
||||
Record-/Floorpublikation und failed-Originaloutcome. Vor erster Applybaseline
|
||||
müssen sämtliche tatsächlich installierten Agent-/General-/Fullreader genau
|
||||
diesen noch fehlenden Vertrag verstehen. Das alte1.20-Paar ist kein Rückkehrziel.
|
||||
Kein paralleles unbeobachtetes Journalformat wird als Ersatz eingeführt.
|
||||
|
||||
## Tatsächliche lokale Prüfungen und Grenzen
|
||||
|
||||
Die neuen Fälle verwenden synthetische, aber echte Ed25519-Release-, Baseline-,
|
||||
Job- und Healthsignaturen samt vollständigen in-memory SQLiteoriginalen. Sie
|
||||
prüfen inkompatible Protokoll- und Zustandsschemas, die unveränderte positive
|
||||
Vorwärtskette, eine vorgeschlagene exakte Vorgängerrückkehr mit erhaltenem
|
||||
höherem Floor sowie gespeichertes Unknown. Vor/nach jeder Readerprüfung bleibt
|
||||
`total_changes` gleich; Unknown-Originalbytes und Floors bleiben erhalten.
|
||||
|
||||
Tatsächlich im vorhandenen isolierten Buildcontainer, Netzwerk aus:
|
||||
|
||||
```text
|
||||
cargo test --release --locked --offline -p rmm-updater-worker --all-targets
|
||||
cargo clippy --locked --offline -p rmm-updater-worker --all-targets -- -D warnings
|
||||
cargo fmt -p rmm-updater-worker --check
|
||||
```
|
||||
|
||||
Abschließender normal paralleler Testlauf:12/12 bestanden,0Fehler,0ignoriert;
|
||||
Clippy und Formatprüfung bestanden. Eine private Quellrückmutation ausschließlich
|
||||
auf den alten selbstreferenzierenden Vergleich macht den neuen signierten
|
||||
Kompatibilitätstest erwartungsgemäß rot: Exit101, `unwrap_err` erhält `Ok`.
|
||||
Die Produktionsquelle wurde hierfür nicht zurückgeändert. Dies belegt den
|
||||
konkreten Readerfehler; es ist keine simulierte Updatewirkung.
|
||||
|
||||
Der erste parallele Lauf hatte10/12 bestanden; zwei vorhandene Selbstprozess-
|
||||
Censusfixtures verweigerten eine während anderer Unitfälle wechselnde FD-Tabelle.
|
||||
Der unveränderte Produktguard bestand im seriellen12er-Lauf. Die beiden Fixtures
|
||||
laufen jetzt je in einem eigenen exakt ausgewählten Testprozess, mit unverändertem
|
||||
Censuscode und echten privaten Thread-FD-/mmap-Proben. Danach bestand der normale
|
||||
parallele12er-Lauf. Der erste Clippylauf fand zwei unnötige Testdatenklone;
|
||||
sie wurden ohne Warnungsunterdrückung entfernt. Alte Fehlerlogs bleiben erhalten.
|
||||
|
||||
Geschützter lokaler Belegpfad:
|
||||
`devstate/updater-history-contract-73511ace-428f-4aaf-8742-720619459907/`.
|
||||
Native Linux-/Windowsqualifikation, Codeaustausch und WebUI-genehmigter Updatejob
|
||||
sind nicht ausgeführt. Frühere native Censusberichte qualifizieren nicht die
|
||||
neue Testbinary. Notebook bleibt ausschließlich Entwicklungsrechner.
|
||||
+1
-23
@@ -1,28 +1,6 @@
|
||||
# Übergabe — Linux-MVP abgeschlossen, Windows wird fortgesetzt
|
||||
|
||||
**15. November 2026.** Der permanente Server betreibt das Zeit-Gateway.
|
||||
Die Windows-VM hat mit ihrer Geräteidentität die Signatur geprüft. Ein fremder
|
||||
Mandant und eine alte Verbindung wurden abgewiesen. Die Cloud-Linux-VM und
|
||||
der Windowsgast melden sich selbständig und sind über MCP abrufbar.
|
||||
[Gateway](server-time-gateway-deploy.md) · [Windows-Protokolltest](windows-time-route-operator.md)
|
||||
|
||||
Die bestehende Windows-Dienstinstallation ist weiterhin passiv und online.
|
||||
Der vorbereitete Dienstwechsel benötigt ein neues befristetes Wartungsfenster.
|
||||
Danach folgen der Zeitabgleich in den beiden Dienstprozessen und der erste
|
||||
in der WebUI genehmigte Windows-Skriptauftrag mit Ausgabe.
|
||||
[Stand des Dienstwechsels](windows-signed-clock-upgrade-plan.md)
|
||||
|
||||
Die passive Zertifikatserneuerung ist implementiert. Fünf Wiederanlauf- und
|
||||
Fehlerfälle mit Testidentitäten bestanden auch auf Windows. Die Erneuerung
|
||||
durch den installierten LocalService-Dienst steht aus.
|
||||
[Zertifikatserneuerung](windows-certificate-renewal.md)
|
||||
|
||||
Der Linux-Agent kann einen signierten Releasekatalog über mTLS prüfen und das
|
||||
Ergebnis im Inventar melden. Sechs gezielte Tests bestanden auf der Cloud-VM.
|
||||
Der Katalogcheck ist im Quellstand integriert. Die laufende Installation hat
|
||||
noch kein Agent-Selbstupdate durchgeführt. [Updatekatalog und offene Schritte](agent-updater-passive-catalog.md)
|
||||
|
||||
## Frühere Zwischenschritte
|
||||
**15. November 2026.** Der permanente Server betreibt das neue Zeit-Gateway. Migration 15, TLS und Historienvergleich sind abgenommen. Der nächste Windows-Nachweis ist der signierte Abruf mit der Geräteidentität. [Bereitstellungsbeleg](server-time-gateway-deploy.md)
|
||||
|
||||
**Broker-UDS und echte Signaturen bestanden:** Host und Standard-PIDnamespace-
|
||||
ContainerUID10001 mit getrennten Challenges tatsächlich Ed25519-verifiziert;
|
||||
|
||||
@@ -27,13 +27,18 @@ Nur portable Logik mit synthetischen KeyFiles, keine echte TLS-Rotation oder
|
||||
LocalService-Keydateiabnahme. Originalfehler und genaue Grenzen bleiben im
|
||||
verlinkten Bericht erhalten.
|
||||
|
||||
Zusätzlich vorbereitet, noch nicht nativ ausgeführt: eine ausdrücklich
|
||||
auszuwählende Windows-Keydatei-Unit im bestehenden Lib-Testbinary. Sie prüft
|
||||
geschütztes CreateNew/Flush/Reopen, öffentlichen Keyhash, Nichtüberschreiben,
|
||||
breite DACL an leerer Fixture, gehaltenes Verzeichnis und Hardlinkablehnung.
|
||||
Keine Dienste/Accounts/Tokenübernahme oder permanente Dateien betroffen.
|
||||
Produktcode unverändert; ein Administratorlauf ersetzt keinen LocalService-
|
||||
Nachweis. Default-`ignored` ist hier ein ausdrücklich offenes natives Gate.
|
||||
Zusätzlich tatsächlich nativ Windows bestanden: eine ausdrücklich ausgewählte
|
||||
Keydatei-Unit im bestehenden Lib-Testbinary (ein PASS/49andere gefiltert,
|
||||
Exit0/0ignored). Geschütztes CreateNew/Flush/Reopen, öffentlicher Keyhash,
|
||||
Nichtüberschreiben, breite DACL an leerer Fixture, gehaltenes Verzeichnis und
|
||||
Hardlinkablehnung geprüft. Eigener Falle0590d96, Rohread-SHA
|
||||
`68dd458a24c2455049b7799f57e30f1e858e323fa82c578e3b962f58282b5e49`.
|
||||
Nach einem lokalen JSON-Formatfehler wurde nur das ursprüngliche beständige
|
||||
Ergebnis nachgelesen, kein zweiter Start. Eigener temporärer Testkey entfernt;
|
||||
keine Dienste/Accounts/Tokenübernahme oder permanente Dateien betroffen.
|
||||
Produktcode unverändert; dieser Administratorlauf ersetzt keinen LocalService-
|
||||
Nachweis und keine echte Renewalabnahme. Im Defaultlauf bleibt die gesonderte
|
||||
Administratorfixture bewusst `ignored`.
|
||||
|
||||
## Windowsfortsetzung: Nichtstart-Kern nativ qualifiziert — 2026-11-14
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ Pfad bleiben dort sofort relevant.
|
||||
|
||||
| Entdeckung / späteres Thema | Tatsächlicher heutiger Stand | Spätere Aufgabe |
|
||||
| --- | --- | --- |
|
||||
| Gesundheitsübersicht für größere Flotten | Beim Quellabgleich nach der MCP-Abnahme vom 15. November fiel auf, dass `monitoring.get_health` die erste Inventarseite liest und deren Fortsetzungscursor verwirft. Der aktive Testbestand passte auf eine Seite. | Vor Nutzung für größere Mandanten den Cursor für HTTP und MCP durchreichen und den Bezugszeitpunkt beibehalten. `inventory.list_devices` unterstützt bereits Folgeseiten. |
|
||||
| Verfügbarkeit der signierten Serverzeit | Tatsächliche Quellproben derselben laufenden Chronygeneration lieferten50.834ms bei43.596s Syncalter und später295.609ms bei320.110s. Beide gültig; kein kontinuierlicher Verfügbarkeitsnachweis. | Nach dem MVP natürlichen Poll-/Kernel-Fehlerverlauf und Verfügbarkeit messen, gegebenenfalls separat genehmigte Betriebsoptimierung. Fehlende Qualität muss bereits jetzt deny bleiben; keine500ms-Grenzlockerung, erfundene Frische oder implizite Resync-/Konfigurationsänderung. |
|
||||
| Windows-PE nach erneutem Debugstrip | Zwei Lieferkopien mit identischen unveränderten Original-Linkdateien unterscheiden sich nach erneutem Strippen nur an vier Bytes: COFF-Zeitstempel/PE-Prüfsumme, Offsets136/137/216/217. Lokal tatsächlich verglichen; beide ursprünglichen Packs bleiben erhalten. Jeder Pack pinnt seine konkreten Lieferbytes. | Reproduzierbare PE-Werkzeugpipeline vor M7 festlegen. Bis dahin niemals gleichen Lieferhash aus gleicher Rustquelle/gleichem Original-Link behaupten oder ein altes Manifest überschreiben. Kein aktueller Autorisierungs- oder Abnahmebypass. |
|
||||
| Dev-Reversetunnel ohne Zielbanner | Windows-RMM-Heartbeats liefen tatsächlich weiter, während Serverlistener/TCP-Verbindung auf127.0.0.1:22240 vorhanden waren, aber kein SSH-Banner durchkam. Der Bootstraploop überwacht nur das äußere ssh.exe und verbindet nach dessen Ende neu; der Task hat kein RestartOnFailure. Konkrete Ursache des blockierten SSH-Ziels unbewiesen. Keine SSH-/Hostkey-/Expirygrenze gelockert. | Nach dem MVP begrenzte Transport-/Workerdiagnose verbessern. Keine automatische Schlüsselverlängerung, öffentliche Windowsportfreigabe oder pauschalen sshd-/UID-Resets. Der aktuelle manuelle Konsolenneustart bleibt ausdrücklich zeitlich abzustimmen und ist kein RMM-Rebootnachweis. |
|
||||
|
||||
@@ -110,37 +110,3 @@ Die Prüfung des signierten Zeitabrufs aus dem Windowsgast folgt separat.
|
||||
| Nachlese | `b8cc94a9f9ba4d1782e052ef0bf317b5229b9578c646bf393c24b33a9507fab4` |
|
||||
| Historie nach Migration | `cb72a95afc94c9d96ae78a38495e62b59db4598b8ea16996b00d83e2cd6c08a7` |
|
||||
| TLS und öffentliche Zugriffstrennung vor und nach Migration | `f381279d3e5ebbded79b0b3ad587dee09ebf7adbbbf47d9099584f00ddcd95d5` |
|
||||
|
||||
### Wiederverbindung der beiden Geräte
|
||||
|
||||
Nach dem Gatewaywechsel meldeten sich beide bestehenden Geräte selbständig
|
||||
wieder über WSS. Die gespeicherten Daten des Entwicklungsmandanten zeigten am
|
||||
15. November um 12:38 UTC für Linux einen 12 Sekunden alten Kontakt und einen
|
||||
18 Sekunden alten Inventareingang. Für Windows betrugen die Werte 23 bzw.
|
||||
146 Sekunden. Die Verbindungsgenerationen waren 153 und 91. Dafür war kein
|
||||
Live-Auftrag erforderlich. Beleg der lesenden Abfrage
|
||||
`9ce23669ff03a7ec5a08e10437a009a7ae617f472614d161ab082e17c02c2095`.
|
||||
|
||||
Auch die normale MCP-Schnittstelle lieferte beide Geräte im selben Mandanten
|
||||
über `inventory.list_devices`, `inventory.get_device` und
|
||||
`monitoring.get_health`. Linux und Windows standen auf `online`, mit
|
||||
29 bzw. 18 Sekunden seit dem letzten Kontakt. Die Liste enthält außerdem
|
||||
zwei widerrufene Altinstallationen. Die erste Auswertung hatte fälschlich
|
||||
genau zwei Listeneinträge insgesamt erwartet. Die korrigierte Prüfung glich
|
||||
die beiden aktiven Gerätekennungen und den Widerrufsstatus separat ab.
|
||||
Der mandantenweite Gesundheitswert lautete `unknown`. Das Inventar war
|
||||
für beide aktiven Geräte abrufbar. MCP-Beleg
|
||||
`f6fe5ab254c9ca3fad238271601b0f8df2029b6b6138c47ff000d55071ab70cf`.
|
||||
|
||||
Migration 15 hat die beiden Tabellen für Agent-Releases und Updateartefakte
|
||||
auf dem permanenten Server angelegt. Eine lesende Abfrage im PostgreSQL-Katalog
|
||||
bestätigte für beide Tabellen erzwungene Row-Level Security, die Mandantenpolicy
|
||||
und den aktiven Unveränderlichkeits-Trigger. Die Anwendungsrolle darf lesen
|
||||
und einfügen. UPDATE und DELETE sind ihr entzogen. Beide Tabellen waren leer.
|
||||
Beleg `623fe75484f337996e784b24dae0b0be29a4596f2a6842841c7636a99daaf754`.
|
||||
|
||||
Ein zusätzlicher Abruf vom Entwicklungsrechner über den öffentlichen DNS-Namen
|
||||
und Port 443 prüfte den externen Zugang ohne Geräteidentität. TLS wurde gegen
|
||||
die öffentliche CA der Windows-Installation geprüft. POST an die Zeitroute
|
||||
lieferte 401, GET an `/`, `/auth/config` und `/mcp` jeweils 404.
|
||||
Beleg `346c2c60635e52cb758f3e6092f7187a9c35203d1fff3c8f18d1dbca73607607`.
|
||||
|
||||
@@ -129,7 +129,8 @@ und [FlushFileBuffers](https://learn.microsoft.com/en-us/windows/win32/api/filea
|
||||
der öffentliche Selektor übernimmt den vorhandenen
|
||||
[SQLite-WAL/FULL-Vertrag](https://www.sqlite.org/pragma.html#pragma_synchronous).
|
||||
|
||||
Eine weitere enge native Datei-I/O-Unit ist **vorbereitet, nicht ausgeführt**:
|
||||
Historischer Vorbereitungsstand45b5337: eine weitere enge native Datei-I/O-Unit
|
||||
war **vorbereitet, nicht ausgeführt**:
|
||||
`certificate_rotation::tests::protected_key_files_create_new_reopen_acl_and_hardlink_guards`.
|
||||
Sie steckt im vorhandenen Lib-Testbinary; kein zusätzliches Diagnostikbinary,
|
||||
keine Tokenübernahme, Impersonation, Dienste oder Accounts. Wegen ihrer
|
||||
@@ -163,3 +164,33 @@ Filter, Windows-GNU-Lib `--no-run`, Windows-Alltargets-Clippy mit
|
||||
`system-helper`/`-D warnings` und Workspacefmt bestanden. Noch kein neuer
|
||||
Zielaufruf. Das vorbereitete Windows-Testbinary hat SHA256
|
||||
`cd385c3b8696303220d8e601768d70ac96a6e4187a14cbac9d511162a57eee5a`.
|
||||
|
||||
Nach dem ausdrücklichen SSH-Readback-Signal des Orchestrators wurde genau diese
|
||||
Unit tatsächlich einmal auf der Windows-VM ausgeführt. Eigener Fall
|
||||
`e0590d96-7e62-4bdc-a0b1-f53e8a9a9972`, unverändertes Binary `cd385c3b…`,
|
||||
Aufruf `--ignored --exact certificate_rotation::tests::protected_key_files_create_new_reopen_acl_and_hardlink_guards --test-threads=1`.
|
||||
Ergebnis: **ein PASS, null Fehler, null ignored, 49 andere gefiltert**, Exit0,
|
||||
gemeldete Unitlaufzeit0.09s. Der vorhandene Administratorprincipal wurde im
|
||||
Test geprüft; keine Tokenübernahme oder Impersonation.
|
||||
|
||||
Damit sind der wirkliche geschützte Windows-KeyFiles-CreateNew-/Flush-/Reopen-
|
||||
Pfad, bytegleiche private Wiederöffnung, öffentlicher P-256-Keyhashvergleich,
|
||||
Nichtüberschreiben, breite leere DACL-Negativfixture, gehaltenes Verzeichnis
|
||||
und Hardlinkablehnung für diesen Principal bestanden. Die Unit entfernte ihren
|
||||
eigenen temporären Schlüssel, Hardlink und Testordner erfolgreich. Es gab keine
|
||||
Änderung an Client, SCM, Accounts, SSH-Zugang oder dauerhafter Identität. Stagingbinary und
|
||||
eigene öffentliche Ergebnisdateien bleiben geschützt im Bootstraparchiv.
|
||||
|
||||
Der private Aufrufwrapper gab das bereits auf der VM beständig gespeicherte
|
||||
Ergebnis zunächst als PowerShell-Tabelle aus; dadurch schlug ausschließlich das
|
||||
lokale JSON-Einlesen fehl. Es gab **keinen zweiten Teststart**. Ein anschließend
|
||||
streng lesender Aufruf übernahm nur die ursprüngliche eigene `result.json`.
|
||||
Geschützter lokaler Rohread:
|
||||
`devstate/windows-keyfile-fixture/e0590d96-7e62-4bdc-a0b1-f53e8a9a9972/result-read.json`,
|
||||
SHA256 `68dd458a24c2455049b7799f57e30f1e858e323fa82c578e3b962f58282b5e49`.
|
||||
Die separate lokale Acceptancequittung `acceptance.json` bindet Intent,
|
||||
Transfer, Start und diesen Originalread; SHA256
|
||||
`268e3146acfcab55022f9534509e74c80caf7b8ca246bcc5eb3c30e08cfd1383`.
|
||||
Dies bleibt eine Administrator-Fixtureabnahme; tatsächliches
|
||||
LocalService-Keyfile-I/O, Prozessabbruch und echte Zertifikatserneuerung sind
|
||||
weiter offen. Keine bestehende Plattform-/Jobqualifikation wird damit erweitert.
|
||||
|
||||
@@ -260,32 +260,3 @@ Ausgabe und expliziten Root-/SYSTEM-Ausführungsrechten gelegt. Paketabnahmen
|
||||
sind nachgeordnet. Der erneuerte SSH-Bootstrapzugang verleiht selbst keine
|
||||
RMM-Ausführungsrechte und ersetzt keine dieser noch separat nachzuweisenden
|
||||
Genehmigungs- und Ausführungsgrenzen.
|
||||
|
||||
## Manuelles Wartungsfenster am 15. November 2026
|
||||
|
||||
Der Server bestätigte die abgelaufene Freigabe vom 15. November um 13:05:58 UTC.
|
||||
Für die Windows-Entwicklung wurde die Frist desselben Forwarding-Schlüssels auf
|
||||
15:30:00 UTC (16:30 Uhr MEZ) gesetzt. Ein separater SSH-Lesezugriff bestätigte
|
||||
Frist, Hostpin, Schlüsselbindung, SSH-Profil und Konto. Der Port ist serverseitig
|
||||
an Loopback gebunden. Ein einmaliger, aktiver Servertimer für 15:30:00 UTC
|
||||
begrenzt auch eine noch offene Weiterleitung des dedizierten Tunnelkontos dieser
|
||||
Schlüsselgeneration. Das tatsächliche Auslösen des Timers steht noch aus.
|
||||
|
||||
Die Bedienperson öffnet das Fenster in der VM-Konsole mit
|
||||
`deploy/windows/Open-ConsoleMaintenanceWindow.ps1`; Parameter sind
|
||||
`-PreviousExpiry '2026-11-15T13:05:58+00:00' -Until '2026-11-15T15:30:00+00:00'`.
|
||||
Während der einmaligen SSH-Verbindung pausiert das Skript den vorhandenen
|
||||
Autostarttask. Bei normalem Ende oder Strg+C beendet es den Client und stellt die
|
||||
vorherigen Fristen und den Task wieder her. Bei hartem Abbruch oder VM-Ausfall
|
||||
den Zustand über die Konsole prüfen. Lokales PowerShell-Parsing bestanden.
|
||||
VM-Ausführung, SSH-Readback und Dienstwechsel stehen bei Veröffentlichung aus.
|
||||
Die WebUI-Freigabe für Agentjobs gilt weiterhin.
|
||||
|
||||
Das manuell geöffnete Fenster wurde anschließend vom Entwicklungsrechner über
|
||||
die bestehende gepinnte SSH-Verbindung bis zum Windows-Gast geprüft. Die
|
||||
Kontofrist und die Frist in der Bootstrapkonfiguration ergaben beide
|
||||
15:30:00 UTC. Der Gast bestätigte den Servernamen und den deaktivierten
|
||||
Autostarttask. Beide installierten Dienste liefen beim Readback mit ihren
|
||||
bisherigen Prozess-IDs: Agent 5528 als LocalService, Helper 9464 als LocalSystem.
|
||||
Danach wurde die Ablaufzeit im lokalen Zugangsdatensatz an die geprüfte
|
||||
Gastfrist angepasst. Dies ist der Nachweis für den Entwicklungszugang.
|
||||
|
||||
@@ -8,17 +8,17 @@ Quellen-/Build-/Unitnachweis wird nicht als laufender Dienst-/Jobnachweis ausgeg
|
||||
|
||||
| Bereich | Tatsächlich implementiert/nachgewiesen | Was konkret noch fehlt / warum |
|
||||
| --- | --- | --- |
|
||||
| Passive Windowsverwaltung | Laufender LocalService-Agent, Enrollment/mTLS, WSS/HTTPS/Fallback, Inventar/Heartbeats und Tenanttrennung nativ bestanden. Die passive Zertifikatserneuerung ist implementiert. Fünf Tests mit separaten Zertifikaten bestanden auf der Cloud-Linux-VM und auf Windows 11. | Echte Erneuerung durch den LocalService-Dienst mit einer separaten Testidentität und anschließender Wiederverbindung sowie ein eigenständiger Widerrufstest fehlen. [Zertifikatsnachweise](windows-certificate-renewal.md) |
|
||||
| Passive Windowsverwaltung | Laufender LocalService-Agent, Enrollment/mTLS, WSS/HTTPS/Fallback, Inventar/Heartbeats und Tenanttrennung nativ bestanden. | Zertifikatsrotation und Widerruf noch getrennt auf Windows abnehmen. |
|
||||
| SYSTEM-Trennung | Helper läuft als SYSTEM/Manual; Pipe-v2, gegenseitige Prozess-/Image-/Dateibindung und echte LocalService-Probe bestanden. | Unabhängiger signierter Laufzeitsync und erste genehmigte SYSTEM-Wirkung; die frühere Peerprobe-Störung ist kein aktueller offener Blocker. |
|
||||
| Skriptkonsole | MCP-Antrag, feste Bytes/Plan/WebUI, PowerShell5.1/RemoteSigned-Prozessprofil, Vollwartungsprofil und Ausgabe-/Prozessgrenzen implementiert; native Windows-Vertragsunits bestanden. Linux-UID0-Vollwartungsjob tatsächlich bestanden. | Neue Windowsruntime noch nicht installiert/qualifiziert; erste WebUI-genehmigte LocalService-/SYSTEM-Skripte, tatsächliche Ausgabe und Fehlerverhalten offen. Der laufende Windowsclient bleibt passiv/0Jobs. |
|
||||
| Zeitvertrauen | Signierter Codec, getrennte Agent-/Helperprüfung und ausdrückliches aktives KVM-OS-Profil1.23 implementiert; Linux-first und Windows-Rohcapture belegt. Auf dem permanenten Server läuft das Zeit-Gateway. Die Windows-VM prüfte über ihr Gerätezertifikat eine echte signierte Antwort (200). Fremder Mandant (403), alte Verbindung (409) und öffentlicher Zugriff ohne Geräteidentität (401) wurden abgewiesen. | Der HTTPS-Nachweis stammt aus einem separaten Prüfprozess im Gast. Agent und Helper müssen jeweils selbst eine neue Antwort mit ihrem aktuellen Dienst- und Verbindungskontext prüfen. Dafür fehlen auf der VM noch das neue Dienstpaar und die geschützte Zeitkonfiguration. |
|
||||
| Zeitvertrauen | Signierter Codec, getrennte Agent-/Helperprüfung und ausdrückliches aktives KVM-OS-Profil1.23 implementiert; Linux-first und Windows-Rohcapture belegt. Echter Chronyprovider, einmaliger genehmigter Neustart/Pin, Brokerstart und zwei echte Ed25519-Signaturen samt Container-PID0/Root-Deny bestanden. | Sichere W32Time-Dienstidentitätsbindung erwies sich auf dieser VM als nicht qualifizierbar. Genehmigte Alternative löst den Entwurfsblocker; HTTPS/mTLS-Zeitroute, neue Paarinstallation, geschützte öffentliche Zeitkonfiguration und zwei unabhängig bereite Windowsrollen bleiben native Integrationsarbeit. Keine erfundene Timerkalibrierung. |
|
||||
| Dienst-/MSI-Aktionen | Typisierte SCM-/MSI1.0→1.1-Verträge, getrennte SYSTEM-Policies, Runtime-/Nachbedingungsquellen und native Vertragsunits vorhanden. | Nach Zeit-/Syncbereitschaft je eigene WebUI-genehmigte Dienst- und MSI-Installation/Upgrade/Noop mit echten unabhängigen Nachbedingungen. Keine allgemeine EXE-/OSupdatefreigabe aus Fixtures. |
|
||||
| Strukturierte Eventlogs | Begrenzter Provider-/Worker-/UI-Vertrag und native Vertragsunits vorhanden. | Eigenständig geprüfter Prozess-/Clockkontext des Kindworkers und echte genehmigte Live-Abfrage offen; Parentclock darf nicht als fremder Prozessbeleg verwendet werden. Genehmigte PowerShell-Skripte sind für Logwartung zusätzlich vorgesehen. |
|
||||
| Dauerhafte Windowsjobs | Gemeinsamer Einmalverbrauch, Journale, Dispatch/Abandon/RawMirror und Fehlerverträge implementiert. | Redelivery/ACK-Verlust, Crash/Unknown, Ablauf/Entzug, Reconnect und gemischter Linux-/Windowsplan am echten aktivierten Windowsdienst nachweisen. Linuxerfolge ersetzen diese OS-Nachweise nicht. |
|
||||
| Agent-Selbstupdate | Signierte Codepaare/Releasekatalog, eigene Artefaktstreams, WebUI-Plan, Handoff/Health und Readercensus im Quellpfad; lokale und ausgewählte native Linuxfixtures bestanden. Der passive [Linux-Katalogcheck](agent-updater-passive-catalog.md) ist integriert und mit sechs Fällen auf der Cloud-VM geprüft. | Ausgelieferter Worker/Full-Admission/Staging, kompatible erhaltende erste Baseline, unklare Record-I/O-Adjudikation und V2-Code-Rückweg fehlen; danach tatsächlicher genehmigter Linux-Apply, anschließend Windows. APT/MSI-Fixtures aktualisieren nicht den Agenten. |
|
||||
| Agent-Selbstupdate | Signierte Codepaare/Releasekatalog, eigene Artefaktstreams, WebUI-Plan, Handoff/Health und Readercensus im Quellpfad; lokale und ausgewählte native Linuxfixtures bestanden. | Ausgelieferter Worker/Full-Admission/Staging, kompatible erhaltende erste Baseline, unklare Record-I/O-Adjudikation und V2-Code-Rückweg fehlen; danach tatsächlicher genehmigter Linux-Apply, anschließend Windows. APT/MSI-Fixtures aktualisieren nicht den Agenten. |
|
||||
| Auslieferung/Betrieb | Windows-GNU-Artefakte gebaut und bestimmte Binaries nativ ausgeführt; Verwaltung bleibt SSH-Tunnel, keine öffentliche Dev-Anmeldung. | MSVC-/signierter Installer und eigenständige native Installer-/Reboot-/Lifecyclebelege offen. Produktiver IdP/MFA/HA/Restore sind zusätzliche Betriebsreife, keine bestandene MVP-Produktionsfreigabe. |
|
||||
|
||||
Aktuelle Detailbelege: [Windows-Zeitabruf](windows-time-route-operator.md), [Gatewaybereitstellung](server-time-gateway-deploy.md), [Zeitbrokerstart](server-time-broker-start-acceptance.md),
|
||||
Aktuelle Detailbelege: [Zeitbrokerstart](server-time-broker-start-acceptance.md),
|
||||
[Signaturen](server-time-broker-signature-acceptance.md),
|
||||
[OS-Zeitprofil](windows-trusted-os-clock-source.md),
|
||||
[Pipe-v2](windows-system-pipe-upgrade.md),
|
||||
|
||||
@@ -87,75 +87,3 @@ Die Kandidaten751657ee/acf1e3f3 gehören zum Frischefix. Der anschließend
|
||||
ausdrücklich angenommene Zeitmodus aus Spezifikation1.23 ist noch in Umsetzung;
|
||||
er benötigt neue Produktartefakte und eigene Nachweise. Der vorbereitete
|
||||
Controller wird nicht allein aufgrund dieser AST-/Fixtureprüfungen aktiviert.
|
||||
|
||||
## Nachtrag: neues aktives Profilpaar, weiterhin geschlossenes ENTER
|
||||
|
||||
Nach der ausdrücklichen Userentscheidung für das begrenzte aktive OS-Zeitprofil wurde das Produktpaar erneut gelinkt: Agent `26dc9d2f6928c5a41050ac9324e041c065e7a9ae52324416f3bb6222c002ae6b`, Helper `59675a3cbb3a5d213fc764f38379d6b81baaf9d47a7124470cc2767d4985763e`, unveränderlicher Buildreceipt `04ed34e6e850aca77c1fd4677ddb271f7ccd9492a97f5d4e00ead4c1f032f29d` und Qualifikationsbeleg `96b05fe13f4d459b4b3ef78292beea33827b1ea47293ffb5921c685940e82a4d`. Die früheren Plan-/Kandidatengenerationen bleiben erhalten.
|
||||
|
||||
Der korrigierte P1-Aktionsvertrag wurde für genau diese neue Kandidatengeneration beibehalten. Neuer Generator `bbdd0ef4649c97e0fe48e11d3eb8ccdaf7a7e78f9f5614720249ec5fcf8f44af`, lokaler Vorbereitungsfall `2dc20d01-d19e-4d7c-bce9-44f8904f2620`, Manifest `a8f2a39e3a64a0df56ebc45ccab85c7499e63ced44d9f6b17c34bb6a3b6fa904`, PS `ca7478fb61ca46f2c47952a818ea93b43ea522e29b36cbefc4bc15f460286796`. Änderungen gegenüber dem P1-fixierten77fb-Schnitt: nur neue Kandidaten-/Belegpfade und Hashbindungen sowie der tatsächliche Feldname im neuen Linkreceipt. Neue geschlossene Helperpolicy `aed124bfd6eaf84e10f9dfa1da4d403826331a6d3a64ff8182cfead35067cc8a`, Agentpeerpin `27c38c6b7e1985174018a009de5708f5171f585dcab74500a4f4d333f4d8aa76`.
|
||||
|
||||
Python-AST, dieselben Sourceguards und lokale create-only Vorbereitung PASS; keine Zielaktion oder neue native Controllerqualifikation. Beide festen Serversperren und die strikt typisierte/case-sensitive Aktionsgrenze bleiben erhalten. **ENTER bleibt geschlossen**, bis tatsächliches Gateway-/Brokerdeployment und der noch folgende native mTLS-Zeitroutebeleg konkret gebunden und unabhängig geprüft sind. Die [neue feste Routefixture](windows-time-route-fixture.md) ist ausschließlich für diesen passiven200/403/409-Endpunktnachweis vor dem Upgrade gebaut; sie erzeugt keine Dienstrollen-/Clock-/SyncReady-/Jobfreigabe und noch keine V2-Zeitkonfiguration.
|
||||
|
||||
## Native Vorbereitungsprüfung des aktuellen Profilpaarcontrollers
|
||||
|
||||
Der bestehende Controller für26dc/5967 (ca7478fb61ca46f2c47952a818ea93b43ea522e29b36cbefc4bc15f460286796)
|
||||
wurde nach ausdrücklicher Rootdelegation auf Windows ausschließlich im Speicher
|
||||
geparst und seine genau eine feste C#-HereStringdefinition kompiliert.
|
||||
PowerShell5.1.26100.9818, AST0, C#compile-onlytrue, Controller nicht ausgeführt.
|
||||
Keine Stage-, Stop-, Start-, Swap-, Konfigurations- oder Jobaktion. Original14fb-
|
||||
Lesewitnesses vor/nach bewiesen dieselben sechs stabilen nativen Felder,
|
||||
Journalidentität und monotone Sequenz. Fall3962b83b-c194-4318-8925-83e86c840b7f unter
|
||||
`devstate/windows-time-route-native-readonly/`, Receipt
|
||||
69d221997f247c2c291f0c7c079a79f2bae2c943628032835e49955af1ef7289.
|
||||
Das ersetzt nicht die noch fehlende Quellenbindung des tatsächlichen positiven
|
||||
Zeitroutebelegs vor der weiterhin gesperrten Enterphase.
|
||||
|
||||
## Tatsächliche Route bestanden, Paarwechsel noch nicht ausgeführt
|
||||
|
||||
Die passive HTTP-Abnahme68b841a5… ist einschließlich separatem Read tatsächlich
|
||||
bestanden (200/signature/context,403,409, Exit0). Der bestehende Paarcontroller
|
||||
bindet nun direkt die geschützten tatsächlichen Report-/Exit-/Kontext-/Probe-/
|
||||
öffentlichen Pin-Dateien dieser VM; der alte Harddeny-Entwurf bleibt historisch.
|
||||
Die strikte Aktionsgrenze steht weiterhin vor jeder Wirkung. Jobflags/Policies
|
||||
bleiben geschlossen, keine Zeitkonfiguration wird als Teil dieses Austauschs
|
||||
erstellt oder übernommen.
|
||||
|
||||
Stagingversuch0406dd40-c3c4-464b-8cc6-c9b98365d12a: neues Helperimage5967…
|
||||
tatsächlich vollständig im separaten Bootstraphashpfad vorhanden. Der vorhandene
|
||||
kleine lesende Agent-Staging-Prepareaufruf antwortete nach180s nicht. Noch kein
|
||||
Agentupload und kein Controllerinvoke mit Enter, kein ServiceStop/Start/Swap.
|
||||
Dieselbe sporadische SSH-/Commandantwortstörung betrifft damit auch eine kleine
|
||||
Vorbereitung und ist nicht allein dem alten Upgrade-finish-Reader zuzuordnen.
|
||||
Der konkrete Ursprung dieser sporadischen Transportstörung ist noch offen.
|
||||
|
||||
Eine danach begrenzte20s-Statusablesung antwortete tatsächlich: ursprünglicher
|
||||
Agent `RmmDiscoveryWindows` weiterhinRunning5528 mit unverändertem Servicepfad,
|
||||
ursprünglicher SYSTEM-Helper weiterhinRunning9464, neuer Agentbootstrapfile
|
||||
absent, neuer Helperbootstrapfile13143052Bytes vorhanden. Tatsächliche VM-UTC
|
||||
12:59:46, Kontoablauf13:05:58UTC. Der sichere Gesamtpuffer war unterschritten;
|
||||
daher wurde bewusst keine erste Dienständerung begonnen. Beide ursprünglichen
|
||||
laufenden Komponenten sind erhalten. Belege unter dem ursprünglichen0406-Fall:
|
||||
`stage-agent-preflight-timeout.json`, `final-no-stop-status.json`.
|
||||
|
||||
Für das nächste ausdrücklich autorisierte Zeitfenster wurde die alte feste
|
||||
Ablaufzeit aus der Generatorquelle entfernt. Prepare liest ausschließlich
|
||||
`expires_at` aus der aktuellen geschützten lokalen Zugangskonfiguration und
|
||||
verlangt mindestens420s Gesamtbudget vor Vorbereitung. Der konkrete Wert wird
|
||||
unveränderlich im neuen Payload/Manifest gebunden. Auf der VM muss er vor Wirkung
|
||||
mit **beiden** vorhandenen tatsächlichen Ablaufzeiten übereinstimmen: Konto
|
||||
`rmm-dev` und geschützt gelesenes `bootstrap-public.json`. Vor erster Wirkung und
|
||||
Agentstop420s; vor dem anschließenden Helperstop300s Restbudget, damit gewöhnlicher
|
||||
Zeitablauf nicht denselben hohen Grenzwert erneut unterschreitet. Unmittelbare
|
||||
Service-/Kernel-CAS bleiben auf beiden Stops. Dieser Code ändert Konto, Tunnel,
|
||||
Schlüssel oder deren Konfiguration nicht und schafft kein neues Zugangsfenster.
|
||||
|
||||
Pythoncompile und vorhandene Quellguards bestanden. Kein neuer Preparefall mit
|
||||
dem abgelaufenen knappen Fenster, keine weitere Zielaktion nach dem kleinen
|
||||
abschließenden Statusread. Quellenbindung/neue Baseline und tatsächlich einmalige
|
||||
Paarwartung samt Readback bleiben für das nächste bestätigte Fenster offen.
|
||||
|
||||
Nach Ablauf des SSH-Wartungsfensters meldete das gespeicherte MCP-Inventar
|
||||
den Windowsgast weiterhin als `online`. Der Agent hatte den permanenten Server
|
||||
am 15. November 2026 um 14:06:34 MEZ kontaktiert. Die Daten wurden ausschließlich
|
||||
über `inventory.get_device` gelesen. Beleg
|
||||
`003f000e16e53ce3ff8799694e7138e014689e741f69be6577519c616aee6bab`.
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
# Erste öffentliche Windows-Zeitkonfiguration V2
|
||||
|
||||
Stand 2026-11-15: Der reale Paarfall `4887940a-4c9c-4807-aaf2-6fbc94faad46`
|
||||
ist nach abgeschlossener unabhängiger Nachlese gebunden (Result `2898a72b…`,
|
||||
Originalintent `40e9cd55…`, separater Read `63e453fb…`). Die vorherige
|
||||
Verweigerung mit fehlenden Rollenbelegen bleibt als historischer lokaler Test
|
||||
nachgewiesen. Ein Zeitvertrauen oder durchgehende Heartbeats sind durch den
|
||||
Paarabschluss ausdrücklich nicht bewiesen.
|
||||
|
||||
Der Operator prüft die unveränderten öffentlichen Vorbereitungsbelege
|
||||
`c3077acf-12da-410e-9f55-e75a1cd0a75f`, deren getrennten Ed25519-Zeitschlüssel,
|
||||
Gerätebindung und tatsächlich gelesene KVM-Plattform. Die ursprüngliche
|
||||
Vorbereitung bleibt mit `roles_qualified=false` unverändert. Die akzeptierte
|
||||
Betriebsannahme ist ausdrücklich
|
||||
`active_guest_no_pause_save_restore_snapshot_migration_host_suspend`; das ist
|
||||
keine physikalische Kalibrierung und keine automatische Überwachung dieser
|
||||
Betriebsannahme.
|
||||
|
||||
Der neue Agent ist an SHA256
|
||||
`0549d9ebea73cff996938f859b92192cc333de194128d7c6859a3f1d2e85893c`
|
||||
und Buildreceipt `f04024f78c2f11f5c66bbdf9278467f5bcc50da5c2bd7336623851bca42dd446`
|
||||
gebunden. Seine 202 Quellinputs sind durch `11717fab…` fixiert; das tatsächlich
|
||||
erweiterte Zeitmodul hat SHA256 `342494c4…`. Gegen die ursprüngliche Quelle
|
||||
`d8594c1e…` kamen die passive Sampling-Auswahl und deren neunte Prüfung hinzu.
|
||||
Der Helper bleibt `59675a3c…`, aus dem ursprünglichen Linkbeleg `04ed34e6…`
|
||||
und Quellbeleg `96b05fe1…`. Diese unterschiedlichen Provenienzen werden nicht
|
||||
gleichgesetzt. Der tatsächliche neue Paar-Payload verwendet für
|
||||
`qualification_sha256` und `manifest_sha256` jeweils den neuen Beleg `f04024f7…`;
|
||||
der alte Helper-Quellbeleg ist kein Ersatz dafür.
|
||||
|
||||
Bevor ein Fall erstellt werden kann, müssen ein abgeschlossener passiver
|
||||
Paarwechsel und unabhängig fixierte Originalbelege vorliegen. Für beide Rollen
|
||||
werden SCM-Status, PID, Kernel-Prozessgeburt, tatsächliches Konto, aktivierte
|
||||
Service-SID, gehaltener Prozesshandle, Imagepfad, Imagehash und native FileID
|
||||
verknüpft. Die alten numerischen 601-Proben bleiben ausdrücklich rohe
|
||||
Voraussetzungsbelege; sie qualifizieren kein Produktimage. Der Producer erzeugt
|
||||
öffentliche Rollen- und Plattformbelege und daraus das vorhandene strikte
|
||||
V2-Format mit genau beiden Rollen. Er behauptet weder signierte Laufzeitprüfung
|
||||
noch physikalische Genauigkeit. Fehlende oder widersprüchliche Belege sperren.
|
||||
|
||||
## Geplanter Ablauf nach neuem realem Paar-Readback
|
||||
|
||||
Die folgenden Phasen sind **vorbereitet, nicht auf dem Ziel ausgeführt**:
|
||||
|
||||
1. Root bestätigt Original-Paarfall und Originalbeleg-Hashes; diese werden als
|
||||
konkrete Quellenkonstanten gebunden und nochmals geprüft.
|
||||
2. `prepare` liest ausschließlich öffentliche lokale Belege und erzeugt einen
|
||||
privaten, einmaligen Fall. `stage --case <id>` überträgt ausschließlich den
|
||||
fixierten Controller über den bestehenden bestätigten SSH-Transport.
|
||||
3. `install --case <id>` darf genau eine bisher fehlende feste öffentliche Datei
|
||||
veröffentlichen. Bereits vorhandene Datei, aktiver Marker oder Teilfall
|
||||
verweigern einen neuen Installationsversuch. Ein verlorener Antwortweg führt
|
||||
ausschließlich zu `read --case <id>`, nicht zu Wiederholung oder Rollback.
|
||||
4. Root liest den ursprünglichen Fall separat und prüft danach die echten
|
||||
passiven Agent-/Helper-Zeitbelege. Eine erfolgreiche Veröffentlichung allein
|
||||
setzt `clock_runtime_qualified` ausdrücklich nicht auf true.
|
||||
|
||||
## Begrenzte Wirkung und Erhaltungsnachweis
|
||||
|
||||
Der Controller verwendet ausschließlich die vorhandenen lesenden SCM-,
|
||||
Kernel-, FileID-, PKI-Metadaten- und Journalzeugen. Er importiert keine alten
|
||||
Stop-/Start-/Swap-/Repair-Phasen. Die aktuelle Prozessgeneration, beide Images,
|
||||
vier Code-/Policydateien, Konfiguration, Geräteidentität, Zertifikat,
|
||||
Schlüsselmetadaten, Telemetrieidentität, Sequenzmonotonie und leere
|
||||
Job-/Helper-Intents werden vor, während und nach der Veröffentlichung geprüft.
|
||||
Der private Schlüssel wird weder gelesen noch gehasht.
|
||||
|
||||
Eine neue private Bootstrap-Falldirectory wird nativ exklusiv mit geschützter
|
||||
SYSTEM-/Administrators-DACL angelegt. Alle Originalmarker werden create-only
|
||||
geschrieben und geflusht. Nur der öffentliche Helper-Stamm erhält bei Bedarf
|
||||
fehlende `0x001200a9`-Leserechte für beide **Service-SIDs**, ausschließlich für
|
||||
diesen Ordner, ohne Vererbung auf State/PKI/Ledger. Fremde oder weiter gehende
|
||||
Service-Rechte werden verweigert. Die Kandidatdatei erhält vor Veröffentlichung
|
||||
SYSTEM/Administrators-Vollzugriff und dieselben begrenzten Leser. Die feste
|
||||
Zieldatei wird nach durablem Publish-Intent mit einem gleichvolumigen,
|
||||
überschreibungsfreien Move veröffentlicht; anschließend müssen FileID, Hash
|
||||
und DACL unverändert sein. Keine allgemeine Stromausfall-Atomizität wird daraus
|
||||
abgeleitet. Teilzustände bleiben im Originalfall lesbar, ohne automatische
|
||||
Reparatur oder Rechte-Rücksetzung.
|
||||
|
||||
Unmittelbar vor der ersten Erstellung wird `install_not_before` aus der
|
||||
nativen VM-UTC gelesen und im ursprünglichen Intent sowie Ergebnis erhalten.
|
||||
Das ist eine Herkunftsuntergrenze für die nachfolgende separate Nachlese und
|
||||
den passiven Collector, keine eigenständige Uhrvertrauensbehauptung.
|
||||
|
||||
## Laden und tatsächliche Grenzen
|
||||
|
||||
Das vorhandene `signed_clock::native::SignedClock::open` lädt bei jedem Öffnen
|
||||
geschützte Settings, beweist den eigenen Dienstprozess und öffnet den festen
|
||||
Stamm sowie die maximal 16384 Byte große Datei über `PinnedFile`. Besitzer
|
||||
müssen SYSTEM/Administrators bleiben; zusätzliche Leser dürfen nur die
|
||||
festgelegte Lesemaske besitzen. Beide Images müssen zu den Settings passen.
|
||||
Die Prüfung bindet Dateiinhalt und FileID; spätere Rechecks öffnen denselben
|
||||
Namen erneut und verwerfen Austausch oder Änderungen. Fehlerhaft beobachtete
|
||||
Konfigurationen oder fehlgeschlagene Reads stellen alte Autorität nicht wieder
|
||||
her; geänderte Bytes derselben Generation gelten als Fork.
|
||||
|
||||
Im neuen Agenten versucht die passive Heartbeat-Schleife das Setup bei bisher
|
||||
fehlendem Profil erneut. Ein erster Pin benötigt daher nach Quellenvertrag
|
||||
keinen Dienstneustart. Das ist **noch kein VM-Nachweis**. Der Agent schreibt erst
|
||||
nach tatsächlich erfolgreichem `complete` pro Verbindung öffentliche historische
|
||||
`agent-time-sample.json` und `helper-time-sample.json` in sein bestehendes
|
||||
geschütztes State-Verzeichnis. Der Helper-State bleibt unverändert. Root muss
|
||||
diese Originalbelege noch für die tatsächlich installierten Rollen und
|
||||
Konfigurationsbytes prüfen. Ein Statusfile ersetzt kein aktuelles Job-Startgate.
|
||||
|
||||
## Tatsächlich lokal ausgeführt
|
||||
|
||||
- Python-Syntaxprüfung und geschlossene Sourceguards: PASS.
|
||||
- Sechs lokale Vertragsfälle: PASS. Sie prüfen die reinen Referenzbytes,
|
||||
fehlende Paarbelege, falsche Rollen/Images/Geburt/SID/FileID/Policy/Identität,
|
||||
create-only, begrenztes Lesen, Symlink- und Duplicate-JSON-Verweigerung.
|
||||
Positive In-Memory-Fixtures sind ausdrücklich keine native Qualifikation.
|
||||
- Beide erzeugten PowerShell-ASTs mit vorhandenem lokalem Parser: PASS.
|
||||
- Lokale ETS-Integer-/Bool-/String-Reproduktion sowie Objekt-/Arrayreihenfolge:
|
||||
PASS. Der unveränderte Vergleich aus `e6debe5` war unter Windows PowerShell 5
|
||||
unzureichend: ETS-verpacktes `System.Int32=1` konnte im Objektzweig zu `{}`
|
||||
werden. Der exakt übernommene Comparator aus der getrennt geprüften
|
||||
Clockquelle `90c2708c…` rekonstruiert CLR-Skalare vor dem Objektzweig als
|
||||
unadornierte Werte. Der Clockoperator hat diesen Vergleich außerdem tatsächlich
|
||||
gegen den vollständigen alten Livezustand und ETS-Positiv-/Negativfälle
|
||||
geprüft (`82c4ebe7…`). Das ist kein Profilinstallationsnachweis.
|
||||
- Die festgehaltenen öffentlichen Eingänge, rohen Rollenbelege und realen
|
||||
Quell-/Buildbelege werden vom Operator lokal erfolgreich gelesen. Die durch
|
||||
Root tatsächlich ausgeführten neun Linux- und neun Windows-Zeitmodulprüfungen
|
||||
sind über deren Originalbeleg-Hashes und exakte Testnamen angebunden.
|
||||
- `prepare` ohne reale Paarbelege: erwartete Verweigerung ohne angelegten Fall.
|
||||
|
||||
Im ursprünglichen lokalen Quellprüfstand noch nicht ausgeführt: Übertragung,
|
||||
ACL-Änderung, Konfigurationsinstallation,
|
||||
Produktdienst-Laden/Reopen auf der VM, signierte passive Laufzeitabnahme,
|
||||
WebUI-Genehmigung oder RMM-Job. Der damalige Transportausfall nach Notebook-Suspend war später im
|
||||
bestätigten Wartungsfenster behoben. Der vorbereitete Fall `570c7a86…` bleibt
|
||||
unverändert ohne neue Rollenbelege; der tatsächliche neue Paarbeleg ist4887.
|
||||
|
||||
## Tatsächlicher gebundener Vorbereitungsschritt und Transfer
|
||||
|
||||
Lokale Vorbereitung `ad9fd154-b2be-4f5d-9e17-65abb721ceaf` bestanden;
|
||||
Config-SHA256 `2b4a8a7080770304b80e2a665fa5f5ee1ebbd9182e7c80b184e75b114575b42b`,
|
||||
Manifest `0c9a3ffeed490757f7bd8c63d7e2ec28156212945094621f511e20679ce0b3b0`.
|
||||
Der getrennte Bindungsreview des Operators `a8d55b60…` hat bestanden.
|
||||
Erste tatsächliche Transferphase begann nach `2026-11-15T15:27:41Z`.
|
||||
Der fixierte Controller wurde einmalig übertragen und separat hashgeprüft;
|
||||
Originalantwort `stage-reply.json` im genannten privaten lokalen Fall,
|
||||
SHA256 `29f7654f766ebb53045832bb8c5ed6c83d2cbd96e0a5e1ce6df494cef0c026e6`.
|
||||
Noch kein Konfigurationsinstallations- oder Laufzeitnachweis aus diesem Schritt.
|
||||
|
||||
## Tatsächliche Installation: Teilzustand, nicht abgeschlossen
|
||||
|
||||
Der einmalige Installationsaufruf begann nach `2026-11-15T15:28:18Z`.
|
||||
Die VM hielt vor der ersten Erstellung die Originaluntergrenze
|
||||
`2026-11-15T15:28:24.1309868Z` im Intent fest. Der Bootstrap endete mit
|
||||
`IOException` an Controllerzeile294, dem einzigen
|
||||
`[IO.File]::Move($staged,$target)`. Der ursprüngliche sichere Fehlerbeleg
|
||||
`windows-client/system-pipe-upgrade/remote-error-b01d395c-9141-4bc6-ad70-1b67fb936881.json`
|
||||
enthält Exit1, Fehlerklasse und Zeile, keinen privaten Fehlertext. Die genaue
|
||||
I/O-Ursache ist damit noch nicht geklärt; es wird kein Sharing-/ACL- oder
|
||||
Antivirusproblem als bewiesen ausgegeben. Es gab keinen zweiten Installversuch.
|
||||
|
||||
Ein eigener ausschließlich lesender Originalaufruf begann nach
|
||||
`2026-11-15T15:28:37Z` und bestand. Originalantwort im privaten Fall
|
||||
`ad9fd154-b2be-4f5d-9e17-65abb721ceaf`:
|
||||
`read-51eea530-4155-42d7-9053-1008e84059b6-reply.json`, SHA256
|
||||
`93143fc05e7c814e9b164cd322abd411eee0dedcb485fbb5547a1db8f1975cd2`.
|
||||
Die feste Zieldatei ist **nicht vorhanden**. Der ursprüngliche Intent, aktive
|
||||
NoRetry-Marker, Directory-ACL-Intent und dessen Abschluss sowie der
|
||||
Publish-Intent sind vorhanden; ein `result.json` fehlt. Die nur für diesen
|
||||
Ordner erlaubten Service-Leserechte wurden somit gesetzt, die Konfiguration
|
||||
wurde nicht veröffentlicht. Originale FileIDs/Hashes/PKI-Metadaten, laufende
|
||||
Agent-/Helper-Prozessgenerationen, Jobfreiheit und Journalzeugen bestanden die
|
||||
lesende Erhaltungsprüfung.
|
||||
|
||||
Der Teilzustand bleibt unverändert; kein Retry, Rollback, Dienstwechsel oder
|
||||
RMM-Job wurde ausgeführt. Der passive Zeit-Collector wurde ausdrücklich
|
||||
**nicht** gestartet. `clock_runtime_qualified=false` bleibt bestehen. Nach dem
|
||||
bestätigten Wartungsfenster bis15:30UTC erfolgen keine weiteren VM-Aufrufe.
|
||||
Die gesonderte serverseitige `agent.update`-Inventar-Constraintkorrektur und
|
||||
anschließend frische Heartbeats/ACKs sowie echte signierte Zeitbelege bleiben
|
||||
getrennt zu prüfen. Eine spätere Fortsetzung benötigt zuerst eine lesende
|
||||
Ursachenklärung und einen konkret geprüften Vertrag für den ursprünglichen
|
||||
Teilfall; ein neuer Fall darf diesen Marker nicht umgehen.
|
||||
@@ -41,15 +41,3 @@ Rustfmt nur dieses Example (`skip_children`), Windows-Examplecheck, Clippy mit `
|
||||
`TimeRouteProbe.exe`:19172660Bytes, AMD64-PE, SHA256 `4ef3fc85f5d140f2ad0ff14745dc5d5453a058203d785235d7dabafdf522b088`, Modus0500/ein Hardlink. Enger Readonly-Capabilitymanifest-SHA256 `22ca87604e942b91e68981f694934bc8c933c5fb5ab5858f27a2d3884d64df42`. Der neue Produktpaarbeleg26dc/5967 und dessen Modulquelle d859 bleiben unverändert; dieses Example installiert oder startet keinen Agenten.
|
||||
|
||||
Offen: unabhängiger Fixture-Review, echtes Gateway-/Brokerdeployment und dessen frische Kontextprovenienz, einmalige native Ausführung mit200/403/409, separater lesender Originalfallnachweis und tatsächliche Erhaltungs-/Nulljobwitnesses. Erst danach ist dieser Endpunktgate für die nächste getrennte passive Paarwartung verfügbar. Windows-MVP-Wirkungsabnahmen bleiben offen.
|
||||
|
||||
## Native passive Protokollabnahme
|
||||
|
||||
Tatsächlich anschließend auf der Windows-VM bestanden: genau ein fester
|
||||
HTTP200/403/409-Lauf mit echter Signatur-/vollständiger Kontextprüfung und Exit0,
|
||||
sowie separater Originalfallread mit bytegleicher Antwort. Fall68b841a5-784f-4a34-a8a4-060b267713f0;
|
||||
Runreplyc556747f75987f8d6ced477086cfd77edfb00f2ac74a99b6e721f3c278ecc28a,
|
||||
Runpreservation04bb81f781656f9e695225885b5088d498d1ebe5708a95db563dd6321525617a,
|
||||
Readpreservatione9ef65dc101505919bcba00e1a214d752f44154d6b3f5789c27234551e01e9b9.
|
||||
Details und die ehrlichen Grenzen des ersetzten alten Abschlusslesers stehen in
|
||||
`windows-time-route-operator.md`. Keine Dienstrolle/Clockfrische/SyncReady oder
|
||||
Jobwirkung durch diese Fixture bewiesen.
|
||||
|
||||
@@ -59,63 +59,3 @@ Eigener unveränderlicher Fall
|
||||
ReceiptSHA `44504007fa7d0379e608375181b926ff2a20ae248cfeb2fb51d127b858b3536d`.
|
||||
ScriptSHA bleibt `4c88fdf36f22b0273baaa08bf522bfefbf8482b45317ef852c0e0a331a1fbef2`.
|
||||
Deployment-/Kontextgates bleiben geschlossen, Stage und Route weiterhin offen.
|
||||
|
||||
## Tatsächliche passive Route und separater Read bestanden
|
||||
|
||||
Root hat den tatsächlichen erfolgreichen Unterfall
|
||||
`continue-backend-v1/result.json` mit SHA
|
||||
`3017634f101ee8aff62988f195ccb3a7a8b9e03eaa48b8fb339af9ceb3ad2b4b`
|
||||
und separater Nachlese gebunden. Der alte fehlgeschlagene Deploymentfall bleibt
|
||||
unverändert fehlgeschlagen. Collectorfall68b841a5-784f-4a34-a8a4-060b267713f0,
|
||||
Receipt658fa5ffa63c6e412237f5feb718b745bb560230f17c54e437ad8bd98e9ad65b,
|
||||
Kontext3c0e4ff3b16b86fb4e98d2ff163686305ea533570c40ae3bef1270ab89648ed3:
|
||||
tatsächliche aktuelle Geräte-/Tenant-/Generation-/Bootbindung und Gatewayimage.
|
||||
Die ungenutzte doppelte Deploymentpfadkonstante wurde entfernt.
|
||||
|
||||
Stage meldete tatsächlich Erfolg, bevor der nachgelagerte alte14fb-finish-
|
||||
Leser nach180s ohne Antwort abbrach. Das ist kein erfolgreicher Originalwitness.
|
||||
Eine direkte lesende Diagnose antwortete sofort, keine laufenden Probeprozesse.
|
||||
Der erste Agentname dieser Diagnose war falsch; `present=false` für
|
||||
`RustDiscoveryAgent` ist kein Ausfall des tatsächlichen `RmmDiscoveryWindows`.
|
||||
Keine Stage wurde wiederholt und bis dahin kein HTTP-Probelauf gestartet.
|
||||
|
||||
Auf ausdrückliche Rootanweisung ersetzte die Fortsetzung den hängenden früheren
|
||||
Upgradeabschlussleser durch dessen vorhandene reine FileID-/SCM-/Kernelprimitive,
|
||||
ohne Journal-/Clock-/Snapshotaufruf. Die ersten umfangreichen Readerbytes
|
||||
überschritten als EncodedCommand die Windows-Kommandozeilengrenze; der Reader
|
||||
wurde danach als feste hashgebundene Nutzlast über stdin übermittelt. Auch dieser
|
||||
Fehler lag vor jedem Probestart. Originalbelege wurden nicht überschrieben.
|
||||
Die Fortsetzung liegt als enge `direct()`-Funktion im bestehenden Operator;
|
||||
keine weitere Operator-Datei entstand. Tatsächlich ausgeführte Quelle ist im
|
||||
Originalfall als `executed-direct-operator.py` unverändert gesichert.
|
||||
|
||||
Der einzige tatsächliche TimeRouteProbe-Lauf ergab:
|
||||
|
||||
- HTTP200, echte Ed25519-Signatur, kompletter eigener Nonce-/Request-/Kontextbezug.
|
||||
- HTTP403 für den fest abweichenden Tenant.
|
||||
- HTTP409 für die vorherige Verbindungsgeneration.
|
||||
- Tatsächliches Kernelprozessende mit Exit0, kein Timeout, stderr leer.
|
||||
|
||||
Runreply `c556747f75987f8d6ced477086cfd77edfb00f2ac74a99b6e721f3c278ecc28a`,
|
||||
Erhaltungsbeleg `04bb81f781656f9e695225885b5088d498d1ebe5708a95db563dd6321525617a`.
|
||||
Separater Read `read-direct-6f2e1bc2-e26c-4dfb-a642-06a6a154ef5c` bestätigt
|
||||
bytegleichen gespeicherten Runreply und neuen Erhaltungsbeleg
|
||||
`e9ef65dc101505919bcba00e1a214d752f44154d6b3f5789c27234551e01e9b9`.
|
||||
Tatsächlicher ReportSHA9f1635c19c801f95c9828e9e31071a487b430f105a61977ee2d60f076f3d3623,
|
||||
ExitfileSHA6d131d2796936913f53286573e56f7fb3e515d04ebbd55ae9d6794440e6053b5.
|
||||
|
||||
Direkt vor/nach Run und Read unverändert: laufende ursprüngliche Dienste mit
|
||||
Kernel-PID/Geburt/Image/Konto, ursprüngliche config/PKI/Publicpin-Bytes,
|
||||
DateiIDs/ACLs und Privatekeymetadaten ohne Keyread, native Telemetriedateiidentität
|
||||
sowie aktuelle Helper-DB-/Lockdateiidentitäten. Deren alte FileID/Geburt stimmen
|
||||
ebenfalls; die historischen ACL-Digests aus dem anderen Probe sind abweichend
|
||||
und werden ausdrücklich nicht als erfolgreicher Altvergleich ausgegeben.
|
||||
Aktuelle direkte ACL-Metadaten sind vor/nach identisch. Geschlossene Windows-
|
||||
Job-/Outbox-/Permitzähler bleiben0; Linux31/31/27 und Rootpolicy unverändert.
|
||||
Der alte umfassende Journalabschlussleser bleibt als Timeout offen; es wurde
|
||||
keine erneute Journalintegritätsprüfung behauptet.
|
||||
|
||||
Dies ist ausschließlich eine tatsächliche passive mTLS-/Signatur-/Kontextabnahme.
|
||||
Dienstrollen-Zeitauthorität, Clockfrische, SyncReady und Jobwirkungen bleiben
|
||||
weiterhin unbewiesen und geschlossen. Kein Agentpaarwechsel oder VM-Neustart
|
||||
war Bestandteil dieses Schrittes.
|
||||
|
||||
@@ -79,28 +79,3 @@ aktuelle Runtime-/Control-/Stateidentitäten, Receipt
|
||||
Unabhängiger Quellenreview des Schema-/Bracket-/Constructorfencedeltas ebenfalls
|
||||
ohne konkreten Befund abgeschlossen. Keine Windows-Rollen-/Zeitkonfiguration,
|
||||
kein RMM-Job oder Effektgate wurde dadurch aktiviert.
|
||||
|
||||
## Tatsächliche öffentliche Vorbereitungsdaten, keine Konfiguration
|
||||
|
||||
Lokaler Fall `windows-time-profile-public-preparation/c3077acf-12da-410e-9f55-e75a1cd0a75f`
|
||||
bindet den tatsächlich selektiv gelesenen KVM-/Hypervclock-Plattformbeleg94ae865e…,
|
||||
den echten öffentlichen Zeitpin c31d31d2…, die unveränderte öffentliche14fb-
|
||||
Gerätebindung und das tatsächliche202-Input-Produktpaar26dc/5967. Receipt
|
||||
`97e4db147f31f3cff134d2bc596d7d73ea5330b8b5a87971f215bb03a9751391`,
|
||||
Provenienz `1c0db66cd0692024f68bddd71949692d274380a86e4b880fea0756479ceb5d0c`.
|
||||
Timekey und konkreter Jobkey sind verschieden. Keine private Signierdatei gelesen.
|
||||
|
||||
Der ausdrücklich gelieferte öffentliche Plattformoriginalbeleg hat Modus0664;
|
||||
der vorhandene0600-Pinloader wies ihn zuerst erwartungsgemäß ab. Originalbytes
|
||||
und Modus wurden nicht geändert. Die bekannte SHA94ae bindet ausschließlich eine
|
||||
neue eigene0600-Kopie innerhalb dieses lokalen700-Falls; sie wird nicht als schon
|
||||
provisionierter geschützter Zielpin ausgegeben. Keine zusätzliche Operatorquelle
|
||||
oder Toolinstallation entstanden.
|
||||
|
||||
Dieser Fall ist ausdrücklich **keine** `time-attestation.json`. Für die beiden
|
||||
Schema2-`qualification_sha256` fehlen noch tatsächliche Dienst-/Prozess-/Imagebelege
|
||||
der neuen Produktimages. Der frühere Rawcapture-Probe601… ist ein anderes Image
|
||||
und ersetzt diese Bindung nicht. Nach der getrennten passiven Paarwartung dürfen
|
||||
die tatsächlichen neuen LocalService-/SYSTEM-Kernel-/Servicebelege mit vorhandenen
|
||||
Source-, Rawcapture- und Plattformbelegen verbunden werden. Erst danach wird die
|
||||
echte V2-Konfiguration erstellt; Runtimefrische und Genehmigungen folgen getrennt.
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"os": "Linux",
|
||||
"hostname": "synthetic-codec-only",
|
||||
"architecture": "x86_64",
|
||||
"root_total_bytes": 2,
|
||||
"root_available_bytes": 1,
|
||||
"root_available_inodes": 1,
|
||||
"collection_started_at": "2026-11-15T12:00:00Z",
|
||||
"collection_completed_at": "2026-11-15T12:00:00Z",
|
||||
"observations": [
|
||||
{
|
||||
"scope": "linux.agent_update.catalog",
|
||||
"source_id": "agent:cached-release-catalog-v1",
|
||||
"observed_at": "2026-11-15T12:00:00Z",
|
||||
"quality": "valid",
|
||||
"completeness": "complete",
|
||||
"truncated": false,
|
||||
"error_code": null,
|
||||
"data": {
|
||||
"schema_version": 1,
|
||||
"source_id": "mtls:release-catalog-v1",
|
||||
"checked_at": "2026-11-15T10:00:00Z",
|
||||
"status": "available",
|
||||
"candidate": {
|
||||
"release_id": "11111111-1111-4111-8111-111111111111",
|
||||
"release_sequence": 8,
|
||||
"version": "0.1.8",
|
||||
"manifest_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
"keyring_generation": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { expect, it, vi } from 'vitest';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import { CatalogCheckNotice } from './catalog-check';
|
||||
|
||||
it('shows actual check time separately from later inventory cache reading without actions or requests', () => {
|
||||
const fetch = vi.fn(); vi.stubGlobal('fetch', fetch);
|
||||
try {
|
||||
const device = { inventory: JSON.parse(readFileSync(new URL('../../tests/agent_update/catalog-check-inventory.json', import.meta.url),'utf8')) };
|
||||
const html = renderToStaticMarkup(<CatalogCheckNotice device={device}/>);
|
||||
for (const expected of ['2026-11-15T10:00:00Z', '2026-11-15T12:00:00Z', '0.1.8', 'available', 'keine Installation']) expect(html).toContain(expected);
|
||||
expect(html).not.toMatch(/<(button|form|input|script)\b/); expect(fetch).not.toHaveBeenCalled();
|
||||
device.inventory.observations[0]!.data.candidate.version = '<script>approve()</script>';
|
||||
expect(renderToStaticMarkup(<CatalogCheckNotice device={device}/>)).toContain('role="alert"');
|
||||
expect(renderToStaticMarkup(<CatalogCheckNotice device={{inventory:{}}}/>)).toBe('');
|
||||
} finally { vi.unstubAllGlobals(); }
|
||||
});
|
||||
@@ -1,28 +0,0 @@
|
||||
import type { RecordValue } from './api';
|
||||
|
||||
function object(value: unknown): RecordValue | null { return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as RecordValue : null; }
|
||||
const exact = (value: RecordValue, keys: string[]) => Object.keys(value).every(key => keys.includes(key));
|
||||
const date = (value: unknown): value is string => typeof value === 'string' && value.length <= 40 && Number.isFinite(Date.parse(value));
|
||||
const positive = (value: unknown) => Number.isSafeInteger(value) && Number(value) > 0;
|
||||
export function CatalogCheckNotice({ device }: { device: unknown }) {
|
||||
const inventory = object(object(device)?.inventory), entries = inventory?.observations;
|
||||
if (!Array.isArray(entries)) return null;
|
||||
const matches = entries.map(object).filter(entry => entry?.scope === 'linux.agent_update.catalog');
|
||||
if (!matches.length) return null;
|
||||
const invalid = <p role="alert">Gespeicherter Releasekatalogcheck ist ungültig; kein Updatebeleg.</p>;
|
||||
if (matches.length !== 1) return invalid;
|
||||
const entry = matches[0]!, report = object(entry.data);
|
||||
if (!report || entry.source_id !== 'agent:cached-release-catalog-v1' || entry.completeness !== 'complete' || entry.truncated !== false || !date(entry.observed_at)
|
||||
|| !exact(report, ['schema_version', 'source_id', 'checked_at', 'status', 'candidate']) || report.schema_version !== 1 || report.source_id !== 'mtls:release-catalog-v1'
|
||||
|| !date(report.checked_at) || Date.parse(report.checked_at) > Date.parse(entry.observed_at) + 1000) return invalid;
|
||||
const status = report.status, candidate = object(report.candidate), available = status === 'available' || status === 'current';
|
||||
if (!(available || status === 'not_configured' || status === 'unavailable') || entry.quality !== (available ? 'valid' : status === 'not_configured' ? 'unknown' : 'error')) return invalid;
|
||||
if (available ? !candidate || !exact(candidate, ['release_id', 'release_sequence', 'version', 'manifest_sha256', 'keyring_generation'])
|
||||
|| typeof candidate.release_id !== 'string' || !/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}$/.test(candidate.release_id)
|
||||
|| !positive(candidate.release_sequence) || !positive(candidate.keyring_generation) || typeof candidate.version !== 'string' || !/^[A-Za-z0-9.+_-]{1,64}$/.test(candidate.version)
|
||||
|| typeof candidate.manifest_sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(candidate.manifest_sha256) : Object.hasOwn(report, 'candidate')) return invalid;
|
||||
return <aside aria-label="Gespeicherter Releasekatalogcheck"><h4>Passiver Releasekatalogcheck</h4>
|
||||
<p>Status: {String(status)} · geprüft: <time>{report.checked_at}</time></p><p>Cache im Inventar gelesen: <time>{entry.observed_at}</time></p>
|
||||
{candidate && <p>Release: {String(candidate.version)} · Sequenz {String(candidate.release_sequence)}<br/>Manifest SHA-256: <code>{String(candidate.manifest_sha256)}</code></p>}
|
||||
<p>Katalogmetadaten; keine Installation oder Ausführungserlaubnis.</p></aside>;
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
import { CatalogCheckNotice } from './catalog-check';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { actions, Action, ApiError, authConfig, approvalBlockers, expectedStdout, objectId, page, Page, PlanInput, pretty, record, RecordValue, request, session, Session, stringField, tenant, tenantPath, validateInput, windowsPowerShellRemoteSignedProfile, fullMaintenanceScriptProfile } from './api';
|
||||
@@ -98,7 +97,7 @@ function Devices({ tenantId, auth, selected, setSelected }: { tenantId: string;
|
||||
return <section><h2>Geräte und gespeichertes Inventar</h2><p>Präsenz, Datenfrische und fachliche Gesundheit sind unabhängig. „unreachable“ bedeutet nicht „ausgeschaltet“.</p><ErrorBox error={list.error}/>
|
||||
{!list.data ? <p>Lade Geräte …</p> : <><PageStatus data={list.data}/><div className="table"><table><thead><tr><th>Fest auswählen</th><th>Gerät / Asset-ID</th><th>Präsenz / Gesundheit</th><th>Quelle / Qualität</th><th>Erhebung / Alter / Empfang</th></tr></thead><tbody>{list.data.items.map(d => { const id = objectId(d, 'asset'); return <tr key={id}><td><input aria-label={`Ziel ${id}`} type="checkbox" checked={selected.includes(id)} onChange={e => setSelected(e.target.checked ? [...selected, id] : selected.filter(v => v !== id))}/></td><td><button className="link" onClick={() => setAsset(id)}>{typeof d.hostname === 'string' ? d.hostname : id}</button><small>{id}</small></td><td>{stringField(d, 'presence')} / {stringField(d, 'health')}<small>Kontakt: {stringField(d, 'last_contact_at')}</small></td><td>{stringField(d, 'source_id')} / {stringField(d, 'quality')}<small>{stringField(d, 'completeness')}</small></td><td>{stringField(d, 'observed_at')}<small>Alter: <Age value={d.observed_at}/> · empfangen: {stringField(d, 'received_at')}</small></td></tr>; })}</tbody></table></div>{!list.data.items.length && <p>Keine sichtbaren Geräte in diesem Listenabschnitt.</p>}<button disabled={!cursor} onClick={() => setCursor(null)}>Erste Seite</button> <button disabled={!list.data.next_cursor} onClick={() => setCursor(list.data?.next_cursor ?? null)}>Nächste Seite</button></>}
|
||||
<p>Fester Auswahlsnapshot ({selected.length}): {selected.join(', ') || 'keine Ziele'}</p>
|
||||
{asset && <article><h3>Inventardetail {asset}</h3><ErrorBox error={detail.error}/>{detail.data && <><CatalogCheckNotice device={detail.data}/><JsonView value={detail.data} label="Inventar, Capabilities, Metriken, Dienste, Software, Updates, Logs und Quellen (soweit geliefert)"/></>}<AdminControl auth={auth} path={tenantPath(tenantId, `/devices/${encodeURIComponent(asset)}/revocation`)} permission="devices:revoke" title="Geräteidentität widerrufen" warning="ACHTUNG: Widerruf unterbricht die Geräteverwaltung und sperrt neue Starts. Kein Entfernen aus einer Liste, kein Rollback. Wiederaufnahme erfordert einen gesonderten sicheren Enrollment-/Recoveryprozess." done={detail.reload}/></article>}
|
||||
{asset && <article><h3>Inventardetail {asset}</h3><ErrorBox error={detail.error}/>{detail.data && <JsonView value={detail.data} label="Inventar, Capabilities, Metriken, Dienste, Software, Updates, Logs und Quellen (soweit geliefert)"/>}<AdminControl auth={auth} path={tenantPath(tenantId, `/devices/${encodeURIComponent(asset)}/revocation`)} permission="devices:revoke" title="Geräteidentität widerrufen" warning="ACHTUNG: Widerruf unterbricht die Geräteverwaltung und sperrt neue Starts. Kein Entfernen aus einer Liste, kein Rollback. Wiederaufnahme erfordert einen gesonderten sicheren Enrollment-/Recoveryprozess." done={detail.reload}/></article>}
|
||||
</section>;
|
||||
}
|
||||
const initialParameters: Record<Action, RecordValue> = {
|
||||
|
||||
Reference in New Issue
Block a user