Integrate signed agent catalog, tenant enrollment and HTTPS installers
This commit is contained in:
@@ -60,7 +60,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
|
||||
Platform::LinuxX64 => PeerPinTransition::UnchangedGeneralPinV1 {
|
||||
general_pin_sha256: "10".repeat(32),
|
||||
},
|
||||
Platform::WindowsX64 => PeerPinTransition::WindowsCodePairV1 {
|
||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => PeerPinTransition::WindowsCodePairV1 {
|
||||
old_settings_sha256: "11".repeat(32),
|
||||
new_settings_sha256: "12".repeat(32),
|
||||
old_pin_sha256: "13".repeat(32),
|
||||
@@ -111,7 +111,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
|
||||
},
|
||||
execution_identity: match platform {
|
||||
Platform::LinuxX64 => "root",
|
||||
Platform::WindowsX64 => "system",
|
||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
||||
}
|
||||
.into(),
|
||||
not_before: "2030-01-01T12:00:00Z".parse().unwrap(),
|
||||
|
||||
@@ -52,6 +52,8 @@ pub enum Platform {
|
||||
LinuxX64,
|
||||
#[serde(rename = "x86_64-pc-windows-msvc")]
|
||||
WindowsX64,
|
||||
#[serde(rename = "x86_64-pc-windows-gnu")]
|
||||
WindowsGnuX64,
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
@@ -707,7 +709,7 @@ impl ResolvedAgentUpdate {
|
||||
pub fn execution_identity(&self) -> Option<&'static str> {
|
||||
self.manifest().ok().map(|m| match m.platform {
|
||||
Platform::LinuxX64 => "root",
|
||||
Platform::WindowsX64 => "system",
|
||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,12 +66,7 @@ pub fn validate_for_scope(
|
||||
.map_err(|_| "INVALID_AGENT_UPDATE_OBSERVATION")?
|
||||
!= update
|
||||
|| !typed.agent_update.validate()
|
||||
|| typed.agent_update.platform
|
||||
!= if scope == "linux.base" {
|
||||
crate::agent_update::Platform::LinuxX64
|
||||
} else {
|
||||
crate::agent_update::Platform::WindowsX64
|
||||
}
|
||||
|| (typed.agent_update.platform == crate::agent_update::Platform::LinuxX64) != (scope == "linux.base")
|
||||
|| typed.agent_update.observed_at - now > chrono::Duration::seconds(45)
|
||||
|| now - typed.agent_update.observed_at > chrono::Duration::hours(72)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user