updates and fixes

This commit is contained in:
Greg DiCristofaro 2022-10-17 11:51:56 -04:00
parent 4b9cdf60db
commit d8c49530a5
4 changed files with 76 additions and 24 deletions

63
homebrew/autopsy.rb Normal file
View File

@ -0,0 +1,63 @@
# Documentation: https://docs.brew.sh/Formula-Cookbook
# https://rubydoc.brew.sh/Formula
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Autopsy < Formula
desc "Autopsy® is a digital forensics platform and graphical interface to The Sleuth Kit® and other digital forensics tools. It can be used by law enforcement, military, and corporate examiners to investigate what happened on a computer. You can even use it to recover photos from your camera's memory card. "
homepage "http://www.sleuthkit.org/autopsy/"
url "https://github.com/sleuthkit/autopsy/archive/refs/tags/autopsy-4.19.3.tar.gz"
# sha256 "67299005603af0cadc98c420ce5088187010b71eabcbb6db7a4e5bce325734c5"
license "Apache-2.0"
depends_on "postgresql@14"
depends_on "testdisk"
depends_on "sleuthkit"
depends_on "ant" => :build
def install
ENV.deparallelize
# ----- GET ADDITIONAL DEPENDENCIES -----
# TODO may be a better way to handle this
system "brew", "tap", "bell-sw/liberica"
system "brew", "install", "--cask", "liberica-jdk8-full"
# TODO may be a better way to handle this
gstreamer_tmp_path = "#{prefix}/gstreamer-1.0-1.20.3-universal.pkg"
gstreamer_bin_path = File.join(prefix, "gstreamer", "bin")
system "curl", "-k", "-o", gstreamer_tmp_path, "https://gstreamer.freedesktop.org/data/pkg/osx/1.20.3/gstreamer-1.0-1.20.3-universal.pkg"
system "mkdir", "-p", gstreamer_bin_path
system "installer", "-pkg", gstreamer_tmp_path, "-target", gstreamer_bin_path
system "rm", gstreamer_tmp_path
# ----- BUILD ZIP -----
autopsy_src_path = `pwd`
java_path = `/usr/libexec/java_home -v 1.8`
netbeans_plat_ver = `grep "netbeans-plat-version=" "$AUTOPSY_SRC_PATH/nbproject/platform.properties" | cut -d'=' -f2`
autopsy_platform_path = File.join(autopsy_src_path, "netbeans-plat", netbeans_plat_ver)
autopsy_harness_path = File.join(autopsy_platform_path, "harness")
ENV["JAVA_HOME"] = java_path
ENV["TSK_HOME"]= `brew --prefix sleuthkit`
system "ant", "-Dnbplatform.active.dir=\"#{autopsy_platform_path}\"", "-Dnbplatform.default.harness.dir=\"#{autopsy_harness_path}\"", "build", "build-zip"
# ----- SETUP EXTRACT DIRECTORY -----
autopsy_zip = `find #{autopsy_src_path}/dist -maxdepth 1 -name "autopsy-*.*.*.zip"`
system "unzip", autopsy_zip, "-d", File.join(autopsy_src_path, "dist")
autopsy_install_dir = `find #{File.join(autopsy_src_path, "dist")} -maxdepth 1 -type d -name "autopsy-*.*.*"`
# ----- RUN UNIX SETUP SCRIPT -----
unix_setup_script = File.join(autopsy_install_dir, "unix_setup.sh")
system "chmod", "u+x", unix_setup_script
base_sleuthkit_path = `brew --prefix sleuthkit`
ENV["TSK_JAVA_LIB_PATH"] = File.join(base_sleuthkit_path, "share", "java")
system "bash", "-c", "cd \"#{autopsy_install_dir}\" && ./unix_setup.sh -j \"#{java_path}\""
# TODO do we need to symlink binary?
# TODO do we need env variables before execution?
end
test do
system "#{bin}/autopsy", "--help"
end
end

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -1,2 +0,0 @@
Exec=autopsy
Icon=${SNAP}/meta/gui/autopsy.png

View File

@ -7,6 +7,8 @@ grade: stable # must be 'stable' to release into candidate/stable channels
# TODO look into turning back to strict for store inclusion # TODO look into turning back to strict for store inclusion
confinement: classic # use 'strict' once you have the right plugs and slots confinement: classic # use 'strict' once you have the right plugs and slots
architectures: [amd64, arm64] architectures: [amd64, arm64]
# improves startup performance
compression: lzo
# Java package repo to use with snapcraft # Java package repo to use with snapcraft
package-repositories: package-repositories:
@ -24,15 +26,8 @@ layout:
symlink: $SNAP/usr/bin/photorec symlink: $SNAP/usr/bin/photorec
/usr/local/bin: /usr/local/bin:
bind: $SNAP/usr/local/bin bind: $SNAP/usr/local/bin
# /usr/local/lib:
# bind: $SNAP/usr/local/lib
# $HOME/.autopsy:
# bind: $HOME/$SNAP/.autopsy
plugs: plugs:
# personal-files-autopsy:
# interface: personal-files
# read: [$HOME/.autopsy]
system-files-autopsy: system-files-autopsy:
interface: system-files interface: system-files
read: [/dev] read: [/dev]
@ -54,9 +49,7 @@ apps:
- avahi-observe - avahi-observe
- block-devices - block-devices
- cifs-mount - cifs-mount
# - custom-device
- daemon-notify - daemon-notify
# - dbus
- desktop - desktop
- desktop-launch - desktop-launch
- desktop-legacy - desktop-legacy
@ -66,25 +59,18 @@ apps:
- hardware-observe - hardware-observe
- home - home
- kernel-crypto-api - kernel-crypto-api
#- locale-control
- log-observe - log-observe
#- mount-control
- mount-observe - mount-observe
- network - network
# - network-bind - network-manager
# - network-manager
- network-observe - network-observe
- network-setup-observe - network-setup-observe
- network-status - network-status
# - online-accounts-service
- opengl - opengl
- optical-drive - optical-drive
# - personal-files-autopsy
# - posix-mq
- pulseaudio - pulseaudio
- raw-input - raw-input
- raw-usb - raw-usb
# - raw-volume
- removable-media - removable-media
- sd-control - sd-control
- system-files-autopsy - system-files-autopsy
@ -187,11 +173,16 @@ parts:
chmod +x $UNIX_SETUP_SCRIPT chmod +x $UNIX_SETUP_SCRIPT
$UNIX_SETUP_SCRIPT $UNIX_SETUP_SCRIPT
chmod 755 "$AUTOPSY_LOCATION/bin/autopsy" chmod 755 "$AUTOPSY_LOCATION/bin/autopsy"
# TODO is this necessary?
find "$AUTOPSY_LOCATION/autopsy/markmckinnon" -name "Export*" -o -name "parse*" | xargs -I{} chmod a+x {} # ----- INSTALL DESKTOP SHORTCUT -----
# TODO is this necessary? AUTOPSY_DESKTOP_PATH="$SNAPCRAFT_PART_INSTALL/usr/share/applications/"
chmod -R a+x "$AUTOPSY_LOCATION/autopsy/solr/bin" mkdir -p $AUTOPSY_DESKTOP_PATH
sed -i 's|Icon=autopsy|Icon=${SNAP}/usr/share/pixmaps/autopsy.png|g' ${AUTOPSY_DESKTOP_PATH}/autopsy.desktop
sed -i 's|Exec=${SNAP}/autopsy/bin/autopsy|Exec=autopsy|g' ${AUTOPSY_DESKTOP_PATH}/autopsy.desktop
AUTOPSY_ICON_BASE_PATH="usr/share/pixmaps/"
mkdir -p "$SNAPCRAFT_PART_INSTALL/$AUTOPSY_ICON_BASE_PATH"
cp ./snap/autopsy.png "$SNAPCRAFT_PART_INSTALL/$AUTOPSY_ICON_BASE_PATH"
# include this line to print all set variables # include this line to print all set variables
# TODO remove after debugging # TODO remove after debugging
sed -i '129 i set -o posix ; echo $(set) >&2' "$AUTOPSY_LOCATION/platform/lib/nbexec" sed -i '129 i set -o posix ; echo $(set) >&2 ; ls -l "${jdkhome}/bin/java"' "$AUTOPSY_LOCATION/platform/lib/nbexec"