-
Notifications
You must be signed in to change notification settings - Fork 31
Fix Civil ID S3 hardening and env-based S3 credentials #71
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
base: master
Are you sure you want to change the base?
Changes from all commits
9b30fbd
98f9655
1a9cbdd
63ade98
e4c2b2d
bbe55ab
f8c4e17
933ea47
d0b01e8
338877d
27c1db2
73c4bb2
388ed85
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,8 @@ | |
| 'temporaryBucketResourceManager' => [ | ||
| 'class' => 'common\components\S3ResourceManager', | ||
| 'region' => 'eu-west-2', // Bucket based in London | ||
| 'key' => 'AKIAWMITDJRKVN5ODY2X', | ||
| 'secret' => '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', | ||
| 'key' => getenv('AWS_TEMP_BUCKET_KEY') ?: '', | ||
| 'secret' => getenv('AWS_TEMP_BUCKET_SECRET') ?: '', | ||
|
Comment on lines
+11
to
+12
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. Empty-string fallbacks silently defer credential failures to runtime. When Consider using 🔒 Proposed fix to fail fast on missing credentials- 'key' => getenv('AWS_TEMP_BUCKET_KEY') ?: '',
- 'secret' => getenv('AWS_TEMP_BUCKET_SECRET') ?: '',
+ 'key' => getenv('AWS_TEMP_BUCKET_KEY') ?: null,
+ 'secret' => getenv('AWS_TEMP_BUCKET_SECRET') ?: null,This allows the S3 client to fall back to AWS SDK's default credential chain (environment, IAM role, etc.) or fail explicitly if no credentials are available. 🤖 Prompt for AI Agents |
||
| 'bucket' => 'studenthub-public-anyone-can-upload-24hr-expiry' | ||
| /** | ||
| * You can access the Temporary bucket with: | ||
|
|
||
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.
Use strict calendar validation for
civil_expiry_datestrtotime()is too permissive and can accept malformed dates by coercion. This allows invalid civil expiry values to be stored as different valid dates.Suggested fix
🤖 Prompt for AI Agents