diff options
author | Nathaniel Strauss <nstrauss@users.noreply.github.com> | 2023-03-28 15:17:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 13:17:39 -0700 |
commit | 3616264798b16235dc06c976f9587ec610189897 (patch) | |
tree | b99ddd1ac8b0d12460133091867bdf819b2f7310 /lib | |
parent | 211aa1b0ec5a09ece718ea10c6c01c46fa47ff54 (diff) | |
download | ohai-3616264798b16235dc06c976f9587ec610189897.tar.gz |
Add support for macOS Rapid Security Response updates (#1788)
Apple is adding a new update type to macOS called Rapid Security Responses. These updates change the build version, but not the OS version reported by `sw_vers`. Instead, a new `ProductVersionExtra` key is returned to denote a specific supplemental version only when a RSR is installed. If no RSR is installed the key is not present.
```
$ sw_vers
ProductName: macOS
ProductVersion: 13.3
ProductVersionExtra: (a)
BuildVersion: 22E7752300f
```
https://support.apple.com/guide/deployment/rapid-security-responses-dep93ff7ea78/web
This PR adds support for reporting on the RSR version when a patch is installed. The information is important to Mac admins since it gives a full picture of current OS build, whether a security vulnerability has been patched, and, depending on Apple's future plans, if there is functionality change which could impact Chef. I'll admit the spec test isn't totally useful, especially since most machines running tests likely won't have an RSR, but it does match real world scenarios.
Signed-off-by: nstrauss <nathaniel.strauss@gusto.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ohai/plugins/darwin/platform.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ohai/plugins/darwin/platform.rb b/lib/ohai/plugins/darwin/platform.rb index 7ea38c12..fae7305b 100644 --- a/lib/ohai/plugins/darwin/platform.rb +++ b/lib/ohai/plugins/darwin/platform.rb @@ -18,7 +18,7 @@ # Ohai.plugin(:Platform) do - provides "platform", "platform_version", "platform_build", "platform_family" + provides "platform", "platform_version", "platform_version_extra", "platform_build", "platform_family" collect_data(:darwin) do so = shell_out(Ohai.abs_path( "/usr/bin/sw_vers" ).to_s) @@ -26,6 +26,8 @@ Ohai.plugin(:Platform) do case line when /^ProductVersion:\s+(.+)$/ platform_version $1 + when /^ProductVersionExtra:\s+(.+)$/ + platform_version_extra $1 when /^BuildVersion:\s+(.+)$/ platform_build $1 end |