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

Allow replacing build IDs with digests #294

Merged
merged 11 commits into from
Jan 6, 2025
Merged

Allow replacing build IDs with digests #294

merged 11 commits into from
Jan 6, 2025

Conversation

dmartin
Copy link
Contributor

@dmartin dmartin commented Jan 6, 2025

Adds a new optional command-line flag, -s / --salt, which takes a string value.
When specified, numeric build IDs in artifact download URLs (and the on-disk cache) are replaced by the hexadecimal SHA-256 digest of {build_id}:{salt}.

For example, instead of:

http://localhost:4201/1/file.txt
http://localhost:4201/2/file.txt

you might have:

http://localhost:4201/6dc430e5b8a7a1c59589d48d6cd84e5b11ae6cbf0b0733164b5acc59a21a2734/file.txt
http://localhost:4201/51bc37a442bc79a1018d3097c5e1c2c6fd7efde9c8ea611c671f4833961ebb61/file.txt

This prevents players from enumerating artifact download URLs across builds of a challenge.

Note that clients must also apply this same transformation if generating URLs based on build IDs.

@dmartin dmartin merged commit 2625fe6 into main Jan 6, 2025
1 check passed
@dmartin dmartin deleted the digests branch January 6, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant