clustermax 0.3.1.dev2026110271__tar.gz → 0.3.1.dev2026110474__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clustermax-0.3.1.dev2026110271/clustermax.egg-info → clustermax-0.3.1.dev2026110474}/PKG-INFO +17 -1
- clustermax-0.3.1.dev2026110271/PKG-INFO → clustermax-0.3.1.dev2026110474/README.md +16 -20
- clustermax-0.3.1.dev2026110271/README.md → clustermax-0.3.1.dev2026110474/clustermax.egg-info/PKG-INFO +36 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/clustermax.egg-info/SOURCES.txt +3 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/audit_profiles.py +1 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/audit_report.py +6 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/audit_runner.py +10 -1
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/criteria_links.py +1 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/host_role.py +13 -1
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/obs_discovery.py +54 -1
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/audit-common.sh +44 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/audit_findings.py +44 -2
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/fabric/nic-topology-check.py +92 -1
- clustermax-0.3.1.dev2026110474/cmax/scripts/1-audit/checks/fabric/vf-interface-exposure.py +348 -0
- clustermax-0.3.1.dev2026110474/cmax/scripts/1-audit/checks/system/ingress_nginx_cve_2025_1974.py +188 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/cluster-audit-k8s.sh +45 -18
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/cluster-audit-slurm-security.sh +68 -7
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/cluster-audit-slurm.sh +1 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/cluster-audit-standalone.sh +1 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/host-check.sh +82 -18
- clustermax-0.3.1.dev2026110474/cmax/scripts/1-audit/host_fleet.py +229 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/merge_audit.py +86 -0
- clustermax-0.3.1.dev2026110474/cmax/scripts/1-audit/pwnescape-host-facts.sh +219 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/pwnescape.py +97 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/run_checks.py +10 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/security.py +312 -30
- clustermax-0.3.1.dev2026110271/cmax/scripts/1-audit/pwnescape-host-facts.sh +0 -98
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/LICENSE +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/clustermax.egg-info/dependency_links.txt +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/clustermax.egg-info/entry_points.txt +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/clustermax.egg-info/requires.txt +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/clustermax.egg-info/top_level.txt +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/__init__.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/_version.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/audit_review.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/banner.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/cli.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/cmax.yaml +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/logo.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/minimum_links.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/minimum_refresh.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/minimum_sync.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/obs_check.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/progress.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/report_style.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/runtime_paths.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/bad_epoll.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/_fanout.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/fabric/nccl-ib-qps-check.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/fabric/nccl-topology-file-check.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/fabric/virtio-net-check.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/gpu/vboost.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/platform_config.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/arm-smmu-virtualization-check.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/hbm_memory_exposure.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/hugepages.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/k8s_scheduling.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/kubernetes_nodes_proxy.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/storage_config.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/tenant_pod_defaults.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/checks/system/vm-iommu-check.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/cluster-audit-k8s-security.sh +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/cluster-audit-standalone-security.sh +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/container-check.sh +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/criteria-checks.json +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/gpu_profiles.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/k8s-control.sh +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/k8s_runtime_software.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/kubernetes_quantities.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/minimum-versions.json +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/minimum_versions.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/monitoring-k8s.sh +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/plan_audit.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/run.sh +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/run_legacy_audit.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/security_fleet.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/security_version_audit.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/ubuntu_kernel_cves.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/scripts/1-audit/validate_audit.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/target_selection.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/cmax/yaml_support.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/pyproject.toml +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/setup.cfg +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/setup.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/tests/test_host_isolation.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/tests/test_minimum_pages.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/tests/test_nightly_version.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/tests/test_select_tests.py +0 -0
- {clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/tests/test_stable_release.py +0 -0
{clustermax-0.3.1.dev2026110271/clustermax.egg-info → clustermax-0.3.1.dev2026110474}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clustermax
|
|
3
|
-
Version: 0.3.1.
|
|
3
|
+
Version: 0.3.1.dev2026110474
|
|
4
4
|
Summary: ClusterMAX GPU cluster audit and security CLI
|
|
5
5
|
Author: SemiAnalysis
|
|
6
6
|
Maintainer: SemiAnalysis
|
|
@@ -445,6 +445,22 @@ not connect to kubelets or execute commands in pods. See the
|
|
|
445
445
|
[Kubernetes kubelet authorization documentation](https://kubernetes.io/docs/reference/access-authn-authz/kubelet-authn-authz/)
|
|
446
446
|
and [Graham Helton's nodes/proxy writeup](https://grahamhelton.com/blog/nodes-proxy-rce).
|
|
447
447
|
|
|
448
|
+
Kubernetes full, security, and isolation audits also check pod image tags for
|
|
449
|
+
[ingress-nginx CVE-2025-1974](https://github.com/kubernetes/kubernetes/issues/131009).
|
|
450
|
+
Affected upstream tags produce `FAIL`. Fixed tags start at v1.11.5 and v1.12.1.
|
|
451
|
+
The check reads pods across all namespaces, including non-GPU nodes. It identifies
|
|
452
|
+
controllers by image, command, or ingress-nginx labels and retains each result.
|
|
453
|
+
Denied or incomplete inventory, digest-only images, custom builds, and prerelease
|
|
454
|
+
tags produce `WARNING` when a fixed version cannot be established. An affected
|
|
455
|
+
tag still produces `FAIL` when other evidence is missing.
|
|
456
|
+
|
|
457
|
+
This check reads metadata only. It does not send admission requests, execute
|
|
458
|
+
commands in pods, or read Secrets. A fixed tag does not verify binary identity
|
|
459
|
+
or webhook isolation. Disabling admission does not turn an affected tag into
|
|
460
|
+
a patched version. A complete inventory with no identified controller is
|
|
461
|
+
`SKIPPED`; scaled-to-zero workloads and unrecognized custom builds remain outside
|
|
462
|
+
its scope. Slurm and standalone audits do not run this collector.
|
|
463
|
+
|
|
448
464
|
The standalone audit also omits scale-out network checks. It does not inspect
|
|
449
465
|
InfiniBand, RoCE, RDMA, HCA naming, PKeys, UFM, SHARP, fabric topology, or
|
|
450
466
|
GPUDirect RDMA. The report marks their criteria as `SKIPPED`. Slurm and
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: clustermax
|
|
3
|
-
Version: 0.3.1.dev2026110271
|
|
4
|
-
Summary: ClusterMAX GPU cluster audit and security CLI
|
|
5
|
-
Author: SemiAnalysis
|
|
6
|
-
Maintainer: SemiAnalysis
|
|
7
|
-
License-Expression: Apache-2.0
|
|
8
|
-
Project-URL: Homepage, https://clustermax.semianalysis.com/
|
|
9
|
-
Project-URL: Documentation, https://www.clustermax.ai/criteria
|
|
10
|
-
Requires-Python: >=3.10
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: prompt-toolkit<4,>=3.0.52
|
|
14
|
-
Requires-Dist: PyYAML>=6
|
|
15
|
-
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: build>=1; extra == "dev"
|
|
17
|
-
Requires-Dist: pytest>=8; extra == "dev"
|
|
18
|
-
Requires-Dist: pytest-xdist>=3; extra == "dev"
|
|
19
|
-
Dynamic: license-file
|
|
20
|
-
|
|
21
1
|
# ClusterMAX
|
|
22
2
|
|
|
23
3
|
<div align="center">
|
|
@@ -445,6 +425,22 @@ not connect to kubelets or execute commands in pods. See the
|
|
|
445
425
|
[Kubernetes kubelet authorization documentation](https://kubernetes.io/docs/reference/access-authn-authz/kubelet-authn-authz/)
|
|
446
426
|
and [Graham Helton's nodes/proxy writeup](https://grahamhelton.com/blog/nodes-proxy-rce).
|
|
447
427
|
|
|
428
|
+
Kubernetes full, security, and isolation audits also check pod image tags for
|
|
429
|
+
[ingress-nginx CVE-2025-1974](https://github.com/kubernetes/kubernetes/issues/131009).
|
|
430
|
+
Affected upstream tags produce `FAIL`. Fixed tags start at v1.11.5 and v1.12.1.
|
|
431
|
+
The check reads pods across all namespaces, including non-GPU nodes. It identifies
|
|
432
|
+
controllers by image, command, or ingress-nginx labels and retains each result.
|
|
433
|
+
Denied or incomplete inventory, digest-only images, custom builds, and prerelease
|
|
434
|
+
tags produce `WARNING` when a fixed version cannot be established. An affected
|
|
435
|
+
tag still produces `FAIL` when other evidence is missing.
|
|
436
|
+
|
|
437
|
+
This check reads metadata only. It does not send admission requests, execute
|
|
438
|
+
commands in pods, or read Secrets. A fixed tag does not verify binary identity
|
|
439
|
+
or webhook isolation. Disabling admission does not turn an affected tag into
|
|
440
|
+
a patched version. A complete inventory with no identified controller is
|
|
441
|
+
`SKIPPED`; scaled-to-zero workloads and unrecognized custom builds remain outside
|
|
442
|
+
its scope. Slurm and standalone audits do not run this collector.
|
|
443
|
+
|
|
448
444
|
The standalone audit also omits scale-out network checks. It does not inspect
|
|
449
445
|
InfiniBand, RoCE, RDMA, HCA naming, PKeys, UFM, SHARP, fabric topology, or
|
|
450
446
|
GPUDirect RDMA. The report marks their criteria as `SKIPPED`. Slurm and
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: clustermax
|
|
3
|
+
Version: 0.3.1.dev2026110474
|
|
4
|
+
Summary: ClusterMAX GPU cluster audit and security CLI
|
|
5
|
+
Author: SemiAnalysis
|
|
6
|
+
Maintainer: SemiAnalysis
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://clustermax.semianalysis.com/
|
|
9
|
+
Project-URL: Documentation, https://www.clustermax.ai/criteria
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: prompt-toolkit<4,>=3.0.52
|
|
14
|
+
Requires-Dist: PyYAML>=6
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest-xdist>=3; extra == "dev"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
1
21
|
# ClusterMAX
|
|
2
22
|
|
|
3
23
|
<div align="center">
|
|
@@ -425,6 +445,22 @@ not connect to kubelets or execute commands in pods. See the
|
|
|
425
445
|
[Kubernetes kubelet authorization documentation](https://kubernetes.io/docs/reference/access-authn-authz/kubelet-authn-authz/)
|
|
426
446
|
and [Graham Helton's nodes/proxy writeup](https://grahamhelton.com/blog/nodes-proxy-rce).
|
|
427
447
|
|
|
448
|
+
Kubernetes full, security, and isolation audits also check pod image tags for
|
|
449
|
+
[ingress-nginx CVE-2025-1974](https://github.com/kubernetes/kubernetes/issues/131009).
|
|
450
|
+
Affected upstream tags produce `FAIL`. Fixed tags start at v1.11.5 and v1.12.1.
|
|
451
|
+
The check reads pods across all namespaces, including non-GPU nodes. It identifies
|
|
452
|
+
controllers by image, command, or ingress-nginx labels and retains each result.
|
|
453
|
+
Denied or incomplete inventory, digest-only images, custom builds, and prerelease
|
|
454
|
+
tags produce `WARNING` when a fixed version cannot be established. An affected
|
|
455
|
+
tag still produces `FAIL` when other evidence is missing.
|
|
456
|
+
|
|
457
|
+
This check reads metadata only. It does not send admission requests, execute
|
|
458
|
+
commands in pods, or read Secrets. A fixed tag does not verify binary identity
|
|
459
|
+
or webhook isolation. Disabling admission does not turn an affected tag into
|
|
460
|
+
a patched version. A complete inventory with no identified controller is
|
|
461
|
+
`SKIPPED`; scaled-to-zero workloads and unrecognized custom builds remain outside
|
|
462
|
+
its scope. Slurm and standalone audits do not run this collector.
|
|
463
|
+
|
|
428
464
|
The standalone audit also omits scale-out network checks. It does not inspect
|
|
429
465
|
InfiniBand, RoCE, RDMA, HCA naming, PKeys, UFM, SHARP, fabric topology, or
|
|
430
466
|
GPUDirect RDMA. The report marks their criteria as `SKIPPED`. Slurm and
|
{clustermax-0.3.1.dev2026110271 → clustermax-0.3.1.dev2026110474}/clustermax.egg-info/SOURCES.txt
RENAMED
|
@@ -44,6 +44,7 @@ cmax/scripts/1-audit/container-check.sh
|
|
|
44
44
|
cmax/scripts/1-audit/criteria-checks.json
|
|
45
45
|
cmax/scripts/1-audit/gpu_profiles.py
|
|
46
46
|
cmax/scripts/1-audit/host-check.sh
|
|
47
|
+
cmax/scripts/1-audit/host_fleet.py
|
|
47
48
|
cmax/scripts/1-audit/k8s-control.sh
|
|
48
49
|
cmax/scripts/1-audit/k8s_runtime_software.py
|
|
49
50
|
cmax/scripts/1-audit/kubernetes_quantities.py
|
|
@@ -66,11 +67,13 @@ cmax/scripts/1-audit/checks/platform_config.py
|
|
|
66
67
|
cmax/scripts/1-audit/checks/fabric/nccl-ib-qps-check.py
|
|
67
68
|
cmax/scripts/1-audit/checks/fabric/nccl-topology-file-check.py
|
|
68
69
|
cmax/scripts/1-audit/checks/fabric/nic-topology-check.py
|
|
70
|
+
cmax/scripts/1-audit/checks/fabric/vf-interface-exposure.py
|
|
69
71
|
cmax/scripts/1-audit/checks/fabric/virtio-net-check.py
|
|
70
72
|
cmax/scripts/1-audit/checks/gpu/vboost.py
|
|
71
73
|
cmax/scripts/1-audit/checks/system/arm-smmu-virtualization-check.py
|
|
72
74
|
cmax/scripts/1-audit/checks/system/hbm_memory_exposure.py
|
|
73
75
|
cmax/scripts/1-audit/checks/system/hugepages.py
|
|
76
|
+
cmax/scripts/1-audit/checks/system/ingress_nginx_cve_2025_1974.py
|
|
74
77
|
cmax/scripts/1-audit/checks/system/k8s_scheduling.py
|
|
75
78
|
cmax/scripts/1-audit/checks/system/kubernetes_nodes_proxy.py
|
|
76
79
|
cmax/scripts/1-audit/checks/system/storage_config.py
|
|
@@ -32,6 +32,7 @@ _SECURITY_EXTENSION_IDS = frozenset(
|
|
|
32
32
|
"pcie-passthrough",
|
|
33
33
|
"nvlink-boundary",
|
|
34
34
|
"kubernetes-nodes-proxy",
|
|
35
|
+
"ingress-nginx-cve-2025-1974",
|
|
35
36
|
"observability-isolation",
|
|
36
37
|
"qemu-virtio-serial",
|
|
37
38
|
"vmscape",
|
|
@@ -40,6 +41,7 @@ _SECURITY_EXTENSION_IDS = frozenset(
|
|
|
40
41
|
_SECURITY_EXTENSION_HARNESSES = {
|
|
41
42
|
"ufm-profile": frozenset({"slurm", "k8s"}),
|
|
42
43
|
"kubernetes-nodes-proxy": frozenset({"k8s"}),
|
|
44
|
+
"ingress-nginx-cve-2025-1974": frozenset({"k8s"}),
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
|
|
@@ -432,6 +434,10 @@ _REPRODUCTION_COMMANDS = {
|
|
|
432
434
|
"with the selected Kubernetes context: review ClusterRoles and "
|
|
433
435
|
"ClusterRoleBindings that grant `get` on the core `nodes/proxy` resource"
|
|
434
436
|
),
|
|
437
|
+
"ingress-nginx-cve-2025-1974": (
|
|
438
|
+
"with the selected Kubernetes context: `kubectl get pods --all-namespaces -o json`; "
|
|
439
|
+
"verify ingress-nginx controller versions and admission listener configuration"
|
|
440
|
+
),
|
|
435
441
|
}
|
|
436
442
|
|
|
437
443
|
_UNVERIFIED_RECOMMENDATIONS = {
|
|
@@ -8,7 +8,14 @@ import sys
|
|
|
8
8
|
from datetime import datetime, timezone
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
-
from cmax import audit_report, progress, runtime_paths, security
|
|
11
|
+
from cmax import audit_report, progress, report_style, runtime_paths, security
|
|
12
|
+
|
|
13
|
+
# The Slurm collector prints this too, but the progress display hides
|
|
14
|
+
# collector output, so the runner repeats it after the report.
|
|
15
|
+
SLURM_ALLOCATION_HINT = (
|
|
16
|
+
"SLURM_JOB_ID is not set, so worker fan-out checks report unknown. "
|
|
17
|
+
"Run the audit inside an allocation, for example: salloc -N2 --gres=gpu:1 cmax audit"
|
|
18
|
+
)
|
|
12
19
|
|
|
13
20
|
|
|
14
21
|
class AuditError(RuntimeError):
|
|
@@ -108,6 +115,8 @@ def run(
|
|
|
108
115
|
environment=selected_target.environment,
|
|
109
116
|
)
|
|
110
117
|
print(report)
|
|
118
|
+
if selected_target.harness == "slurm" and not os.environ.get("SLURM_JOB_ID", "").strip():
|
|
119
|
+
print(report_style.paint(SLURM_ALLOCATION_HINT, "yellow", color=sys.stdout.isatty()))
|
|
111
120
|
if exit_on_fail:
|
|
112
121
|
values = json.loads(values_path.read_text())
|
|
113
122
|
checks = audit_report.evaluate(
|
|
@@ -146,6 +146,7 @@ _CHECK_ANCHORS = {
|
|
|
146
146
|
"slurm.accounting.sacctAvailable": _MONITORING_SACCT,
|
|
147
147
|
"bmc-ipmi": _SECURITY_ISOLATION,
|
|
148
148
|
"kubernetes-nodes-proxy": _SECURITY_ISOLATION,
|
|
149
|
+
"ingress-nginx-cve-2025-1974": _SECURITY_ISOLATION,
|
|
149
150
|
"ufm-profile": _SECURITY_UFM,
|
|
150
151
|
"pcie-passthrough": _SECURITY_ISOLATION,
|
|
151
152
|
"nvlink-boundary": _SECURITY_ISOLATION,
|
|
@@ -108,6 +108,7 @@ class Guard:
|
|
|
108
108
|
reason: str
|
|
109
109
|
instead: str
|
|
110
110
|
prompt: str
|
|
111
|
+
note: str = ""
|
|
111
112
|
|
|
112
113
|
|
|
113
114
|
def _classify(facts: HostFacts) -> HostRole:
|
|
@@ -283,7 +284,15 @@ def guard(
|
|
|
283
284
|
)
|
|
284
285
|
if role.kind in {K8S_NODE, K8S_POD}:
|
|
285
286
|
where = "node" if role.kind == K8S_NODE else "pod"
|
|
287
|
+
# kind, minikube, and k3d run their kubelet in a container, so the
|
|
288
|
+
# host sees the kubelet process but none of the kubelet files.
|
|
289
|
+
local_cluster = role.kind == K8S_NODE and role.evidence == ("kubelet is running",)
|
|
286
290
|
return Guard(
|
|
291
|
+
note=(
|
|
292
|
+
"If this kubelet belongs to a local kind, minikube, or k3d "
|
|
293
|
+
"cluster on this host, pass --yes to run here."
|
|
294
|
+
if local_cluster else ""
|
|
295
|
+
),
|
|
287
296
|
reason=(
|
|
288
297
|
f"This host looks like a Kubernetes {where}. A standalone {noun} "
|
|
289
298
|
f"covers only this {where} and skips the cluster checks."
|
|
@@ -355,6 +364,8 @@ def confirm(
|
|
|
355
364
|
if role is not None and role.evidence:
|
|
356
365
|
print(f" Evidence: {'; '.join(role.evidence)}", file=stream)
|
|
357
366
|
print(f" {found.instead}", file=stream)
|
|
367
|
+
if found.note:
|
|
368
|
+
print(f" {found.note}", file=stream)
|
|
358
369
|
print(
|
|
359
370
|
f" If the detection is wrong, review sanitized details before filing: {ISSUE_URL}",
|
|
360
371
|
file=stream,
|
|
@@ -368,7 +379,8 @@ def confirm(
|
|
|
368
379
|
if not terminal:
|
|
369
380
|
raise HostRoleRefused(
|
|
370
381
|
f"{found.reason} {found.instead}. "
|
|
371
|
-
"
|
|
382
|
+
+ (f"{found.note} " if found.note else "")
|
|
383
|
+
+ "To run here anyway, pass --yes or --allow-cluster-node."
|
|
372
384
|
)
|
|
373
385
|
print(" To skip this question, pass --yes or --allow-cluster-node.", file=stream)
|
|
374
386
|
while True:
|
|
@@ -29,9 +29,10 @@ from __future__ import annotations
|
|
|
29
29
|
import json
|
|
30
30
|
import re
|
|
31
31
|
import shutil
|
|
32
|
+
import socket
|
|
32
33
|
import subprocess
|
|
33
34
|
import urllib.parse
|
|
34
|
-
from collections.abc import Iterable, Mapping, Sequence
|
|
35
|
+
from collections.abc import Callable, Iterable, Mapping, Sequence
|
|
35
36
|
from typing import NamedTuple
|
|
36
37
|
|
|
37
38
|
# Default query/user-interface ports of multi-tenant metrics backends. A port
|
|
@@ -145,6 +146,58 @@ class Endpoint(NamedTuple):
|
|
|
145
146
|
url: str
|
|
146
147
|
platform: str
|
|
147
148
|
source: str
|
|
149
|
+
reason: str | None = None
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _host_resolves(host: str) -> bool:
|
|
153
|
+
"""True when getaddrinfo can resolve the host from this vantage.
|
|
154
|
+
|
|
155
|
+
A Service name such as `dcgm-exporter.default.svc.cluster.local` resolves only
|
|
156
|
+
inside the cluster network. A short name or an operator-host vantage may
|
|
157
|
+
never resolve it. The question is reachability of the name, not the service.
|
|
158
|
+
"""
|
|
159
|
+
try:
|
|
160
|
+
socket.getaddrinfo(host, None)
|
|
161
|
+
except (OSError, UnicodeError):
|
|
162
|
+
return False
|
|
163
|
+
return True
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def split_unassessed(
|
|
167
|
+
endpoints: Iterable[Endpoint],
|
|
168
|
+
resolver: Callable[[str], bool] | None = None,
|
|
169
|
+
) -> tuple[list[Endpoint], list[Endpoint]]:
|
|
170
|
+
"""Split discovered endpoints into checkable and unassessable from here.
|
|
171
|
+
|
|
172
|
+
A Service name that the current host cannot resolve was never measured.
|
|
173
|
+
It is not a pass, and it is not unreachable, so it is reported separately.
|
|
174
|
+
Each distinct host is resolved at most once, because a failed lookup costs
|
|
175
|
+
seconds and the same Service can appear more than once.
|
|
176
|
+
"""
|
|
177
|
+
if resolver is None:
|
|
178
|
+
resolver = _host_resolves
|
|
179
|
+
checkable: list[Endpoint] = []
|
|
180
|
+
unassessed: list[Endpoint] = []
|
|
181
|
+
resolved: dict[str, bool] = {}
|
|
182
|
+
for endpoint in endpoints:
|
|
183
|
+
if endpoint.source != "k8s-services":
|
|
184
|
+
checkable.append(endpoint)
|
|
185
|
+
continue
|
|
186
|
+
host = urllib.parse.urlsplit(endpoint.url).hostname or ""
|
|
187
|
+
if host not in resolved:
|
|
188
|
+
resolved[host] = bool(resolver(host))
|
|
189
|
+
if resolved[host]:
|
|
190
|
+
checkable.append(endpoint)
|
|
191
|
+
else:
|
|
192
|
+
unassessed.append(
|
|
193
|
+
endpoint._replace(
|
|
194
|
+
reason=(
|
|
195
|
+
"Kubernetes Service name did not resolve from the "
|
|
196
|
+
"operator host"
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
)
|
|
200
|
+
return checkable, unassessed
|
|
148
201
|
|
|
149
202
|
|
|
150
203
|
class Discovery(NamedTuple):
|
|
@@ -133,6 +133,50 @@ minimum_version_grace() {
|
|
|
133
133
|
fi
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
# nvidia_driver_floors - print the NVIDIA driver branch floors that the
|
|
137
|
+
# minimum version table publishes, as "branch=floor" entries ordered by
|
|
138
|
+
# branch.
|
|
139
|
+
#
|
|
140
|
+
# The streamed host and pod checks cannot read the table, so the collector
|
|
141
|
+
# resolves the floors once and injects them into the check (the same delivery
|
|
142
|
+
# host_check_stdin uses for the kernel ABI minimums). An empty output means the
|
|
143
|
+
# policy could not be read, and the check must report an unknown verdict rather
|
|
144
|
+
# than grade against a guessed floor. Any malformed branch or floor fails the
|
|
145
|
+
# whole read: a partially valid table would grade its listed branches while
|
|
146
|
+
# silently dropping the rest, so the policy is all or nothing.
|
|
147
|
+
nvidia_driver_floors() {
|
|
148
|
+
local branches=""
|
|
149
|
+
if [[ -f "$MINIMUM_VERSIONS_READER" ]] && command -v python3 >/dev/null 2>&1; then
|
|
150
|
+
branches=$(python3 "$MINIMUM_VERSIONS_READER" --get components.nvidiaDriver.branches 2>/dev/null) || branches=""
|
|
151
|
+
fi
|
|
152
|
+
[[ -n "$branches" ]] || return 0
|
|
153
|
+
printf '%s\n' "$branches" | python3 -c '
|
|
154
|
+
import json
|
|
155
|
+
import sys
|
|
156
|
+
|
|
157
|
+
try:
|
|
158
|
+
doc = json.load(sys.stdin)
|
|
159
|
+
except ValueError:
|
|
160
|
+
sys.exit(1)
|
|
161
|
+
if not isinstance(doc, dict) or not doc:
|
|
162
|
+
sys.exit(1)
|
|
163
|
+
floors = {}
|
|
164
|
+
for branch, floor in doc.items():
|
|
165
|
+
text_branch = str(branch)
|
|
166
|
+
text_floor = str(floor)
|
|
167
|
+
parts = text_floor.split(".")
|
|
168
|
+
if (
|
|
169
|
+
not text_branch.isdigit()
|
|
170
|
+
or len(parts) < 2
|
|
171
|
+
or not all(part.isdigit() for part in parts)
|
|
172
|
+
or parts[0] != text_branch
|
|
173
|
+
):
|
|
174
|
+
sys.exit(1)
|
|
175
|
+
floors[int(text_branch)] = text_floor
|
|
176
|
+
print(" ".join(f"{branch}={floors[branch]}" for branch in sorted(floors)))
|
|
177
|
+
' 2>/dev/null || return 0
|
|
178
|
+
}
|
|
179
|
+
|
|
136
180
|
# grade_ubuntu_kernel_cves - grade the running Ubuntu kernel against the exact
|
|
137
181
|
# tracker state for each container-relevant CVE that the minimum table
|
|
138
182
|
# publishes. ubuntu_kernel_cves.py selects the table row whose kernel family and
|
|
@@ -869,6 +869,13 @@ RULES: tuple[Rule, ...] = (
|
|
|
869
869
|
harnesses=SCALE_OUT_HARNESSES,
|
|
870
870
|
),
|
|
871
871
|
# --- Hypervisor security bulletins ----------------------------------
|
|
872
|
+
Rule(
|
|
873
|
+
"security.januscape.status",
|
|
874
|
+
"Nested virtualization exposes Januscape prerequisites on a fleet host",
|
|
875
|
+
VERSION,
|
|
876
|
+
_status_is("fail"),
|
|
877
|
+
cves=("CVE-2026-53359",),
|
|
878
|
+
),
|
|
872
879
|
Rule(
|
|
873
880
|
"security.januscape.status",
|
|
874
881
|
"Nested virtualization exposes Januscape prerequisites",
|
|
@@ -883,6 +890,13 @@ RULES: tuple[Rule, ...] = (
|
|
|
883
890
|
_status_is("unknown"),
|
|
884
891
|
cves=("CVE-2026-53359",),
|
|
885
892
|
),
|
|
893
|
+
Rule(
|
|
894
|
+
"security.januscape.status",
|
|
895
|
+
"Fleet coverage is incomplete for the Januscape exposure check",
|
|
896
|
+
CONFIG,
|
|
897
|
+
_status_is("coverage-incomplete"),
|
|
898
|
+
cves=("CVE-2026-53359",),
|
|
899
|
+
),
|
|
886
900
|
Rule(
|
|
887
901
|
"security.guestKernel.newerInstalled",
|
|
888
902
|
"Newer guest/worker kernel installed but not running; reboot required",
|
|
@@ -914,6 +928,13 @@ RULES: tuple[Rule, ...] = (
|
|
|
914
928
|
_status_is("fail"),
|
|
915
929
|
cves=("CVE-2026-46300", "CVE-2026-43284", "CVE-2026-43500"),
|
|
916
930
|
),
|
|
931
|
+
Rule(
|
|
932
|
+
"security.fragnesia.status",
|
|
933
|
+
"Fleet coverage is incomplete for the Fragnesia / Dirty Frag check",
|
|
934
|
+
CONFIG,
|
|
935
|
+
_status_is("coverage-incomplete"),
|
|
936
|
+
cves=("CVE-2026-46300", "CVE-2026-43284", "CVE-2026-43500"),
|
|
937
|
+
),
|
|
917
938
|
Rule(
|
|
918
939
|
"security.badEpoll.status",
|
|
919
940
|
"Running kernel is below the Bad Epoll fixed package minimum; update and reboot",
|
|
@@ -1674,6 +1695,8 @@ CHECK_CRITERIA: dict[str, str | None] = {
|
|
|
1674
1695
|
# Security extension checks merged by audit_report._security_extension_checks.
|
|
1675
1696
|
"bmc-ipmi": "security-bmc-ipmi",
|
|
1676
1697
|
"kubernetes-nodes-proxy": None,
|
|
1698
|
+
# CVE-specific pod inventory, not complete ingress-controller criteria coverage.
|
|
1699
|
+
"ingress-nginx-cve-2025-1974": None,
|
|
1677
1700
|
"ufm-profile": "ufm-secured-bare-metal-cloud",
|
|
1678
1701
|
"pcie-passthrough": "security-pcie-passthrough",
|
|
1679
1702
|
"nvlink-boundary": "security-nvlink-boundary",
|
|
@@ -1845,9 +1868,15 @@ def _finding_guidance(
|
|
|
1845
1868
|
component_name = _COMPONENT_NAMES.get(component, component)
|
|
1846
1869
|
if (
|
|
1847
1870
|
rule.key == "security.januscape.status"
|
|
1848
|
-
and str(value).strip().lower()
|
|
1871
|
+
and str(value).strip().lower() in {"host-patch-required", "fail"}
|
|
1849
1872
|
):
|
|
1850
|
-
|
|
1873
|
+
payload = nested_get(audit, "security", "januscape", default={})
|
|
1874
|
+
reason = str(payload.get("reason") or "").strip()
|
|
1875
|
+
detected = (
|
|
1876
|
+
reason
|
|
1877
|
+
if str(value).strip().lower() == "fail" and reason
|
|
1878
|
+
else "Nested virtualization prerequisites are exposed"
|
|
1879
|
+
)
|
|
1851
1880
|
recommendation = (
|
|
1852
1881
|
"Disable nested virtualization and remove guest access to /dev/kvm "
|
|
1853
1882
|
"until the provider confirms the physical-host patch."
|
|
@@ -2060,6 +2089,19 @@ def _finding_guidance(
|
|
|
2060
2089
|
"host that the audit could not read, including managed "
|
|
2061
2090
|
"control-plane hosts."
|
|
2062
2091
|
)
|
|
2092
|
+
elif rule.key == "security.pwnescape.status":
|
|
2093
|
+
block = nested_get(audit, "security", "pwnescape", default={})
|
|
2094
|
+
reason = block.get("reason") if isinstance(block, dict) else None
|
|
2095
|
+
detected = str(value).replace("_", " ").capitalize()
|
|
2096
|
+
recommendation = str(reason) if reason else ""
|
|
2097
|
+
if "source package version" not in recommendation.lower():
|
|
2098
|
+
recommendation = (
|
|
2099
|
+
(recommendation + " " if recommendation else "")
|
|
2100
|
+
+ "Ask the provider for the distribution, kernel flavor and "
|
|
2101
|
+
"ABI, the source package version that built the kernel, the "
|
|
2102
|
+
"CVE fix, and the livepatch state, because the upstream "
|
|
2103
|
+
"version alone does not settle a vendor kernel."
|
|
2104
|
+
)
|
|
2063
2105
|
else:
|
|
2064
2106
|
detected = str(value).replace("_", " ").capitalize()
|
|
2065
2107
|
if "reboot required" in rule.title.lower():
|
|
@@ -488,6 +488,43 @@ def parse_lldp(text: str) -> dict:
|
|
|
488
488
|
return fields
|
|
489
489
|
|
|
490
490
|
|
|
491
|
+
def parse_pkey_table(entries: list[str]) -> list[str]:
|
|
492
|
+
"""Normalize non-empty sysfs PKey slots to lowercase 0xNNNN strings.
|
|
493
|
+
|
|
494
|
+
Only populated slots matter: 0x0000 marks an empty table row. A full
|
|
495
|
+
membership key has the high bit set (0x8000); a limited membership key
|
|
496
|
+
leaves it clear. The caller keeps the raw value so the partition policy
|
|
497
|
+
stays visible without a second read.
|
|
498
|
+
"""
|
|
499
|
+
out: list[str] = []
|
|
500
|
+
for entry in entries:
|
|
501
|
+
value = (entry or "").strip().lower()
|
|
502
|
+
if not value or value in {"0x0000", "0x0"}:
|
|
503
|
+
continue
|
|
504
|
+
if not value.startswith("0x"):
|
|
505
|
+
try:
|
|
506
|
+
value = f"{int(value, 16):#06x}"
|
|
507
|
+
except ValueError:
|
|
508
|
+
continue
|
|
509
|
+
out.append(value)
|
|
510
|
+
return out
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
def parse_fabric_facts(lid: str, sm_lid: str, pkey_entries: list[str]) -> dict:
|
|
514
|
+
"""SM and partition facts that a tenant can read from IB port sysfs."""
|
|
515
|
+
facts: dict[str, Any] = {}
|
|
516
|
+
lid = (lid or "").strip().lower()
|
|
517
|
+
sm_lid = (sm_lid or "").strip().lower()
|
|
518
|
+
if lid:
|
|
519
|
+
facts["lid"] = lid
|
|
520
|
+
if sm_lid:
|
|
521
|
+
facts["smLid"] = sm_lid
|
|
522
|
+
pkeys = parse_pkey_table(pkey_entries)
|
|
523
|
+
if pkeys:
|
|
524
|
+
facts["pkeys"] = pkeys
|
|
525
|
+
return facts
|
|
526
|
+
|
|
527
|
+
|
|
491
528
|
def parse_ibnetdiscover(text: str, node_guid: str, host: str) -> dict:
|
|
492
529
|
"""Per-plane neighbor summary from `ibnetdiscover -C <dev> -p`.
|
|
493
530
|
|
|
@@ -528,6 +565,7 @@ def evidence_from_raw(
|
|
|
528
565
|
*,
|
|
529
566
|
node_guid: str = "",
|
|
530
567
|
host: str = "",
|
|
568
|
+
fabric: dict[str, Any] | None = None,
|
|
531
569
|
) -> dict:
|
|
532
570
|
"""Assemble one HCA's tri-state evidence record from raw tool outputs.
|
|
533
571
|
|
|
@@ -536,6 +574,8 @@ def evidence_from_raw(
|
|
|
536
574
|
orchestrator so both paths emit identical shapes.
|
|
537
575
|
"""
|
|
538
576
|
record: dict[str, Any] = {"ibdev": dev, "port": parse_port_attrs(rate_raw)}
|
|
577
|
+
if fabric:
|
|
578
|
+
record["fabric"] = fabric
|
|
539
579
|
record["mlxconfig"] = _tri(*raws.get("mlxconfig", ("", "not attempted")), parse_mlxconfig)
|
|
540
580
|
record["mlxlink"] = _tri(*raws.get("mlxlink", ("", "not attempted")), parse_mlxlink)
|
|
541
581
|
|
|
@@ -577,6 +617,25 @@ def evidence_from_raw(
|
|
|
577
617
|
return record
|
|
578
618
|
|
|
579
619
|
|
|
620
|
+
def _read_fabric_facts(sysfs_root: str, dev: str) -> dict | None:
|
|
621
|
+
"""SM and partition facts from IB port sysfs, without touching UMAD.
|
|
622
|
+
|
|
623
|
+
``sminfo``, ``perfquery`` and ``ibnetdiscover`` all need a UMAD
|
|
624
|
+
registration, which a tenant pod can be denied. The same SM LID and PKey
|
|
625
|
+
table are plain sysfs reads, so the evidence survives that boundary.
|
|
626
|
+
"""
|
|
627
|
+
base = f"{sysfs_root}/{dev}/ports/1"
|
|
628
|
+
entries: list[str] = []
|
|
629
|
+
for path in sorted(glob.glob(f"{base}/pkeys/*")):
|
|
630
|
+
try:
|
|
631
|
+
entries.append(_read_sysfs(path))
|
|
632
|
+
except OSError:
|
|
633
|
+
continue
|
|
634
|
+
return parse_fabric_facts(
|
|
635
|
+
_read_sysfs(f"{base}/lid"), _read_sysfs(f"{base}/sm_lid"), entries
|
|
636
|
+
) or None
|
|
637
|
+
|
|
638
|
+
|
|
580
639
|
def _read_sysfs(path: str) -> str:
|
|
581
640
|
try:
|
|
582
641
|
return open(path).read().strip()
|
|
@@ -615,12 +674,14 @@ def collect_plane_evidence(
|
|
|
615
674
|
continue
|
|
616
675
|
dev = nic["name"]
|
|
617
676
|
rate_raw = _read_sysfs(f"{sysfs_root}/{dev}/ports/1/rate")
|
|
677
|
+
fabric = _read_fabric_facts(sysfs_root, dev) if nic.get("layer") == "InfiniBand" else None
|
|
618
678
|
if time_fn() - started > budget_s:
|
|
619
679
|
record = evidence_from_raw(
|
|
620
680
|
dev,
|
|
621
681
|
nic.get("layer", "?"),
|
|
622
682
|
rate_raw,
|
|
623
683
|
{tool: ("", "budget exhausted") for tool in ("mlxconfig", "mlxlink", "ibnetdiscover", "lldp")},
|
|
684
|
+
fabric=fabric,
|
|
624
685
|
)
|
|
625
686
|
out.append(record)
|
|
626
687
|
continue
|
|
@@ -646,7 +707,8 @@ def collect_plane_evidence(
|
|
|
646
707
|
raws["lldp"] = ("", "no netdev exposed for this HCA")
|
|
647
708
|
out.append(
|
|
648
709
|
evidence_from_raw(
|
|
649
|
-
dev, nic.get("layer", "?"), rate_raw, raws,
|
|
710
|
+
dev, nic.get("layer", "?"), rate_raw, raws,
|
|
711
|
+
node_guid=node_guid, host=host, fabric=fabric,
|
|
650
712
|
)
|
|
651
713
|
)
|
|
652
714
|
return out
|
|
@@ -1070,6 +1132,18 @@ for d in /sys/class/infiniband/*; do
|
|
|
1070
1132
|
checked=$((checked+1))
|
|
1071
1133
|
g=$(cat "$d/node_guid" 2>/dev/null)
|
|
1072
1134
|
printf '@@PLANEGUID@@\t%s\t%s\n' "$n" "$g"
|
|
1135
|
+
# SM and PKey facts are plain sysfs reads, so they survive the UMAD denial
|
|
1136
|
+
# that makes sminfo / perfquery / ibnetdiscover unusable in a system pod.
|
|
1137
|
+
lid=$(cat "$d/ports/1/lid" 2>/dev/null)
|
|
1138
|
+
smlid=$(cat "$d/ports/1/sm_lid" 2>/dev/null)
|
|
1139
|
+
pk=""
|
|
1140
|
+
for pf in "$d"/ports/1/pkeys/*; do
|
|
1141
|
+
[ -e "$pf" ] || continue
|
|
1142
|
+
v=$(cat "$pf" 2>/dev/null)
|
|
1143
|
+
case "$v" in ""|0x0000|0X0000) continue;; esac
|
|
1144
|
+
pk="${pk:+$pk,}$v"
|
|
1145
|
+
done
|
|
1146
|
+
printf '@@PORT@@\t%s\t%s\t%s\t%s\n' "$n" "$lid" "$smlid" "$pk"
|
|
1073
1147
|
l=$(cat "$d/ports/1/link_layer" 2>/dev/null)
|
|
1074
1148
|
# Renamed ibdevs (for example rail0) do not resolve in the mlx tools; the
|
|
1075
1149
|
# PCI function does.
|
|
@@ -1140,6 +1214,21 @@ def _k8s_rate_raws(text: str) -> dict[str, str]:
|
|
|
1140
1214
|
return raws
|
|
1141
1215
|
|
|
1142
1216
|
|
|
1217
|
+
def _parse_k8s_ports(text: str) -> dict[str, dict]:
|
|
1218
|
+
"""Parse @@PORT@@ lines (dev, LID, SM LID, populated PKeys) into facts."""
|
|
1219
|
+
ports: dict[str, dict] = {}
|
|
1220
|
+
for line in text.splitlines():
|
|
1221
|
+
if not line.startswith("@@PORT@@\t"):
|
|
1222
|
+
continue
|
|
1223
|
+
parts = line.split("\t")
|
|
1224
|
+
if len(parts) < 5:
|
|
1225
|
+
continue
|
|
1226
|
+
facts = parse_fabric_facts(parts[2], parts[3], parts[4].split(","))
|
|
1227
|
+
if facts:
|
|
1228
|
+
ports[parts[1]] = facts
|
|
1229
|
+
return ports
|
|
1230
|
+
|
|
1231
|
+
|
|
1143
1232
|
def _parse_k8s_plane(text: str) -> tuple[dict[str, dict[str, tuple[str, str | None]]], dict[str, str]]:
|
|
1144
1233
|
"""Parse @@PLANE@@ / @@PLANEGUID@@ blocks from K8S_COLLECTOR_SH output.
|
|
1145
1234
|
|
|
@@ -1241,6 +1330,7 @@ def run_k8s_node_check(
|
|
|
1241
1330
|
record["topo_error"] = "no output"
|
|
1242
1331
|
plane_raws, plane_guids = _parse_k8s_plane(proc.stdout)
|
|
1243
1332
|
rate_raws = _k8s_rate_raws(proc.stdout)
|
|
1333
|
+
ports = _parse_k8s_ports(proc.stdout)
|
|
1244
1334
|
evidence = [
|
|
1245
1335
|
evidence_from_raw(
|
|
1246
1336
|
nic["name"],
|
|
@@ -1249,6 +1339,7 @@ def run_k8s_node_check(
|
|
|
1249
1339
|
plane_raws.get(nic["name"], {}),
|
|
1250
1340
|
node_guid=plane_guids.get(nic["name"], ""),
|
|
1251
1341
|
host=node,
|
|
1342
|
+
fabric=ports.get(nic["name"]),
|
|
1252
1343
|
)
|
|
1253
1344
|
for nic in record["nics"]
|
|
1254
1345
|
if plane_candidate(nic)
|