osquery / osquery/osquery

Improve structure of package-data and document

Open
#7,275 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blueprint documentation packaging
Dominant language
C++
Stars
23.6k
Forks
2.6k
Avg merge
6d 7h
Merged PRs (30d)
14

Description

Our current implementation of packaging and code signing works, but there is some tech debt that adds complexity. And I think, creates confusion . These are some notes about how to clean it up. (It's extracted from a private conversation in https://github.com/osquery/osquery-codesign/pull/28 and slack)

At a high level, our process is along the lines of:

  1. osquery build produces binaries and packaging control data. This is distributed as package-data
  2. codesign build signs binaries, and app bundles
  3. codesign build uses the packaging scripts to package into various distribution formats
  4. codesign build signs packages

But, I think the structure of package-data is confusing. For example, in macOS, package data contains both package_data/opt/osquery/osquery.app and package_data/opt/osquery/bin/osqueryd, this is because we want to sign and distribute both of those. However, they should never both appear in a package, and encoding them into the opt path there implies that's distributable, which is wrong.

I think that either package-data should match the final package structure, or it should be an arbitrary internal structure. When it mostly matches the final package I think it's very easy for us to make mistakes.

Thus, I propose package-data become more arbitrary. It should not contain the install directory path. I think it's okay to be messy -- it's an internal API between our build stages.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the package_data/opt/osquery/osquery.app and package_data/opt/osquery/bin/osqueryd paths alongside the packaging scripts described in the issue. Compare the current package-data layout with the four-stage build and signing process; done means the internal structure no longer implies an install path and its intended use is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
build-system, release, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.