Skip to content

Commit 21ddcec

Browse files
authored
fix: fix burp tests and add $BURP_HOME (#32)
* fix: fix burp tests and add `$BURP_HOME` * chore: "Burp" -> "Burp Suite"
1 parent 11c01dc commit 21ddcec

File tree

6 files changed

+19
-20
lines changed

6 files changed

+19
-20
lines changed

Diff for: .github/workflows/test.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
matrix:
1515
features:
1616
- android-sdk
17+
- burp-suite
1718
- coder
1819
- cutter
1920
- ghidra
@@ -39,8 +40,9 @@ jobs:
3940
matrix:
4041
features:
4142
- android-sdk
42-
- coder
4343
- burp-suite
44+
- coder
45+
- coder
4446
- cutter
4547
- ghidra
4648
- lib-common

Diff for: src/burp-suite/devcontainer-feature.json

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
}
2727
},
2828

29+
"containerEnv": {
30+
"BURP_HOME": "/opt/burp-suite",
31+
"PATH": "${PATH}:${BURP_HOME}"
32+
},
33+
2934
"installsAfter": [
3035
"ghcr.io/devcontainers/features/common-utils",
3136
"ghcr.io/devcontainers/features/desktop-lite"

Diff for: src/burp-suite/install.sh

+8-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ echo "Activating feature '$FEATURE_NAME'"
88
# Source lib-common feature
99
source "/usr/share/phorcys-devcontainer-libraries/common/1/main.sh"
1010

11-
# Check for dependencies
12-
checkPackages curl ca-certificates jq sudo
11+
# 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)
12+
checkPackages curl ca-certificates jq sudo libfreetype6
1313

1414
# Load options
1515
EDITION=${EDITION:-community}
1616
VERSION=${VERSION:-latest}
1717

18+
# CUTTER_HOME is defined in the containerEnv value of the feature's manifest
19+
BURP_HOME=${BURP_HOME:-/opt/burp-suite}
20+
1821
if [ $VERSION = "latest" ]; then
19-
echo "[$FEATURE_NAME] [+] Grabbing the latest Burp version"
22+
echo "[$FEATURE_NAME] [+] Grabbing the latest Burp Suite version"
2023

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

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

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

4548
rm -rf "$TMP"

Diff for: test/burp-suite/desktop.sh

-3
This file was deleted.

Diff for: test/burp-suite/scenarios.json

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
{
2-
"desktop": {
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4-
"features": {
5-
"ghcr.io/devcontainers/features/desktop-lite:1": {},
6-
7-
"burp-suite": {}
8-
}
9-
}
10-
}
1+
{}

Diff for: test/burp-suite/test.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set -euo pipefail
55
# Optional: Import test library bundled with the devcontainer CLI
66
source dev-container-features-test-lib
77

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

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

0 commit comments

Comments
 (0)