-
Notifications
You must be signed in to change notification settings - Fork 0
cd #19
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
cd #19
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 |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: CD-PROD | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["CI-PROD"] | ||
| types: [completed] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: cd-prod | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| env: | ||
| AWS_REGION: ${{ vars.AWS_REGION }} | ||
| ECR_REGISTRY: ${{ vars.ECR_REGISTRY }} | ||
| ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} | ||
| ECS_CLUSTER: ${{ vars.ECS_CLUSTER }} | ||
| ECS_SERVICE: ${{ vars.ECS_SERVICE }} | ||
| TASK_FAMILY: ${{ vars.TASK_FAMILY }} | ||
| CONTAINER_NAME: ${{ vars.CONTAINER_NAME }} | ||
|
|
||
| jobs: | ||
| deploy: | ||
| if: > | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
|
|
||
| steps: | ||
| - name: Configure AWS credentials (OIDC) | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | ||
| aws-region: ${{ env.AWS_REGION }} | ||
|
|
||
| - name: Resolve image tag | ||
| id: tag | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "workflow_run" ]; then | ||
| IMAGE_TAG="${{ github.event.workflow_run.head_sha }}" | ||
| else | ||
| IMAGE_TAG="${{ github.sha }}" | ||
| fi | ||
| IMAGE_TAG="${IMAGE_TAG:0:7}" | ||
| echo "image_tag=${IMAGE_TAG}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Verify image exists in ECR | ||
| run: | | ||
| aws ecr describe-images \ | ||
| --repository-name "${ECR_REPOSITORY}" \ | ||
| --image-ids imageTag="${{ steps.tag.outputs.image_tag }}" \ | ||
| > /dev/null | ||
|
|
||
| - name: Get current task definition | ||
| run: | | ||
| aws ecs describe-task-definition \ | ||
| --task-definition "${TASK_FAMILY}" \ | ||
| --query 'taskDefinition' > taskdef.json | ||
|
|
||
| - name: Render new task definition | ||
| env: | ||
| IMAGE_URI: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ steps.tag.outputs.image_tag }} | ||
| run: | | ||
| jq \ | ||
| --arg CN "${CONTAINER_NAME}" \ | ||
| --arg IMG "${IMAGE_URI}" \ | ||
| --arg SPRING_PROFILES_ACTIVE "prod" \ | ||
| --arg SERVER_PORT "19000" \ | ||
| --arg EUREKA_ENABLED "${{ vars.EUREKA_ENABLED }}" \ | ||
| --arg EUREKA_HOST "${{ vars.EUREKA_HOST }}" \ | ||
| --arg EUREKA_PORT "${{ vars.EUREKA_PORT }}" \ | ||
| --arg JWT_SECRET "${{ secrets.JWT_SECRET }}" \ | ||
| ' | ||
| .containerDefinitions |= map( | ||
| if .name == $CN then | ||
| .image = $IMG | ||
| | .environment = [ | ||
| {"name":"SPRING_PROFILES_ACTIVE","value":$SPRING_PROFILES_ACTIVE}, | ||
| {"name":"SERVER_PORT","value":$SERVER_PORT}, | ||
| {"name":"EUREKA_ENABLED","value":$EUREKA_ENABLED}, | ||
| {"name":"EUREKA_HOST","value":$EUREKA_HOST}, | ||
| {"name":"EUREKA_PORT","value":$EUREKA_PORT}, | ||
| {"name":"JWT_SECRET","value":$JWT_SECRET} | ||
|
Comment on lines
+77
to
+88
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 chainπ Script executed: # First, locate and examine the file
fd -type f "cd-prod.yml" .github/workflows/Repository: Miche-Let/api-gateway Length of output: 236 π Script executed: # Once found, examine lines 77-88 and surrounding context
sed -n '70,95p' .github/workflows/cd-prod.yml | cat -nRepository: Miche-Let/api-gateway Length of output: 1432 π Script executed: # Check if JWT_SECRET is used elsewhere in the workflow
rg "JWT_SECRET" .github/workflows/cd-prod.yml -n -B2 -A2Repository: Miche-Let/api-gateway Length of output: 562 π Script executed: # Check the full workflow file to understand the context better
wc -l .github/workflows/cd-prod.ymlRepository: Miche-Let/api-gateway Length of output: 99 π Script executed: # Look at the complete jq command and the task definition registration
sed -n '60,120p' .github/workflows/cd-prod.yml | cat -nRepository: Miche-Let/api-gateway Length of output: 2881 π Script executed: # Check if there are any other references to task definitions or secrets
rg "taskDefinition|secrets|Secrets Manager|SSM Parameter" .github/workflows/cd-prod.yml -nRepository: Miche-Let/api-gateway Length of output: 359 π Script executed: # Check if JWT_SECRET_ARN or similar variables are defined elsewhere
rg "JWT_SECRET|SECRET" .github/workflows/ -n --max-count 20Repository: Miche-Let/api-gateway Length of output: 252 π Web query:
π‘ Result: To securely manage secrets in AWS ECS using the valueFrom parameter, follow these best practices: 1. Use Managed Services: Store sensitive data in AWS Secrets Manager or AWS Systems Manager (SSM) Parameter Store [1][2]. Both services use AWS KMS for encryption at rest [1][3]. - Use Secrets Manager for secrets requiring automatic rotation, cross-account access, or multi-Region replication [1][3]. - Use SSM Parameter Store for basic configuration data and secrets that do not require these advanced features, as it is often more cost-effective [1][3]. 2. Use the Secrets Parameter: In your ECS task definition, use the secrets container definition parameter to reference these secrets via their ARN [4][5][6]. This allows the ECS agent to inject the secret value as an environment variable at container startup [7]. 3. Implement Least Privilege IAM: Ensure your task execution role has the minimum necessary permissions to retrieve secrets from the specific Secrets Manager or SSM Parameter Store resources [4][8][2]. 4. Consider Programmatic Retrieval for Dynamic Updates: Injecting secrets as environment variables via the task definition requires a task restart to pick up changes if a secret is rotated [6][7][2]. If your application requires real-time secret updates without restarting the task, modify your application code to retrieve secrets directly from Secrets Manager or SSM Parameter Store at runtime using the AWS SDK [8][2]. 5. Mitigate Environment Variable Exposure: Environment variables can sometimes be exposed in logs or via tools like docker inspect [1]. To further enhance security: - Use IAM roles to restrict access to the task definition and the secrets themselves [1][2]. - If extreme security is required, consider having a sidecar container retrieve the secret and write it to a shared volume, or have the application read directly from the secret store at runtime to avoid environment variables entirely [1][2]. - Ensure your logging configuration does not capture or log environment variables [2]. 6. Use Hierarchical Naming: When using SSM Parameter Store, adopt a consistent naming hierarchy (e.g., /app/env/key) to simplify IAM policy management and improve organization [9]. Citations:
π Web query:
π‘ Result: In Amazon ECS, the primary security best practice for handling sensitive data is to avoid hardcoding secrets in task definitions or Dockerfiles [1][2][3]. Instead, you should use the native secrets integration provided by the ECS task definition, which allows you to reference secrets stored in AWS Secrets Manager or AWS Systems Manager Parameter Store [1][4][5]. Comparison of Approaches: 1. ECS Secrets Field (Recommended): By using the secrets parameter in your container definition, ECS automatically retrieves the secret value from Secrets Manager or Parameter Store at runtime and injects it into the container [6][7]. This method ensures that sensitive values are not stored in plain text within your task definition or version control systems [3]. 2. Environment Variables (Standard): When you use the secrets field, ECS typically exposes these values as environment variables within the container [1][6][7]. While this is the standard and supported way to inject secrets, it carries inherent risks: environment variables can sometimes be exposed through logs, error messages, or by unauthorized processes inspecting the container (e.g., via docker inspect) [1][2]. Advanced Security Best Practices: To mitigate the risks associated with environment variables, consider these more secure patterns: - Direct SDK Retrieval: For highly sensitive applications, configure your application code to use the AWS SDK to fetch secrets directly from Secrets Manager or Parameter Store at runtime [1][2]. This avoids exposing the secret as an environment variable entirely [2]. - Sidecar Pattern: Run a sidecar container that retrieves the secret and writes it to a shared, memory-backed volume (tmpfs) [1][8]. Your main application container can then read the secret from this file, ensuring the secret never exists as an environment variable and resides only in memory [1][8]. - IAM Least Privilege: Regardless of the injection method, always use an IAM task execution role with the minimum necessary permissions to access only the specific secrets required by that task [1][8][2]. - Secret Rotation: Utilize AWS Secrets Manager to enable automatic secret rotation, which limits the window of opportunity if a secret is ever compromised [1][2]. In summary, while using the ECS secrets field is significantly more secure than hardcoding values, the most robust security posture involves either direct SDK retrieval or using a sidecar pattern to keep secrets out of the environment variable space [1][8][2]. Citations:
JWT_SECRETλ₯Ό νκ²½λ³μλ‘ νλ¬Έ μ μ₯νμ§ λ§μΈμ. ECS νμ€ν¬ μ μ 리λΉμ μ νλ¬ΈμΌλ‘ μ μ₯λμ΄ μ μ μμ - --arg JWT_SECRET "${{ secrets.JWT_SECRET }}" \
+ --arg JWT_SECRET_ARN "${{ vars.JWT_SECRET_ARN }}" \
'
.containerDefinitions |= map(
if .name == $CN then
.image = $IMG
| .environment = [
{"name":"SPRING_PROFILES_ACTIVE","value":$SPRING_PROFILES_ACTIVE},
{"name":"SERVER_PORT","value":$SERVER_PORT},
{"name":"EUREKA_ENABLED","value":$EUREKA_ENABLED},
{"name":"EUREKA_HOST","value":$EUREKA_HOST},
- {"name":"EUREKA_PORT","value":$EUREKA_PORT},
- {"name":"JWT_SECRET","value":$JWT_SECRET}
+ {"name":"EUREKA_PORT","value":$EUREKA_PORT}
]
+ | .secrets = (
+ ((.secrets // []) | map(select(.name != "JWT_SECRET")))
+ + [{"name":"JWT_SECRET","valueFrom":$JWT_SECRET_ARN}]
+ )
else .
end
)π€ Prompt for AI Agents |
||
| ] | ||
|
Comment on lines
+82
to
+89
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 chainπ Script executed: # First, let's locate and examine the workflow file
find . -name "cd-prod.yml" -type f 2>/dev/nullRepository: Miche-Let/api-gateway Length of output: 97 π Script executed: # Let's check if the file exists and read the relevant section
if [ -f ".github/workflows/cd-prod.yml" ]; then
echo "=== Lines 70-100 of cd-prod.yml ==="
sed -n '70,100p' ".github/workflows/cd-prod.yml" | cat -n
else
echo "File not found, checking directory structure..."
find . -path "*workflows*" -name "*.yml" -o -name "*.yaml" | head -20
fiRepository: Miche-Let/api-gateway Length of output: 1663 π Script executed: # Get the full content of the workflow file to understand the context better
if [ -f ".github/workflows/cd-prod.yml" ]; then
wc -l ".github/workflows/cd-prod.yml"
echo "=== Full relevant section ==="
cat -n ".github/workflows/cd-prod.yml" | sed -n '75,95p'
fiRepository: Miche-Let/api-gateway Length of output: 1225 컨ν μ΄λ νκ²½λ³μλ₯Ό μμ ν κ΅μ²΄νκ³ μμ΅λλ€. Line 82μ μ μ μμ - | .environment = [
- {"name":"SPRING_PROFILES_ACTIVE","value":$SPRING_PROFILES_ACTIVE},
- {"name":"SERVER_PORT","value":$SERVER_PORT},
- {"name":"EUREKA_ENABLED","value":$EUREKA_ENABLED},
- {"name":"EUREKA_HOST","value":$EUREKA_HOST},
- {"name":"EUREKA_PORT","value":$EUREKA_PORT},
- {"name":"JWT_SECRET","value":$JWT_SECRET}
- ]
+ | .environment = (
+ ((.environment // []) | map({key: .name, value: .value}) | from_entries)
+ + {
+ "SPRING_PROFILES_ACTIVE": $SPRING_PROFILES_ACTIVE,
+ "SERVER_PORT": $SERVER_PORT,
+ "EUREKA_ENABLED": $EUREKA_ENABLED,
+ "EUREKA_HOST": $EUREKA_HOST,
+ "EUREKA_PORT": $EUREKA_PORT,
+ "JWT_SECRET": $JWT_SECRET
+ }
+ | to_entries
+ | map({"name": .key, "value": .value})
+ )π€ Prompt for AI Agents |
||
| else . | ||
| end | ||
| ) | ||
| | del( | ||
| .taskDefinitionArn, .revision, .status, | ||
| .requiresAttributes, .compatibilities, | ||
| .registeredAt, .registeredBy | ||
| ) | ||
| ' taskdef.json > taskdef.new.json | ||
|
|
||
| - name: Register new task definition revision | ||
| id: register | ||
| run: | | ||
| ARN=$(aws ecs register-task-definition \ | ||
| --cli-input-json file://taskdef.new.json \ | ||
| --query 'taskDefinition.taskDefinitionArn' \ | ||
| --output text) | ||
| echo "task_def_arn=${ARN}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Deploy to ECS service | ||
| run: | | ||
| aws ecs update-service \ | ||
| --cluster "${ECS_CLUSTER}" \ | ||
| --service "${ECS_SERVICE}" \ | ||
| --task-definition "${{ steps.register.outputs.task_def_arn }}" \ | ||
| --force-new-deployment | ||
|
|
||
| - name: Wait for stable | ||
| run: | | ||
| aws ecs wait services-stable \ | ||
| --cluster "${ECS_CLUSTER}" \ | ||
| --services "${ECS_SERVICE}" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||||||||||||||||
| # .github/workflows/ci-prod.yml | ||||||||||||||||||||||||
| name: CI-PROD | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Set up JDK 21 | ||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||
| distribution: temurin | ||||||||||||||||||||||||
| java-version: "21" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Set up Gradle | ||||||||||||||||||||||||
| uses: gradle/actions/setup-gradle@v4 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Grant execute permission for gradlew | ||||||||||||||||||||||||
| run: chmod +x ./gradlew | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||
| run: ./gradlew test --no-daemon | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Generate image tag | ||||||||||||||||||||||||
| if: github.event_name == 'push' | ||||||||||||||||||||||||
| run: echo "IMAGE_TAG=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Configure AWS credentials (OIDC) | ||||||||||||||||||||||||
| uses: aws-actions/configure-aws-credentials@v4 | ||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | ||||||||||||||||||||||||
| aws-region: ${{ vars.AWS_REGION }} | ||||||||||||||||||||||||
|
Comment on lines
+41
to
+45
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 chainπ Script executed: cat -n .github/workflows/ci-prod.ymlRepository: Miche-Let/api-gateway Length of output: 1984 PR κ²μ¦μμλ AWS μΈμ¦μ μλν©λλ€. Line 41-45μ μ μ μμ - name: Configure AWS credentials (OIDC)
+ if: github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Login to Amazon ECR | ||||||||||||||||||||||||
| if: github.event_name == 'push' | ||||||||||||||||||||||||
| uses: aws-actions/amazon-ecr-login@v2 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Build Docker image | ||||||||||||||||||||||||
| if: github.event_name == 'push' | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| docker build -t ${{ vars.ECR_REGISTRY }}/${{ vars.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} . | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Push Docker image to ECR | ||||||||||||||||||||||||
| if: github.event_name == 'push' | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| docker push ${{ vars.ECR_REGISTRY }}/${{ vars.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -37,6 +37,9 @@ dependencies { | |||
| testImplementation 'io.projectreactor:reactor-test' | ||||
| testImplementation 'org.springframework.security:spring-security-test' | ||||
| testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||||
|
|
||||
| implementation 'org.springframework.boot:spring-boot-starter-actuator' | ||||
|
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 chainπ Script executed: #!/bin/bash
# Verify duplicate actuator declarations in Gradle dependencies
rg -n "spring-boot-starter-actuator" build.gradleRepository: Miche-Let/api-gateway Length of output: 215 spring-boot-starter-actuator μμ‘΄μ±μ΄ μ€λ³΅ μ μΈλμ΄ μμ΅λλ€. Line 41μ Line 25μ λμΌν μμ‘΄μ±μ΄λ―λ‘ μ€λ³΅μ λλ€. νλλ§ μ μ§νμΈμ. π§ μ μ μμ - implementation 'org.springframework.boot:spring-boot-starter-actuator'π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||
|
|
||||
| } | ||||
|
|
||||
| dependencyManagement { | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http, Ga | |
| exchanges-> exchanges.pathMatchers( | ||
| "/api/*/auth/login", | ||
| "/api/*/auth/reissue", | ||
| "/api/*/users/signup" | ||
| "/api/*/users/signup", "/actuator/health", "/actuator/info" | ||
|
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 chainπ Script executed: #!/bin/bash
# Verify where /actuator/info is publicly exposed or referenced
rg -n "/actuator/info|permitAll\\(|management\\.endpoint\\.info|endpoints\\.web\\.exposure" \
src/main/java/com/michelet/gateway/infrastructure/config/SecurityConfig.java \
src/main/resources/application-prod.yml \
src/main/resources/application.ymlRepository: Miche-Let/api-gateway Length of output: 355 π Script executed: # SecurityConfig.java μ 체 λ΄μ© νμΈ
cat -n src/main/java/com/michelet/gateway/infrastructure/config/SecurityConfig.javaRepository: Miche-Let/api-gateway Length of output: 2979 π Script executed: # μ ν리μΌμ΄μ
μ€μ νμΌμμ actuator κ΄λ ¨ μ€μ νμΈ
cat src/main/resources/application.yml
cat src/main/resources/application-prod.yml 2>/dev/null || echo "application-prod.yml not found"Repository: Miche-Let/api-gateway Length of output: 2715 π Script executed: # actuator μλν¬μΈνΈ κ΄λ ¨ λ€λ₯Έ μ°Έμ‘° νμΈ
rg -n "actuator" src/main/Repository: Miche-Let/api-gateway Length of output: 237
Line 31μμ π§ μ μ μμ - "/api/*/users/signup", "/actuator/health", "/actuator/info"
+ "/api/*/users/signup", "/actuator/health"π€ Prompt for AI Agents |
||
| ).permitAll() | ||
| .pathMatchers("/api/*/admin/**").hasRole("MASTER") | ||
| .anyExchange().authenticated() | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||
| server: | ||||||||||
| port: ${SERVER_PORT:19000} | ||||||||||
|
|
||||||||||
| eureka: | ||||||||||
| client: | ||||||||||
| enabled: ${EUREKA_ENABLED:true} | ||||||||||
| service-url: | ||||||||||
| defaultZone: http://${EUREKA_HOST}:${EUREKA_PORT}/eureka/ | ||||||||||
| instance: | ||||||||||
| prefer-ip-address: true | ||||||||||
|
|
||||||||||
| spring: | ||||||||||
| cloud: | ||||||||||
| inetutils: | ||||||||||
| ignored-interfaces: | ||||||||||
| - "lo" | ||||||||||
| - "docker.*" | ||||||||||
| - "veth.*" | ||||||||||
| preferred-networks: | ||||||||||
| - "10.0" | ||||||||||
| use-only-site-local-interfaces: true | ||||||||||
|
|
||||||||||
| management: | ||||||||||
| endpoints: | ||||||||||
| web: | ||||||||||
| exposure: | ||||||||||
| include: health,info,prometheus | ||||||||||
| endpoint: | ||||||||||
| health: | ||||||||||
| show-details: always | ||||||||||
|
Comment on lines
+29
to
+30
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 chainπ Script executed: #!/bin/bash
# Verify risky combination across prod config + security config
rg -n "show-details|/actuator/health|/actuator/info" \
src/main/resources/application-prod.yml \
src/main/java/com/michelet/gateway/infrastructure/config/SecurityConfig.javaRepository: Miche-Let/api-gateway Length of output: 307 κ³΅κ° ν¬μ€ μλν¬μΈνΈμ SecurityConfigμμ π§ μ μ μμ management:
endpoint:
health:
- show-details: always
+ show-details: when-authorizedπ Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||
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
π Script executed:
Repository: Miche-Let/api-gateway
Length of output: 236
π Script executed:
Repository: Miche-Let/api-gateway
Length of output: 491
π Script executed:
Repository: Miche-Let/api-gateway
Length of output: 4100
π Script executed:
Repository: Miche-Let/api-gateway
Length of output: 1571
PR μ±κ³΅ νμλ λ°°ν¬ μ‘μ΄ μ€νλμ΄ μ΄λ―Έμ§ κ²μ¦μμ μ€ν¨ν©λλ€.
CI-PRODλpull_requestμpushμ΄λ²€νΈ λͺ¨λμμ μ€νλμ§λ§, μ¬κΈ°μλ μ±κ³΅ μ¬λΆλ§ νμΈνλ―λ‘ μ±κ³΅ν PR λΉλλ CD μν¬νλ‘μ°λ₯Ό νΈλ¦¬κ±°ν©λλ€. κ·Έλ¬λ μ΄λ―Έμ§ νΈμλif: github.event_name == 'push'쑰건μΌλ‘pushμ΄λ²€νΈμμλ§ μ€νλλ―λ‘, PRμμ νΈλ¦¬κ±°λ μ€νμ ECRμ μ΄λ―Έμ§λ₯Ό νΈμνμ§ μμ΅λλ€. μ΄λ‘ μΈν΄ line 52μ "Verify image exists in ECR" λ¨κ³μμ λ§€λ² μ€ν¨ν©λλ€.workflow_runνΈλ¦¬κ±°λ₯Όpushμ΄λ²€νΈμmainλΈλμΉλ‘ μ νν΄μΌ ν©λλ€.μ μ μμ
if: > github.event_name == 'workflow_dispatch' || - (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') + (github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' && + github.event.workflow_run.head_branch == 'main')π Committable suggestion
π€ Prompt for AI Agents