Repository navigation
osquery: Post the file carving archive event again - #1804
Merged
Merged
Conversation
Coverage Report for CI Build 44405685875Coverage increased (+0.03%) to 91.643%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
np5
force-pushed
the
osquery-file-carving-archive-url
branch
2 times, most recently
from
November 18, 2026 21:37
e3af6ac to
4760b03
Compare
The archive task read the archive URL from FileCarvingSession.get_archive_url, which the Osquery app overhaul (b24befc) removed. The task raised an AttributeError after it saved the archive, and the osquery_file_carving event with the archive action was never posted. The method is back, with the absolute URL of the console download view, built with api_base_url() like the other absolute URLs. The task still posts the event with no user agent and no IP address, so the event has no request. The sessions archived before the fix get no event: the task returns early when the archive exists. The task also deletes its temporary file when it cannot read a block or save the archive. The tests delete the block and archive files they write to the shared storage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
np5
force-pushed
the
osquery-file-carving-archive-url
branch
from
November 18, 2026 21:50
4760b03 to
6098292
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
build_file_carving_session_archivesaves the archive of an Osquery file carving session, then posts anosquery_file_carvingevent with thearchiveaction. It read the archive URL fromFileCarvingSession.get_archive_url(), which the Osquery app overhaul (b24befc, 2021) removed. The task raised anAttributeErrorafter it saved the archive, and the event was never posted.Change
FileCarvingSession.get_archive_url()is back. It gives the absolute URL of the console download view,osquery:download_file_carving_session_archive, built withapi_base_url(), like the other absolute URLs (MetaMachine.get_url, the Osquery enrollment download URLs). Before the overhaul, it usedsettings["api"]["tls_hostname"], the deprecated form of the same base URL.None, Noneas the user agent and the IP address: there is no request, so the event has nometadata.request.Not changed
api.fqdn. An agent cannot send a carve without this setting: the Osquery flags (tls_hostnameinConfiguration.get_all_flags) and the enrollment packages read it with no fallback.Tests
In
tests/osquery/test_tasks.py:action, name, size, URL) and that the serialized metadata has norequest. It fails onmainwith theAttributeError.api_base_url(), so the test also checks the route name.Checks
🤖 Generated with Claude Code