google_chrome_profiles: add path column #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is currently no column that can be used to link rows returned by the google_chrome_profiles table with the rows returned by the OSQuery built-in chrome_extensions table. This is useful for determining the email, and therefore the Google Account, associated with the profile the extension is installed in, which can be used as a proxy for whether the extension was installed in a work or non-work profile.
This PR adds a path column to the google_chrome_profiles table. This is the path to the profile's directory, and should match profile_path column in the chrome_extensions table, allowing these two tables to be joined together. It does this by pulling out the profile's directory name from the same dictionary used to get the existing data, combines it with the Chrome user data directory path, and finally checks that it exists before returning it. It is possible for this column to be empty, if for whatever reason, the computed path does not exist.