Skip to content

Adding system certs support for Mac and Linux - #2364

Merged
cesarfda merged 7 commits into
mainfrom
system_certs
Jul 21, 2025
Merged

Adding system certs support for Mac and Linux#2364
cesarfda merged 7 commits into
mainfrom
system_certs

Conversation

@cesarfda

Copy link
Copy Markdown
Contributor

This pull request refactors the InstallCaCerts function in pkg/osquery/install_ca_certs.go to prioritize using system CA certificates over the embedded bundle, improving flexibility and compatibility across different operating systems. It also introduces a helper function, getSystemCaCertPath, to determine the appropriate system CA certificate path based on the operating system.

Refactoring of InstallCaCerts function:

  • Updated InstallCaCerts to prefer system CA certificates over the embedded bundle, improving compatibility with native environments. If system certificates are not available, it falls back to installing the embedded bundle.
  • Simplified error handling and removed redundant logic for writing the embedded CA bundle to disk.

Addition of getSystemCaCertPath helper function:

  • Added getSystemCaCertPath to determine the system CA certificate path based on the operating system (runtime.GOOS). It supports Linux and macOS with predefined paths and returns an error for unsupported operating systems.

@cesarfda
cesarfda requested a review from RebeccaMahany July 16, 2025 19:52
@cesarfda cesarfda changed the title Addind system certs support for Mac and Linux Adding system certs support for Mac and Linux Jul 16, 2025
@cesarfda cesarfda linked an issue Jul 16, 2025 that may be closed by this pull request
@cesarfda cesarfda linked an issue Jul 16, 2025 that may be closed by this pull request
RebeccaMahany
RebeccaMahany previously approved these changes Jul 17, 2025
@cesarfda
cesarfda enabled auto-merge July 21, 2025 18:49
@cesarfda
cesarfda added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit c278f5f Jul 21, 2025
36 checks passed
@cesarfda
cesarfda deleted the system_certs branch July 21, 2025 19:11
@RebeccaMahany RebeccaMahany added the features-improvements Features and Improvements label Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

features-improvements Features and Improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use system certs for osquery tls_server_certs Launcher does not launch with tls certs outside of interactive mode

4 participants