-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Update deployment configuration and production settings for Cloud Run #44
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 |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| "DefaultConnection": "Host=69.164.244.36;Database=law_chatbot;Username=postgres;Password=Admin@123;Port=5555" | ||
|
Contributor
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. 🧩 Analysis chainCRITICAL: Plaintext credentials exposed in production configuration file. The database connection string (line 9) and SMTP credentials (lines 20-21) are hardcoded in plaintext. This violates security best practices and compliance standards (PII/secrets leakage).
These sensitive values must never be stored in version control. Combined with the deployment workflow changes that no longer inject secrets via environment variables, this creates a significant security and compliance risk. Please verify:
Consider reverting the deployment workflow to inject Also applies to: 20-21 I'll verify the security concerns raised in this review comment by examining the codebase for the relevant configuration, deployment, and secret management mechanisms. 🏁 Script executed: #!/bin/bash
# Check .gitignore for appsettings file patterns
echo "=== Checking .gitignore for appsettings patterns ==="
if [ -f .gitignore ]; then
cat .gitignore | grep -E "(appsettings|\.json)" || echo "No appsettings patterns found in .gitignore"
else
echo ".gitignore not found"
fi
echo -e "\n=== Searching for .gitignore files in subdirectories ==="
find . -name ".gitignore" -type f 2>/dev/null | head -10Length of output: 381 🏁 Script executed: #!/bin/bash
# Inspect appsettings.Production.json for credential exposure
echo "=== Contents of appsettings.Production.json ==="
if [ -f "src/Web.Api/appsettings.Production.json" ]; then
cat "src/Web.Api/appsettings.Production.json"
else
echo "File not found at expected location"
find . -name "appsettings.Production.json" -type f 2>/dev/null
fiLength of output: 685 🏁 Script executed: #!/bin/bash
# Look for deployment workflow file mentioned in review
echo "=== Searching for deploy-gcloud.yml ==="
find . -name "deploy-gcloud.yml" -o -name "*deploy*" -type f | grep -E "\.(yml|yaml)$" | head -20Length of output: 77 🏁 Script executed: #!/bin/bash
# Check for Cloud Run or Secret Manager configuration
echo "=== Searching for Cloud Run or Secret Manager references ==="
rg -i "(secret.?manager|cloud.?run|--set-env|SECRETS)" --type yaml --type json -C 3 | head -50Length of output: 60 I need to examine the deployment workflow to verify the secret handling mechanism and confirm if there's commented-out code for environment variable injection. 🏁 Script executed: #!/bin/bash
# Examine the deploy-gcloud.yml workflow file
echo "=== Contents of deploy-gcloud.yml ==="
cat "./.github/workflows/deploy-gcloud.yml"Length of output: 7232 🏁 Script executed: #!/bin/bash
# Search for any commented-out sections with env var patterns
echo "=== Searching for commented patterns with env vars in deploy workflow ==="
grep -n "^\s*#.*--set-env\|^\s*#.*ConnectionStrings\|^\s*#.*SmtpPassword" "./.github/workflows/deploy-gcloud.yml" || echo "No commented env var patterns found"Length of output: 892 🏁 Script executed: #!/bin/bash
# Check if appsettings files are copied or included in deployment
echo "=== Searching for appsettings file references in deployment context ==="
rg -n "appsettings" "./.github/workflows/deploy-gcloud.yml" -C 2Length of output: 314 CRITICAL: Plaintext database and email credentials exposed in production configuration file and version control. The credentials are hardcoded in plaintext in
The Additionally, the deployment workflow ( Required fixes:
🤖 Prompt for AI Agents |
||
| }, | ||
| "AppSettings": { | ||
| "BaseUrl": "http://localhost:10000" | ||
| "BaseUrl": "https://legal-assistant-api-900984203976.asia-southeast1.run.app" | ||
| }, | ||
| "Email": { | ||
| "Enabled": true, | ||
|
|
||
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.
🧩 Analysis chain
CRITICAL: Deployment no longer injects sensitive values via environment variables.
Line 134 simplifies environment variable setup to only
ASPNETCORE_ENVIRONMENT=Production,ASPNETCORE_URLS=http://+:10000. The previous pattern (commented-out lines 110-119) injected sensitive configuration via environment variables, which overrode config file values.Impact: This change forces the application to use hardcoded values from
appsettings.Production.json, including:ConnectionStrings.DefaultConnection)Email.SmtpPassword)This creates a security and compliance risk: sensitive credentials are now stored in version control instead of being injected at deployment time.
Recommended fix:
The
ASPNETCORE_URLS=http://+:10000addition is correct and should be retained.Please confirm:
Length of output: 40
🏁 Script executed:
Length of output: 109
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 287
🏁 Script executed:
Length of output: 2126
🏁 Script executed:
Length of output: 637
🏁 Script executed:
Length of output: 1432
CRITICAL: Deployment regression exposes plaintext credentials in version control.
Verification confirms the review comment is accurate and the issue is critical:
Confirmed findings:
${{ secrets.DB_CONNECTION_STRING }},${{ secrets.SMTP_PASSWORD }}, etc.)ASPNETCORE_ENVIRONMENT=Production,ASPNETCORE_URLS=http://+:10000appsettings.Production.jsoncontains hardcoded plaintext credentials in version control:Admin@123uomycajntiuixmkiThis is an intentional regression from secure secret injection to file-based credential storage. Production deployments now depend on plaintext secrets in Git history.
Required action: Restore the secret injection pattern from lines 100-119 or migrate to Google Cloud Secret Manager for runtime secret injection.