-
-
Notifications
You must be signed in to change notification settings - Fork 541
chore(devcontainer): consolidate and simplify dev/test/ci envs #3020
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
Draft
solnic
wants to merge
6
commits into
master
Choose a base branch
from
chore/devcontainer-no-compose
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+237
−218
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6b6feb0
chore(devcontainer): simpler setup w/o docker compose
solnic d2e4d7c
refactor(devcontainer): rename run to ci-run as now only CI needs it
solnic 651bded
chore(devcontainer): for e2e install playwright in headless only
solnic bf6b1be
refactor(devcontainer): drop dep on playwright
solnic afebf1f
chore(devcontainer): bump version
solnic 11ed496
chore(devcontainer): bump version
solnic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,20 @@ | ||
| # Devcontainer configuration | ||
| RUBY_VERSION="3.4.9" | ||
|
|
||
| RUBY_VERSION=3.4.9 | ||
|
|
||
| # E2E testing | ||
| SENTRY_DSN="http://user:pass@sentry.localhost/project/42" | ||
| # SENTRY_DSN_JS="http://user:pass@sentry-js.localhost/project/43" | ||
| SENTRY_DSN_JS="" | ||
| SENTRY_DSN=http://user:pass@sentry.localhost/project/42 | ||
| # SENTRY_DSN_JS=http://user:pass@sentry-js.localhost/project/43 | ||
| SENTRY_DSN_JS= | ||
|
|
||
| SENTRY_E2E_RAILS_APP_PORT=4000 | ||
| SENTRY_E2E_SVELTE_APP_PORT=4001 | ||
|
|
||
| SENTRY_E2E_RAILS_APP_URL="http://localhost:4000" | ||
| SENTRY_E2E_SVELTE_APP_URL="http://localhost:4001" | ||
| SENTRY_E2E_RAILS_APP_URL=http://localhost:4000 | ||
| SENTRY_E2E_SVELTE_APP_URL=http://localhost:4001 | ||
|
|
||
| # ActiveJob queue adapter under test: async | inline | sidekiq | resque | delayed_job | ||
| SENTRY_E2E_ACTIVE_JOB_ADAPTER="async" | ||
|
|
||
| # Redis for the sidekiq/resque adapters (the Compose service is named "redis") | ||
| REDIS_URL="redis://redis:6379" | ||
| SENTRY_E2E_ACTIVE_JOB_ADAPTER=async | ||
|
|
||
| # Faster builds with compose | ||
| COMPOSE_BAKE=true | ||
| # Redis for the sidekiq/resque adapters | ||
| REDIS_URL=redis://localhost:6379 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1.1.0 | ||
| 2.2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| readonly WORKSPACE=/workspaces/sentry-ruby | ||
|
|
||
| sudo chown -R sentry:sentry "$WORKSPACE" | ||
|
|
||
| cd "$WORKSPACE" | ||
| mise trust "$WORKSPACE" >/dev/null | ||
|
|
||
| exec "$@" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "name": "sentry-ruby toolchain", | ||
| "id": "tools", | ||
| "version": "1.0.0", | ||
| "description": "Installs Chromium, ChromeDriver, mise, and the sentry-ruby toolchain (Java, Ruby, Node).", | ||
| "installsAfter": [ | ||
| "ghcr.io/devcontainers/features/git", | ||
| "ghcr.io/devcontainers/features/github-cli", | ||
| "ghcr.io/nils-geistmann/devcontainers-features/zsh", | ||
| "ghcr.io/rocker-org/devcontainer-features/apt-packages" | ||
| ], | ||
| "options": { | ||
| "rubyVersion": { | ||
| "type": "string", | ||
| "default": "4.0", | ||
| "description": "Ruby version to pre-install (latest 4.0.x by default). Switching versions requires an image rebuild." | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Installs mise, the sentry-ruby toolchain, and Chromium with ChromeDriver. | ||
| # | ||
| set -euo pipefail | ||
|
|
||
| RUBY_VERSION="${RUBYVERSION:-latest}" | ||
| USERNAME="${_REMOTE_USER:-sentry}" | ||
| USER_HOME="${_REMOTE_USER_HOME:-/home/${USERNAME}}" | ||
|
|
||
| echo "📦 Installing Chromium and ChromeDriver..." | ||
| echo "deb http://deb.debian.org/debian sid main" > /etc/apt/sources.list.d/debian.list | ||
| wget -qO- https://ftp-master.debian.org/keys/archive-key-12.asc \ | ||
| | gpg --dearmor > /etc/apt/trusted.gpg.d/debian-archive-keyring.gpg | ||
| wget -qO- https://ftp-master.debian.org/keys/archive-key-12-security.asc \ | ||
| | gpg --dearmor > /etc/apt/trusted.gpg.d/debian-archive-security-keyring.gpg | ||
| for directory in bin lib lib32 lib64 libo32 libx32 sbin; do | ||
| dpkg-divert --package base-files --no-rename --remove "/${directory}" | ||
| done | ||
| apt-get update | ||
| apt-get install -y --no-install-recommends chromium chromium-driver | ||
| rm -rf /var/lib/apt/lists/* /var/cache/apt/* /etc/apt/sources.list.d/debian.list | ||
|
|
||
| # Install mise system-wide via the official installer. This downloads a prebuilt | ||
| # binary from mise's CDN rather than the GitHub API, avoiding the API rate | ||
| # limits the gh-release-based community feature hits on shared CI runners. | ||
| echo "📦 Installing mise..." | ||
| export MISE_INSTALL_PATH=/usr/local/bin/mise | ||
| curl https://mise.run | sh | ||
| MISE_BIN=/usr/local/bin/mise | ||
| "$MISE_BIN" --version | ||
|
|
||
| # Activate mise for the remote user's interactive shells. | ||
| echo "eval \"\$(${MISE_BIN} activate bash)\"" >> "${USER_HOME}/.bashrc" | ||
| echo "eval \"\$(${MISE_BIN} activate zsh)\"" >> "${USER_HOME}/.zshenv" | ||
| chown "${USERNAME}:${USERNAME}" "${USER_HOME}/.bashrc" "${USER_HOME}/.zshenv" | ||
|
|
||
| # Feature installers run as root, but the toolchain belongs to the remote user. | ||
| as_user() { | ||
| sudo -u "${USERNAME}" -H env "PATH=${USER_HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin" "$@" | ||
| } | ||
|
|
||
| echo "📦 Pre-installing toolchain..." | ||
| as_user env MISE_RUBY_COMPILE=0 "$MISE_BIN" install \ | ||
| "java@temurin-21" \ | ||
| "ruby@${RUBY_VERSION}" \ | ||
| "node@lts" | ||
|
|
||
| echo "✅ Toolchain pre-install completed!" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unpinned third-party devcontainer features run in privileged GHCR image-push build
The devcontainer build (
build_images.yml) runs remote third-party devcontainer features pinned only to:latest(no committed lockfile) while it holdspackages: writeand GHCR push credentials, so a rewritten upstream feature tag would execute arbitrary install scripts and poison the published base images consumed by e2e CI. Pin the features by digest or commitdevcontainer-lock.json.Evidence
.devcontainer/devcontainer.json(changed) declares third-party featuresghcr.io/nils-geistmann/devcontainers-features/zsh:latestandghcr.io/rocker-org/devcontainer-features/apt-packages:latestusing floating:latesttags, plus officialghcr.io/devcontainers/features/*:latest..gitignore(changed) ignores.devcontainer/devcontainer-lock.json, so no lockfile pins those feature payloads for CI.build_images.ymlbuilds viadevcontainers/ciwithpush: alwaysafterdocker/login-actionto GHCR usingsecrets.GITHUB_TOKEN, underpermissions: packages: write; feature install scripts run in that credentialed build.ghcr.io/getsentry/sentry-ruby-devcontainer-*images are pulled and executed bye2e_tests.yml, so a compromised floating feature tag would poison trusted CI base images.master/dispatch (not fork PRs), so impact is conditional — hence low severity.Identified by Warden security-review · GJD-MR6