Skip to content

Rename hvci_status to deviceguard_status to better reflect the data collected.#8390

Merged
directionless merged 3 commits intoosquery:masterfrom
jm2:master
Sep 19, 2024
Merged

Rename hvci_status to deviceguard_status to better reflect the data collected.#8390
directionless merged 3 commits intoosquery:masterfrom
jm2:master

Conversation

@jm2
Copy link
Copy Markdown
Contributor

@jm2 jm2 commented Jul 29, 2024

Also fix incorrect comparison causing status data to always return UNKNOWN.

…ollected.

Also fix incorrect comparison causing status data to always return UNKNOWN.
@jm2 jm2 requested review from a team as code owners July 29, 2024 19:10
data.GetLong("VirtualizationBasedSecurityStatus", vbs_status);
r["vbs_status"] =
vbs_methods.size() < vbs_status ? vbs_methods[vbs_status] : "UNKNOWN";
vbs_methods.size() > vbs_status ? vbs_methods[vbs_status] : "UNKNOWN";
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.

Is this logic change intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it is. Unfortunately the logic error appears to have been present since the initial commit of this module. The size of the vector should always be greater than the status value when the value is known. I have verified that the current release has broken behavior on these statuses as well.

Co-authored-by: Stefano Bonicatti <smjert@gmail.com>
@michael-myers michael-myers changed the title Rename hvci_status to deviceguard_status to better reflect the data collected. Rename hvci_status to deviceguard_status to better reflect the data collected. Jul 30, 2024
@jm2
Copy link
Copy Markdown
Contributor Author

jm2 commented Aug 1, 2024

Any further concerns with this PR?

@Smjert
Copy link
Copy Markdown
Member

Smjert commented Aug 1, 2024

Any further concerns with this PR?

Since this also changes the name of the table, I'll ask @directionless for thoughts.
Personally I would say that seems ok, but I would also have it alias the old name for a while, so older queries won't break.

You can see an example here: https://github.com/osquery/osquery/blob/master/specs/etc_hosts.table#L1

But if we want to do a hard cut I'm fine either way.

@jm2
Copy link
Copy Markdown
Contributor Author

jm2 commented Aug 1, 2024

Thanks for the tip; I've added the old name in as an alias for good measure.

@jm2
Copy link
Copy Markdown
Contributor Author

jm2 commented Aug 19, 2024

Any update/concerns here? I was hoping to get this merged a while back after the alias was added.

@directionless
Copy link
Copy Markdown
Member

Any further concerns with this PR?

Since this also changes the name of the table, I'll ask @directionless for thoughts. Personally I would say that seems ok, but I would also have it alias the old name for a while, so older queries won't break.

You can see an example here: https://github.com/osquery/osquery/blob/master/specs/etc_hosts.table#L1

But if we want to do a hard cut I'm fine either way.

I don't have opinions here -- If the old table had a logic bug, but I think no one using it would have succeeded, and I don't feel like a hard cut is terrible.

I'm not really up to date on this part of windows. So I'm deferring toi @Smjert here

@directionless directionless added this to the 5.14 milestone Aug 19, 2024
@jm2
Copy link
Copy Markdown
Contributor Author

jm2 commented Aug 20, 2024

I've made the change to include the alias for good measure, but to be clear as of right now this module is broken without the logic fix in this PR. The sooner we can get this merged the better. We originally added this table, so we'd likely be the primary user anyway, at least initially.

@jm2
Copy link
Copy Markdown
Contributor Author

jm2 commented Aug 21, 2024

@Smjert let me know if you need anything else from me here.

@directionless directionless merged commit efb9472 into osquery:master Sep 19, 2024
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.

3 participants