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

Changes for migration TUF QA #25468

Merged
merged 1 commit into from
Jan 15, 2025
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
33 changes: 13 additions & 20 deletions tools/tuf/test/migration/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
# `migration_test.sh`

This script is used to test the migration from one local TUF repository to a new local TUF repository (with new roots).
The "old" TUF will be hosted on port 8081, and the new TUF will be hosted on port 8082.

> Currently supports running on macOS only.

The script is interactive and assumes the user will use a Windows and Ubuntu VM to install fleetd and test the changes on those platforms too.

Usage:
- `FLEET_URL`: The Fleet server will be hosted on https://localhost:8080, tunneled via ngrok to e.g. https://s123ssfsdgsdf.ngrok.app.
- `OLD_TUF_URL`: The "old" TUF will be hosted on http://localhost:8081, tunneled via ngrok to e.g. https://121e9b4a4dab.ngrok.app.
- `NEW_TUF_URL`: The "new" TUF will be hosted on http://localhost:8082, tunneled via ngrok to e.g. https://12oe8b5b3cc6.ngrok.app.
- `SIMULATE_NEW_TUF_OUTAGE=1`: Simulates an outage of the new TUF server during the migration.
- `ORBIT_PATCH_IN_OLD_TUF=1`: Simulates an outage of the new TUF server during the migration and a "need" to patch orbit on the old repository.
- `WINDOWS_HOST_HOSTNAME`: Hostname of the Windows VM to install fleetd (as reported by osquery/Fleet).
- `LINUX_HOST_HOSTNAME`: Hostname of the Ubuntu VM to install fleetd (as reported by osquery/Fleet).
- `NO_TEAM_ENROLL_SECRET`: Enroll secret of "No team" on your Fleet instance.
```sh
FLEET_URL=https://host.docker.internal:8080 \
FLEET_URL=https://s123ssfsdgsdf.ngrok.app \
OLD_TUF_URL=https://121e9b4a4dab.ngrok.app \
NEW_TUF_URL=https://12oe8b5b3cc6.ngrok.app \
NO_TEAM_ENROLL_SECRET=... \
WINDOWS_HOST_HOSTNAME=DESKTOP-USFLJ3H \
LINUX_HOST_HOSTNAME=foobar-ubuntu \
./tools/tuf/test/migration/migration_test.sh
```

To test TUFs with HTTPS instead of HTTP with two ngrok tunnels that connect to 8081/8082:
```sh
OLD_TUF_URL=https://121e9b4a4dab.ngrok.app \
NEW_TUF_URL=https://12oe8b5b3cc6.ngrok.app \
```

To simulate an outage of the new TUF server during the migration run the above with:
```sh
SIMULATE_NEW_TUF_OUTAGE=1 \
```

To simulate an outage of the new TUF server during the migration and a "need" to patch orbit on the old repository:
```sh
SIMULATE_NEW_TUF_OUTAGE=1 \
ORBIT_PATCH_IN_OLD_TUF=1 \
```
./tools/tuf/test/migration/migration_test.sh
```
3 changes: 0 additions & 3 deletions tools/tuf/test/migration/migration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ for pkgType in "${pkgTypes[@]}"; do
--fleet-desktop \
--fleet-url="$FLEET_URL" \
--enroll-secret="$NO_TEAM_ENROLL_SECRET" \
--fleet-certificate=./tools/osquery/fleet.crt \
--debug \
--update-roots="$ROOT_KEYS1" \
--update-url=$OLD_TUF_URL \
Expand Down Expand Up @@ -434,7 +433,6 @@ for pkgType in "${pkgTypes[@]}"; do
--fleet-desktop \
--fleet-url="$FLEET_URL" \
--enroll-secret="$NO_TEAM_ENROLL_SECRET" \
--fleet-certificate=./tools/osquery/fleet.crt \
--debug \
--update-roots="$ROOT_KEYS1" \
--update-url=$OLD_TUF_URL \
Expand Down Expand Up @@ -545,7 +543,6 @@ for pkgType in "${pkgTypes[@]}"; do
--fleet-desktop \
--fleet-url="$FLEET_URL" \
--enroll-secret="$NO_TEAM_ENROLL_SECRET" \
--fleet-certificate=./tools/osquery/fleet.crt \
--debug \
--disable-open-folder \
--disable-keystore \
Expand Down
Loading