Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

zwass
Copy link
Member

@zwass zwass commented Jul 29, 2025

This is implemented following the example of rpm_package_files. Not all of the columns from that table are available due to what is provided in the package list file.

@zwass zwass requested review from a team as code owners July 29, 2025 16:47
@zwass zwass changed the title Deb package files attempt Add virtual table deb_package_files Jul 29, 2025
Copilot

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@directionless directionless left a comment

Choose a reason for hiding this comment

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

Couple of small questions/nits. I think none required. I would approve if pressed.

}
auto package_list = package_list_exp.take();
for (const auto& package : package_list) {
if (has_package_constraint && allowed_packages.count(package.name) == 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Why have has_package_constraint at all?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I guess to differentiate between IN () and unspecified. Okay.

Might be worth a comment

Copy link
Member Author

Choose a reason for hiding this comment

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

I refactored to eliminate this (and hopefully improve performance)

if (!status.ok()) {
continue;
}
std::istringstream iss(file_content);
Copy link
Member

Choose a reason for hiding this comment

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

This feels weird... I think this reads the contents in (with the osquery imposed max size) and then converts it to a stream. I wonder if we should make a osquery::streamFile helper. Anyhow, I'm not sure we need to change anything in this PR, but it smells fishy

Copy link
Member Author

@zwass zwass Jul 30, 2025

Choose a reason for hiding this comment

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

Yeah, the reason the stringstream is created is because this is one of the clearer ways to split text up by lines (using std::getline).

osquery::streamFile could be nice for such purposes.

@zwass zwass requested a review from Copilot July 31, 2025 00:07
Copilot

This comment was marked as outdated.

@zwass zwass requested a review from Copilot August 5, 2025 18:15
Copilot

This comment was marked as outdated.

@zwass zwass requested a review from Copilot August 5, 2025 18:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new virtual table deb_package_files that provides information about files contained within installed DEB packages on Linux systems. It follows the same pattern as the existing rpm_package_files table.

  • Implements a new table to list files from DEB packages with package name, file path, and admin directory
  • Adds corresponding test coverage and table specification
  • Integrates the new table into the build system

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/integration/tables/deb_package_files.cpp Adds integration test for the new table
tests/integration/tables/CMakeLists.txt Includes the new test file in the build
specs/linux/deb_package_files.table Defines the table schema and implementation
specs/CMakeLists.txt Registers the table spec for Linux builds
osquery/tables/system/linux/deb_packages.cpp Implements the genDebPackageFiles function
Comments suppressed due to low confidence (1)

osquery/tables/system/linux/deb_packages.cpp:66

  • This line appears to be an unintended diff artifact showing removal of an empty line. This should be cleaned up.
  } else {

@zwass zwass requested a review from directionless August 6, 2025 02:36
Copy link
Contributor

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM.

Left a couple of comments and questions.

specs/linux/deb_package_files.table Outdated Show resolved Hide resolved
osquery/tables/system/linux/deb_packages.cpp Outdated Show resolved Hide resolved
osquery/tables/system/linux/deb_packages.cpp Show resolved Hide resolved
osquery/tables/system/linux/deb_packages.cpp Outdated Show resolved Hide resolved
@zwass zwass merged commit 09d02a6 into osquery:master Aug 13, 2025
22 checks passed
@zwass zwass changed the title Add virtual table deb_package_files Add table deb_package_files Aug 13, 2025
@zwass zwass deleted the deb-package-files-attempt branch August 13, 2025 20:04
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.