Skip to content

Add Apple RSR fields to os_version using native API - #8011

Merged
directionless merged 6 commits into
osquery:masterfrom
jbeker:jb/update_darwin_osquery_to_use_api_data
May 23, 2023
Merged

directionless merged 6 commits into
osquery:masterfrom
jbeker:jb/update_darwin_osquery_to_use_api_data

Conversation

@jbeker

@jbeker jbeker commented May 3, 2023

Copy link
Copy Markdown
Contributor

Fixes #8008

Description

This PR adds two new columns to the os_version table to represent the additional data that is now included as part of Apple's RSR patches.

+-------+---------+-------+-------+-------+-------+--------+--------------------+----------+---------------+----------+-------+
| name  | version | major | minor | patch | extra | build  | supplemental_build | platform | platform_like | codename | arch  |
+-------+---------+-------+-------+-------+-------+--------+--------------------+----------+---------------+----------+-------+
| macOS | 13.3.1  | 13    | 3     | 1     | (a)   | 22E261 | 22E772610a         | darwin   | darwin        |          | arm64 |
+-------+---------+-------+-------+-------+-------+--------+--------------------+----------+---------------+----------+-------+

This also converts the way in which the information is collected from parsing the various plist files to using the same API calls that Apple's native sw_vers tool utilizes.

@jbeker
jbeker requested review from a team as code owners May 3, 2023 20:15
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 3, 2023 •

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@directionless directionless added this to the 5.9.0 milestone May 5, 2023
@mike-myers-tob mike-myers-tob changed the title Add Apple RSR fields to os_version using native API Add Apple RSR fields to os_version using native API May 9, 2023
Comment thread specs/os_version.table Resolved
Comment thread specs/os_version.table Resolved
* Updates “version” column to be full “pretty” version as displayed in UI (including supplemental version)
* Moves macOS columns to be extended_schema
* Cleans up how we parse the version data into major/minor/patch
* CFRelease from error states
* Log errors on loading bundle or functions
@jbeker
jbeker requested a review from sharvilshah May 9, 2023 18:25
Comment thread specs/os_version.table Resolved
@sharvilshah

Copy link
Copy Markdown
Member

@jbeker would you mind running clang-format and pushing the changes please?

@sharvilshah

Copy link
Copy Markdown
Member

Test failure:

80: Row: {arch: "x86_64", build: "20G1231", codename: "", extra: "", major: "11", minor: "7", name: "macOS", patch: "6", platform: "darwin", platform_like: "darwin", version: ""}
80: [  FAILED  ] OsVersion.test_sanity (1 ms)
80: [----------] 1 test from OsVersion (1 ms total)

@sharvilshah sharvilshah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! thanks @jbeker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os_version does not display Apple's new Rapid Security Response information

4 participants