New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve original path for archives; add to output #180
Conversation
I can work on appending the file name to the original path. Edit: Added in |
Improved the diff output in
Edit: even better output added in Moved: ../../../../../var/folders/3g/88131l9j11x995ppjbxsvhbh0000gn/T/apko_0.13.2_darwin_amd64.tar.gz2494270430/apko_0.13.2_darwin_amd64/apko -> ../../../../../var/folders/3g/88131l9j11x995ppjbxsvhbh0000gn/T/apko_0.13.2_darwin_arm64.tar.gz2377260856/apko_0.13.2_darwin_arm64/apko (similarity: 0.95)Original Path (From): /Users/egibs/Downloads/apko_tar_gzs/apko_0.13.2_darwin_amd64.tar.gz > apkoOriginal Path (To): /Users/egibs/Downloads/apko_tar_gzs_2/apko_0.13.2_darwin_arm64.tar.gz > apko3 new behaviors
|
pkg/bincapz/bincapz.go
Outdated
Path string | ||
SHA256 string | ||
Path string | ||
AlternatePath string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more specific name we can use there?
It isn't readily apparent to readers here what the difference between Path and AlternativePath is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in bf5a1eb
(#180).
@@ -1,4 +1,4 @@ | |||
## Windows/2024.Sharp/sharpil_RAT.exe [🚨 CRITICAL] | |||
## Scanned Path: Windows/2024.Sharp/sharpil_RAT.exe [🚨 CRITICAL] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we go back to the original output here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in bf5a1eb
(#180).
…uard-dev#169) * improve heartbeat detection * Update testdata, include 3rd party rules * shorter ref link
* Make --ignore-self more precise * update flag description
bde3ff2
to
3e5926c
Compare
|
||
// The original path for scanned archive files | ||
// When not scanning archives, this will be empty | ||
OriginalAbsPath string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add json:",omitempty" yaml:",omitempty"
so that the empty field doesn't show up in JSON output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unclear on the relationship between Path
and OriginalAbsPath
. If Path
is the original path requested by the user, is this just the absolute version of it?
On a related note - we should make sure that we're not storing any temporary file paths within the struct, as they aren't useful to the reader, as that file location no longer exists when they read the report.
We should however store the relative location within an archive somewhere so that they can investigate further.
I'm going to sit on this and ideate a bit more. |
Closes: #178
When scanning archives, we only showed the temporary directory used to hold and extract the archive. This PR preserves the originally-provided path and displays it when scanning archives.
This change applies to both normal scans as well as diffs (output provided in the comments below).
Examples --
Terminal:
Markdown (screenshot of the headers for brevity):