Update buildspec.yaml#37
Conversation
π WalkthroughWalkthroughThis PR updates the CodeBuild email notification configuration in ChangesEmail Notification Configuration
Estimated code review effortπ― 2 (Simple) | β±οΈ ~8 minutes Poem
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 inconclusive)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@DevOps-Project-23/Swiggy_clone/buildspec.yaml`:
- Around line 58-59: Replace the hardcoded emails used in the SES command
(--from and --to) with Parameter Store references and load them via the
buildspec env.parameter-store configuration; update the buildspec.yaml to
declare parameters (e.g., /cicd/ses/from-email and /cicd/ses/to-email) and
change the SES invocation to use the parameter values instead of literal
addresses so the SES command (the lines containing "--from" and "--to") reads
values from the parameter-store variables; also ensure CI/CD secrets are created
in SSM (aws ssm put-parameter ...) with verified SES addresses before the
pipeline runs.
πͺ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0a8698d3-1abd-4bb8-9b5b-1dc87ed78584
π Files selected for processing (1)
DevOps-Project-23/Swiggy_clone/buildspec.yaml
| --from "ishuraghuvinder@gmail.com" \ | ||
| --to "ishuraghuvinder@gmail.com" \ |
There was a problem hiding this comment.
Hardcoded email addresses expose PII and create security/maintainability risks.
Personal email addresses are hardcoded directly in the repository, which:
- Exposes PII (Personally Identifiable Information) to anyone with repository access
- Creates a spam/phishing target
- Makes the configuration inflexible and harder to maintain
- Violates security best practices for managing sensitive data
π Proposed fix: Use AWS Systems Manager Parameter Store
Store email addresses in Parameter Store and reference them in the buildspec:
Update the env.parameter-store section:
env:
parameter-store:
DOCKER_REGISTRY_USERNAME: /cicd/docker-credentials/username
DOCKER_REGISTRY_PASSWORD: /cicd/docker-credentials/password
DOCKER_REGISTRY_URL: /cicd/docker-registry/url
SONAR_TOKEN: /cicd/sonar/sonar-token
+ NOTIFICATION_FROM_EMAIL: /cicd/ses/from-email
+ NOTIFICATION_TO_EMAIL: /cicd/ses/to-emailThen update the SES command:
post_build:
commands:
- |
aws ses send-email \
- --from "ishuraghuvinder@gmail.com" \
- --to "ishuraghuvinder@gmail.com" \
+ --from "$NOTIFICATION_FROM_EMAIL" \
+ --to "$NOTIFICATION_TO_EMAIL" \
--subject "CodeBuild Status: $CODEBUILD_BUILD_ID" \
--text "Build status: $CODEBUILD_BUILD_STATUS" \
--region "eu-north-1"Create the parameters:
aws ssm put-parameter --name /cicd/ses/from-email --value "your-verified-email@example.com" --type String
aws ssm put-parameter --name /cicd/ses/to-email --value "recipient@example.com" --type Stringπ€ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@DevOps-Project-23/Swiggy_clone/buildspec.yaml` around lines 58 - 59, Replace
the hardcoded emails used in the SES command (--from and --to) with Parameter
Store references and load them via the buildspec env.parameter-store
configuration; update the buildspec.yaml to declare parameters (e.g.,
/cicd/ses/from-email and /cicd/ses/to-email) and change the SES invocation to
use the parameter values instead of literal addresses so the SES command (the
lines containing "--from" and "--to") reads values from the parameter-store
variables; also ensure CI/CD secrets are created in SSM (aws ssm put-parameter
...) with verified SES addresses before the pipeline runs.
Summary by CodeRabbit
Release Notes