mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-12-15 16:55:48 -07:00
Updated Agent Auditing Module with Better OS Reporting
This commit is contained in:
36
.vscode/tasks.json
vendored
36
.vscode/tasks.json
vendored
@@ -51,6 +51,42 @@
|
|||||||
"panel": "shared"
|
"panel": "shared"
|
||||||
},
|
},
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Copy Staging Web Interface to Runtime",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "powershell.exe",
|
||||||
|
"args": [
|
||||||
|
"-NoLogo",
|
||||||
|
"-NoProfile",
|
||||||
|
"-ExecutionPolicy",
|
||||||
|
"Bypass",
|
||||||
|
"-Command",
|
||||||
|
"& { $workspace = \"${workspaceFolder}\"; $runtime = Join-Path $workspace 'Engine\\web-interface'; $runtimeSrc = Join-Path $runtime 'src'; $stagingSrc = Join-Path $workspace 'Data\\Engine\\web-interface\\src'; if (Test-Path $runtimeSrc) { Remove-Item $runtimeSrc -Recurse -Force }; if (-not (Test-Path $runtime)) { New-Item -ItemType Directory -Path $runtime | Out-Null }; Copy-Item $stagingSrc -Destination $runtime -Recurse }"
|
||||||
|
],
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "shared"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Copy Runtime Web Interface into Staging",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "powershell.exe",
|
||||||
|
"args": [
|
||||||
|
"-NoLogo",
|
||||||
|
"-NoProfile",
|
||||||
|
"-ExecutionPolicy",
|
||||||
|
"Bypass",
|
||||||
|
"-Command",
|
||||||
|
"& { $workspace = \"${workspaceFolder}\"; $runtime = Join-Path $workspace 'Engine\\web-interface'; $runtimeSrc = Join-Path $runtime 'src'; $stagingRoot = Join-Path $workspace 'Data\\Engine\\web-interface'; $stagingSrc = Join-Path $stagingRoot 'src'; if (Test-Path $stagingSrc) { Remove-Item $stagingSrc -Recurse -Force }; if (-not (Test-Path $stagingRoot)) { New-Item -ItemType Directory -Path $stagingRoot | Out-Null }; Copy-Item $runtimeSrc -Destination $stagingRoot -Recurse }"
|
||||||
|
],
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "shared"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ def detect_agent_os():
|
|||||||
build_number = _get("CurrentBuildNumber", "") or _get("CurrentBuild", "")
|
build_number = _get("CurrentBuildNumber", "") or _get("CurrentBuild", "")
|
||||||
ubr = _get("UBR", None)
|
ubr = _get("UBR", None)
|
||||||
edition_id = _get("EditionID", "")
|
edition_id = _get("EditionID", "")
|
||||||
|
installation_type = _get("InstallationType", "")
|
||||||
|
|
||||||
wmi_info = {}
|
wmi_info = {}
|
||||||
try:
|
try:
|
||||||
@@ -119,16 +120,20 @@ def detect_agent_os():
|
|||||||
if not isinstance(product_type_val, int):
|
if not isinstance(product_type_val, int):
|
||||||
product_type_val = 0
|
product_type_val = 0
|
||||||
|
|
||||||
|
def _contains_server(text) -> bool:
|
||||||
|
try:
|
||||||
|
return isinstance(text, str) and 'server' in text.lower()
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
is_server = False
|
is_server = False
|
||||||
if product_type_val not in (0, 1):
|
if product_type_val not in (0, 1):
|
||||||
is_server = True
|
is_server = True
|
||||||
elif product_type_val == 1:
|
if not is_server:
|
||||||
is_server = False
|
for hint in (product_name, wmi_caption, edition_id, installation_type):
|
||||||
else:
|
if _contains_server(hint):
|
||||||
if isinstance(product_name, str) and 'server' in product_name.lower():
|
is_server = True
|
||||||
is_server = True
|
break
|
||||||
elif wmi_caption and 'server' in wmi_caption.lower():
|
|
||||||
is_server = True
|
|
||||||
|
|
||||||
if is_server:
|
if is_server:
|
||||||
if build_int >= 26100:
|
if build_int >= 26100:
|
||||||
|
|||||||
Reference in New Issue
Block a user