-
Notifications
You must be signed in to change notification settings - Fork 0
fix(docker): remove insecure secret defaults and finish dependency bumps #69
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 from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,12 @@ | |
| ARG NEXT_PUBLIC_WEBSITE_PRIVACY_POLICY_URL | ||
| ARG CALCOM_TELEMETRY_DISABLED | ||
| ARG DATABASE_URL | ||
| ARG NEXTAUTH_SECRET=secret | ||
| ARG CALENDSO_ENCRYPTION_KEY=secret | ||
| # CR-08: no insecure "=secret" defaults — publicly-known values must never be baked into images. | ||
| # Build-time placeholders are supplied by CI (deploy-docker.yml) because next.config.ts requires | ||
| # these to be set during `next build`; real values must be provided at runtime (start.sh refuses | ||
| # to boot when they are unset or equal to the old default). | ||
| ARG NEXTAUTH_SECRET | ||
|
Check warning on line 15 in Dockerfile
|
||
| ARG CALENDSO_ENCRYPTION_KEY | ||
|
Check warning on line 16 in Dockerfile
|
||
| ARG MAX_OLD_SPACE_SIZE=6144 | ||
| ARG NEXT_PUBLIC_API_V2_URL | ||
| ARG CSP_POLICY | ||
|
|
@@ -21,10 +25,12 @@ | |
| ARG NEXT_PUBLIC_APP_NAME=Crove | ||
| ARG NEXT_PUBLIC_COMPANY_NAME="MetaDOS LLC" | ||
| ARG NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS=help@crove.com | ||
| ARG NEXT_PUBLIC_SENDER_ID=Crove | ||
| ARG NEXT_PUBLIC_SENDGRID_SENDER_NAME=Crove | ||
|
Comment on lines
+28
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Pass both sender values as Compose build arguments.
🤖 Prompt for AI Agents |
||
| ARG NEXT_PUBLIC_DOS_ID_LOGIN_ENABLED=true | ||
| ARG OIDC_CLIENT_ID=18790ccb-4d71-48cd-ad24-aee5f3ced3da | ||
|
|
||
| ENV NEXT_PUBLIC_WEBAPP_URL=http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER \ | ||
|
Check warning on line 33 in Dockerfile
|
||
| NEXT_PUBLIC_API_V2_URL=$NEXT_PUBLIC_API_V2_URL \ | ||
| NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ | ||
| NEXT_PUBLIC_WEBSITE_TERMS_URL=$NEXT_PUBLIC_WEBSITE_TERMS_URL \ | ||
|
|
@@ -33,6 +39,8 @@ | |
| NEXT_PUBLIC_APP_NAME=$NEXT_PUBLIC_APP_NAME \ | ||
| NEXT_PUBLIC_COMPANY_NAME=$NEXT_PUBLIC_COMPANY_NAME \ | ||
| NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS=$NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS \ | ||
| NEXT_PUBLIC_SENDER_ID=$NEXT_PUBLIC_SENDER_ID \ | ||
| NEXT_PUBLIC_SENDGRID_SENDER_NAME=$NEXT_PUBLIC_SENDGRID_SENDER_NAME \ | ||
| NEXT_PUBLIC_ENABLE_PROFILE_SWITCHER=$NEXT_PUBLIC_ENABLE_PROFILE_SWITCHER \ | ||
| OIDC_CLIENT_ID=$OIDC_CLIENT_ID \ | ||
| CALCOM_TELEMETRY_DISABLED=$CALCOM_TELEMETRY_DISABLED \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,19 +1,21 @@ | ||||||||||||||
| #!/bin/sh | ||||||||||||||
| set -x | ||||||||||||||
|
|
||||||||||||||
| # CR-08 startup guard: refuse to boot when secrets are missing or equal the old | ||||||||||||||
| # publicly-known insecure default "secret". Real values must come from the runtime | ||||||||||||||
| # environment (docker-compose env_file / docker run -e), never from the image. | ||||||||||||||
| if [ -z "$NEXTAUTH_SECRET" ] || [ "$NEXTAUTH_SECRET" = "secret" ]; then | ||||||||||||||
| echo "ERROR: NEXTAUTH_SECRET is unset or equals the insecure default 'secret'." | ||||||||||||||
| echo "Set a strong random value at runtime, e.g.: openssl rand -base64 32" | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
| if [ -z "$CALENDSO_ENCRYPTION_KEY" ] || [ "$CALENDSO_ENCRYPTION_KEY" = "secret" ]; then | ||||||||||||||
| echo "ERROR: CALENDSO_ENCRYPTION_KEY is unset or equals the insecure default 'secret'." | ||||||||||||||
| echo "Set a strong random value at runtime, e.g.: openssl rand -base64 32" | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
| # CR-08 startup guard: refuse to boot when a secret is missing or set to a publicly-known | ||||||||||||||
| # value. The build stage passes a placeholder because next.config.ts asserts these during | ||||||||||||||
| # `next build`; the runner stage does not carry them, so the real value must come from the | ||||||||||||||
| # runtime environment (docker-compose env_file / docker run -e). | ||||||||||||||
| reject_insecure_secret() { | ||||||||||||||
| case "$2" in | ||||||||||||||
| "" | "secret" | "build-time-placeholder-not-used-at-runtime") | ||||||||||||||
| echo "ERROR: $1 is unset or set to a publicly-known value." | ||||||||||||||
| echo "Set a strong random value at runtime, e.g.: openssl rand -base64 32" | ||||||||||||||
| exit 1 | ||||||||||||||
| ;; | ||||||||||||||
| esac | ||||||||||||||
| } | ||||||||||||||
| reject_insecure_secret NEXTAUTH_SECRET "$NEXTAUTH_SECRET" | ||||||||||||||
| reject_insecure_secret CALENDSO_ENCRYPTION_KEY "$CALENDSO_ENCRYPTION_KEY" | ||||||||||||||
|
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security Vulnerability: Sensitive Secrets Leaked in LogsSince To prevent this, temporarily disable shell tracing (
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| # Replace the statically built BUILT_NEXT_PUBLIC_WEBAPP_URL with run-time NEXT_PUBLIC_WEBAPP_URL | ||||||||||||||
| # NOTE: if these values are the same, this will be skipped. | ||||||||||||||
|
|
||||||||||||||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Forward the configured sender values into the Docker build.
The workflow omits
NEXT_PUBLIC_SENDER_IDandNEXT_PUBLIC_SENDGRID_SENDER_NAMEfrombuild-args.Dockerfiledefaults both arguments toCrovebeforenext build, andpackages/lib/constants.tsuses those build-time values forSENDER_IDandSENDER_NAME. Add the configured values to this workflow block so the built image preserves the deployment sender identity.🤖 Prompt for AI Agents