Documentation
¶
Overview ¶
Package archive opens the containers that trust stores hide in, so the certificates packed inside them are scanned too: zip-family archives (jar, war, ear, whl, apk, zip), tar, cpio and ar archives, gzip, zstd, xz and bzip2 streams, Debian and RPM packages, and PyInstaller one-file executables.
Members are reported as "outer!/inner", nested as deep as MaxDepth. Decompressed content keeps its file's name, so a tarball's members appear as "app.tar.zst!/member". Expansion is bounded per member and per top-level file while reading, never by trusting a declared size, so a hostile archive cannot exhaust memory. Anything not opened, because of a limit or because it could not be parsed, is reported as skipped, never silently ignored.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLimits = Limits{MaxDepth: 4, MaxMemberSize: 256 << 20, MaxArchiveSize: 1 << 30}
DefaultLimits are generous for real software and small enough for a laptop or a CI runner. Peak memory for one file stays near MaxArchiveSize plus one member being read.
Functions ¶
func IsExecutable ¶
IsExecutable reports whether b starts like an ELF, Mach-O or PE file. It lives apart from executable.go so that file stays a verbatim copy of emudhra-scan's.