Skip to content
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

fix: fix burp tests and add $BURP_HOME #32

Merged
merged 3 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
matrix:
features:
- android-sdk
- burp-suite
- coder
- cutter
- ghidra
Expand All @@ -39,8 +40,9 @@ jobs:
matrix:
features:
- android-sdk
- coder
- burp-suite
- coder
- coder
- cutter
- ghidra
- lib-common
Expand Down
5 changes: 5 additions & 0 deletions src/burp-suite/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
}
},

"containerEnv": {
"BURP_HOME": "/opt/burp-suite",
"PATH": "${PATH}:${BURP_HOME}"
},

"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/desktop-lite"
Expand Down
13 changes: 8 additions & 5 deletions src/burp-suite/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ echo "Activating feature '$FEATURE_NAME'"
# Source lib-common feature
source "/usr/share/phorcys-devcontainer-libraries/common/1/main.sh"

# Check for dependencies
checkPackages curl ca-certificates jq sudo
# Check for dependencies (libfreetype6 is only really needed to run in CI, otherwise you would always have this library if you have the desktop-lite feature)
checkPackages curl ca-certificates jq sudo libfreetype6

# Load options
EDITION=${EDITION:-community}
VERSION=${VERSION:-latest}

# CUTTER_HOME is defined in the containerEnv value of the feature's manifest
BURP_HOME=${BURP_HOME:-/opt/burp-suite}

if [ $VERSION = "latest" ]; then
echo "[$FEATURE_NAME] [+] Grabbing the latest Burp version"
echo "[$FEATURE_NAME] [+] Grabbing the latest Burp Suite version"

RELEASE_DATA=$(curl 'https://portswigger.net/burp/releases/data?previousLastId=-1&lastId=-1&pageSize=5' --silent --show-error --fail)

Expand All @@ -39,7 +42,7 @@ curl --get --location --silent --show-error --fail \
# Make temporary directory accessible to all users
chmod +rx "$TMP" -R

echo "[$FEATURE_NAME] [+] Installing Burp $EDITION"
sudo -u "$_REMOTE_USER" "$DESTINATION_FILE" -q # $_REMOTE_USER_HOME
echo "[$FEATURE_NAME] [+] Installing Burp Suite $EDITION edition"
"$DESTINATION_FILE" -q -dir "$BURP_HOME" -overwrite

rm -rf "$TMP"
3 changes: 0 additions & 3 deletions test/burp-suite/desktop.sh

This file was deleted.

11 changes: 1 addition & 10 deletions test/burp-suite/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{
"desktop": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {},

"burp-suite": {}
}
}
}
{}
3 changes: 2 additions & 1 deletion test/burp-suite/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -euo pipefail
# Optional: Import test library bundled with the devcontainer CLI
source dev-container-features-test-lib

# Do nothing
check "Burp folder exists" test -d "$BURP_HOME"
check "Burp binary is in the PATH" which BurpSuiteCommunity

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
Loading