diff --git a/docs/modeling.md b/docs/modeling.md index 1b52b03..97b2ddb 100644 --- a/docs/modeling.md +++ b/docs/modeling.md @@ -215,7 +215,7 @@ TechnologySystemSoftware, TechnologyService, TechnologyArtifact). The same princ down to the team, which points to nothing further. On a TechnologyFacility, `servedBy` stays the operator of the site. 14. A client device (developer workstation, laptop, phone) is a `TechnologyDevice` with a client `device/type` and - `device/os`, `device/osVersion`, `device/arch`, `device/ownership`, `device/managed` and `device/encryption`; the + `device/os`, `device/osVersion`, `device/arch` (the CPU generation of a server is `device/cpu`, the exact model `device/cpuModel`), `device/ownership`, `device/managed` and `device/encryption`; the vendor and product are in `device/model` (also for a hardened workstation that runs the user's operating system virtualized beside other isolated sessions, which is a `workstation`). Model the individual machine when it is inventoried, otherwise one `TechnologyNode` per client platform `realizedBy` the devices. The operating system is diff --git a/examples/archsight/technology/devices.yaml b/examples/archsight/technology/devices.yaml index 9973539..6b85e6c 100644 --- a/examples/archsight/technology/devices.yaml +++ b/examples/archsight/technology/devices.yaml @@ -11,6 +11,8 @@ metadata: device/type: server device/role: hypervisor device/model: 2U server + device/arch: x86_64 + device/cpu: Ice Lake spec: locatedAt: technologyFacilities: @@ -28,6 +30,8 @@ metadata: device/type: server device/role: hypervisor device/model: 2U server + device/arch: x86_64 + device/cpu: Ice Lake spec: locatedAt: technologyFacilities: @@ -95,6 +99,8 @@ metadata: device/type: server device/role: hypervisor device/model: 2U server + device/arch: x86_64 + device/cpu: Sapphire Rapids spec: locatedAt: technologyFacilities: diff --git a/lib/archsight/resources/technology_device.rb b/lib/archsight/resources/technology_device.rb index 5af2ad4..c4b4492 100644 --- a/lib/archsight/resources/technology_device.rb +++ b/lib/archsight/resources/technology_device.rb @@ -47,6 +47,13 @@ class Archsight::Resources::TechnologyDevice < Archsight::Resources::Base - Who uses it is the team or role (`servedBy`), not a person; a client device needs no room, `locatedAt` an office is optional + ## CPU generation + + `device/arch` is the instruction set; `device/cpu` is the microarchitecture or generation ("Ice Lake", + "Zen 5") and `device/cpuModel` the exact model number. Hosts of one generation share the CPU features a VM can + be given and the live-migration domain, so `device/cpu == "Ice Lake"` lists them. The vendor product of the + machine stays in `device/model`. + ## Not this kind - A VM, a Kubernetes node or a host role is a `TechnologyNode` @@ -115,6 +122,13 @@ class Archsight::Resources::TechnologyDevice < Archsight::Resources::Base title: "Architecture", enum: %w[x86_64 arm64 riscv64 other], filter: :word + annotation "device/cpu", + description: "CPU microarchitecture or generation, e.g. Ice Lake, Sierra Forest, Zen 5", + title: "CPU", + filter: :word + annotation "device/cpuModel", + description: "Exact CPU model number, e.g. Xeon Gold 6338", + title: "CPU Model" annotation "device/ownership", description: "Who owns the device", title: "Ownership", diff --git a/test/technology_device_test.rb b/test/technology_device_test.rb index 7675971..89ac2d4 100644 --- a/test/technology_device_test.rb +++ b/test/technology_device_test.rb @@ -434,6 +434,14 @@ def test_client_device_types_and_attributes_are_enums assert_empty klass.annotations.select { |a| a.key.start_with?("device/") && a.enum }.map(&:key) - klass.annotations.select(&:filterable?).map(&:key) end + def test_cpu_generation_is_a_filterable_free_text_annotation + klass = Archsight::Resources::TechnologyDevice + + assert_predicate klass.annotation_matching("device/cpu"), :filterable? + assert klass.annotation_matching("device/cpu").valid?("Sapphire Rapids") + assert_equal "CPU Model", klass.annotation_matching("device/cpuModel").title + end + def test_the_operating_system_is_a_summary_annotation_within_the_limit summary = Archsight::Resources::TechnologyDevice.summary_annotations.map(&:key)