Skip to content

Commit

Permalink
Add OS Version to Knowledge Base
Browse files Browse the repository at this point in the history
A semantic version should be used for checking the condition of
the client's operating system rather than evaluating the OS major
AND minor version independently.

See: ForensicArtifacts/artifacts/issues/274
  • Loading branch information
coperni committed Jul 2, 2022
1 parent a16be8f commit fc50a7e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grr/proto/grr_response_proto/knowledge_base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ message KnowledgeBase {
description: "Linux distribution name.",
}];

optional string os_version = 10 [(sem_type) = {
description: "Semantic version definition of OS major and minor version.",
}];

//
// Windows specific system level parameters.
//
Expand Down
2 changes: 2 additions & 0 deletions grr/server/grr_response_server/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ def GetKnowledgeBase(rdf_client_obj, allow_uninitialized=False):
kb = rdf_client_obj.knowledge_base
try:
kb.os_major_version = int(version[0])
kb.os_version = str(version[0])
if len(version) > 1:
kb.os_minor_version = int(version[1])
kb.os_version = "%s.%s" % (version[0], version[1])
except ValueError:
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16316,6 +16316,7 @@
"os_major_version",
"os_minor_version",
"os_release",
"os_version",
"time_zone",
"users.appdata",
"users.cookies",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4972,6 +4972,7 @@
"os_major_version",
"os_minor_version",
"os_release",
"os_version",
"time_zone",
"users.appdata",
"users.cookies",
Expand Down

0 comments on commit fc50a7e

Please sign in to comment.