Skip to content
Open

Rish #118

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/pr-security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: PR Security Scan

on:
pull_request:
branches: [main]
paths:
- 'backend/**/requirements*.txt'
- 'backend/**/Dockerfile'
- 'frontend/Dockerfile'
- 'k8s/**'
- '.github/workflows/**'

jobs:
trivy-fs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Trivy scan (filesystem)
uses: aquasecurity/trivy-action@0.24.0
with:
scan-type: fs
ignore-unfixed: true
severity: CRITICAL,HIGH
exit-code: '1'

trivy-backend-image:
runs-on: ubuntu-latest
needs: trivy-fs
steps:
- uses: actions/checkout@v4

- name: Build backend product_service image
run: docker build -t prscan-product:tmp backend/product_service

- name: Trivy scan (product_service image)
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: prscan-product:tmp
ignore-unfixed: true
severity: CRITICAL,HIGH
exit-code: '1'

trivy-frontend-image:
runs-on: ubuntu-latest
needs: trivy-fs
steps:
- uses: actions/checkout@v4

- name: Build frontend image
run: docker build -t prscan-frontend:tmp frontend

- name: Trivy scan (frontend image)
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: prscan-frontend:tmp
ignore-unfixed: true
severity: CRITICAL,HIGH
exit-code: '1'
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ image: <YOUR_ACR_NAME>.azurecr.io/<image_name>:<image_tag>
### 2. Update Backend Pipeline (`.github/workflows/backend-cd.yml`) & Frontend Pipeline (`.github/workflows/frontend-cd.yml`)

Ensure you replace all placeholders value to actual values.


Changes
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ services:
- "8000:8000"
environment:
POSTGRES_HOST: product_db # Connects to the 'product_db' service within Docker network
AZURE_STORAGE_ACCOUNT_NAME: <your_storage_account_name> # Replace with your Azure Storage account name
AZURE_STORAGE_ACCOUNT_KEY: <your_storage_account_key> # Replace with your Azure Storage account key
AZURE_STORAGE_CONTAINER_NAME: <your_container_name> # Replace with your Azure Storage container name
AZURE_STORAGE_ACCOUNT_NAME: rsit722stgacc # Replace with your Azure Storage account name
AZURE_STORAGE_ACCOUNT_KEY: QyxZRd8Kt2r38+Z94jGdUvWGlK2sGnN3J3nDjcJQCdNHFWEOuqAf9EFnsAgKOTL9CbeQ7mc6T8we+ASt7W9Edw== # Replace with your Azure Storage account key
AZURE_STORAGE_CONTAINER_NAME: datacontainer # Replace with your Azure Storage container name
AZURE_SAS_TOKEN_EXPIRY_HOURS: 24
depends_on:
product_db:
Expand Down
2 changes: 1 addition & 1 deletion k8s/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: frontend-container
image: durgeshsamariya.azurecr.io/frontend:latest
image: acrsit722r.azurecr.io/frontend:latest
imagePullPolicy: Always
ports:
- containerPort: 80
Expand Down
2 changes: 1 addition & 1 deletion k8s/order-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: order-service-container
image: durgeshsamariya.azurecr.io/order_service:latest
image: acrsit722r.azurecr.io/order_service:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
Expand Down
2 changes: 1 addition & 1 deletion k8s/product-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: product-service-container
image: durgeshsamariya.azurecr.io/product_service:latest
image: acrsit722r.azurecr.io/product_service:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
Expand Down
4 changes: 2 additions & 2 deletions k8s/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ data:
# Azure Storage Account Credentials for Product Service image uploads
# REPLACE WITH YOUR ACTUAL BASE64 ENCODED VALUES from your Azure Storage Account
# Example: echo -n 'myblobstorageaccount' | base64
AZURE_STORAGE_ACCOUNT_NAME: "ZHVyZ2VzaHNhbWFyaXlh"
AZURE_STORAGE_ACCOUNT_NAME: "cnNpdDcyMnN0Z2FjYw=="
# Example: echo -n 'your_storage_account_key_string' | base64
AZURE_STORAGE_ACCOUNT_KEY: "aEFNQ24rbkh2cmhwSGFEaW5jSnAxNFlHaU5nTnJja2NJR05Bc3Y5VXZPUlpsblJkbkVUR3drdTREdSszblBDR3E4ZEVTVjlFNE1jMytBU3RubmZ5QVE9PQ=="
AZURE_STORAGE_ACCOUNT_KEY: "UXl4WlJkOEt0MnIzOCtaOTRqR2RVdldHbEsyc0duTjNKM25EamNKUUNkTkhGV0VPdXFBZjlFRm5zQWdLT1RMOUNiZVE3bWM2VDh3ZStBU3Q3VzlFZHc9PQ=="