Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7af7f8a
Add complete DevSecOps pipeline + UI improvements
Nandan29300 Mar 9, 2026
d45718c
changes added
Nandan29300 Mar 9, 2026
80af4d8
feat: Add DevSecOps pipeline
Nandan29300 Mar 9, 2026
5ad4f3f
feat: Add DevSecOps pipeline
Nandan29300 Mar 9, 2026
173088a
fix: Clean up NVD API key usage
Nandan29300 Mar 9, 2026
a5c041b
fix: Configure OWASP plugin in pom.xml with NVD API key
Nandan29300 Mar 9, 2026
a8b9627
OWASP changes added
Nandan29300 Mar 9, 2026
5276f7a
OWASP changes added
Nandan29300 Mar 9, 2026
55ac4eb
OWASP changes added
Nandan29300 Mar 9, 2026
0237b78
OWASP changes added
Nandan29300 Mar 9, 2026
631091c
OWASP changes added
Nandan29300 Mar 9, 2026
07fad43
OWASP changes added
Nandan29300 Mar 9, 2026
70e7a39
OWASP changes added
Nandan29300 Mar 9, 2026
7fc15de
OWASP changes added
Nandan29300 Mar 9, 2026
666163f
OWASP changes added
Nandan29300 Mar 9, 2026
44542f5
OWASP changes added
Nandan29300 Mar 9, 2026
63ea9d0
fix: use pre-built Docker image for deployment
Nandan29300 Mar 9, 2026
dc5fa91
Changes added related to devsecops
Nandan29300 Mar 10, 2026
361f878
fix: create .env file on EC2 during deployment
Nandan29300 Mar 10, 2026
e023ca4
chore: prepare for PR - enhance UI, update docs, cleanup files
Nandan29300 Mar 10, 2026
c112493
feat: enhance UI with stats cards and improved design
Nandan29300 Mar 10, 2026
4bc00e3
feat: redesign dashboard with 2-column layout, add auto image cleanup
Nandan29300 Mar 10, 2026
013ce1f
docs: add .env.example template for easy setup
Nandan29300 Mar 10, 2026
c7dd2da
feat: feat: adopt modern glassmorphism UI design and enable Ollama AI…
Nandan29300 Mar 11, 2026
e447ced
feat: add chat persistence to database
Nandan29300 Mar 11, 2026
a9e81f7
feat: Add 2 more jobs to the pipeline - SAST and DAST
Nandan29300 Mar 11, 2026
46969d2
feat: Add 2 more jobs to the pipeline - SAST and DAST
Nandan29300 Mar 11, 2026
6e83352
feat: Add 2 more jobs to the pipeline - SAST and DAST
Nandan29300 Mar 11, 2026
1b76e83
feat: Add 2 more jobs to the pipeline - SAST and DAST
Nandan29300 Mar 11, 2026
8ea573d
fix: add getAccountById method to AccountService for fresh balance re…
Nandan29300 Mar 11, 2026
b1097b5
fix: optimize Ollama response time by reducing context size
Nandan29300 Mar 11, 2026
d229da8
fix: optimize Ollama response time by reducing context size
Nandan29300 Mar 11, 2026
4c9a258
fix: implement stateless AI approach to prevent hallucinations and im…
Nandan29300 Mar 11, 2026
94de52b
changes added
Nandan29300 Mar 12, 2026
222035c
Added changes to PIPELINE_FLOW file
Nandan29300 Mar 12, 2026
e21557c
Added changes to PIPELINE_FLOW, devsecops-pipeline file, README file,…
Nandan29300 Mar 12, 2026
c4312f3
Changes added in README
Nandan29300 Mar 12, 2026
7fbab4a
Added changes related to Ollama
Nandan29300 Mar 12, 2026
5cbb6b2
Added changes related to Ollama
Nandan29300 Mar 12, 2026
4fefb31
Added changes related to Ollama
Nandan29300 Mar 12, 2026
5d2cee5
Added changes related to Ollama
Nandan29300 Mar 12, 2026
a68fd29
Added Method 2 deployment configuration
Nandan29300 Mar 13, 2026
d873f00
Delete PR_DESCRIPTION.md
agiledevopsguru Mar 13, 2026
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
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Database credentials for Docker Compose
DB_ROOT_PASSWORD=your_root_password_here
DB_USERNAME=your_db_username_here
DB_PASSWORD=your_db_password_here

# Docker Hub (for deployment - uses commit SHA from CI/CD)
DOCKERHUB_USER=your_dockerhub_username
DOCKER_TAG=${DOCKER_TAG:-latest}
29 changes: 29 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Linting and SAST scan for Java
# Lint: Checkstyle (via Maven) | SAST: SpotBugs (via Maven)

name: Code Quality

on:
workflow_call:


jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Run Checkstyle (Lint)
run: mvn checkstyle:check

- name: Run SpotBugs (SAST)
run: mvn spotbugs:check
38 changes: 38 additions & 0 deletions .github/workflows/dast-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: DAST - Dynamic Security Scan

on:
workflow_call:

permissions:
contents: read

jobs:
dast:
name: DAST - OWASP ZAP
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Wait for Application Warmup
run: |
echo "Waiting for application to be fully ready..."
sleep 15

- name: Run OWASP ZAP Baseline Scan
uses: zaproxy/action-baseline@v0.15.0
continue-on-error: true
with:
target: 'http://${{ secrets.EC2_SSH_HOST }}:8080'
rules_file_name: '.zap/rules.tsv'
cmd_options: '-a'
fail_action: false
allow_issue_writing: false

- name: Upload ZAP Scan Report
uses: actions/upload-artifact@v4
if: always()
with:
name: zap-dast-report
path: report_html.html
retention-days: 30
43 changes: 43 additions & 0 deletions .github/workflows/dependency-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Dependency scan

on:
workflow_call:

jobs:
dependency-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Cache OWASP NVD Database
uses: actions/cache@v4
with:
path: ~/.m2/repository/org/owasp/dependency-check-data
key: owasp-nvd-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
owasp-nvd-${{ runner.os }}-

- name: Run OWASP Dependency-Check
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: |
mvn org.owasp:dependency-check-maven:12.2.0:check \
-DnvdApiKey="${NVD_API_KEY}" \
-DfailBuildOnCVSS=7 \
-DsuppressionFile=suppression.xml || true

- name: Upload Dependency Check Report
uses: actions/upload-artifact@v4
if: always()
with:
name: owasp-dependency-check-report
path: target/dependency-check-report.html
101 changes: 101 additions & 0 deletions .github/workflows/deploy-to-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Deploy the safe / secure / tested image to prod server
# DEFAULT: Method 2 (Separate Ollama EC2)
# To use Method 1 (All-in-One), see comments below

name: Deploy to Server

on:
workflow_call:


jobs:

deploy:

env:
DOCKERHUB_USER: ${{ vars.DOCKERHUB_USER }}
DOCKER_TAG: ${{ github.sha }}

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: SSH to prod server — install Docker
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.EC2_SSH_HOST }}
username: ${{ secrets.EC2_SSH_USER }}
key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
script: |
sudo apt-get update && sudo apt-get install -y docker.io docker-compose-v2
sudo usermod -aG docker $USER
mkdir -p ~/devops

# METHOD 2 (Default): Copy app-tier.yml for separate Ollama EC2
- name: Copy app-tier compose file to server
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.EC2_SSH_HOST }}
username: ${{ secrets.EC2_SSH_USER }}
key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
source: app-tier.yml
target: ~/devops

# METHOD 1 (Alternative): Uncomment below and comment above for all-in-one setup
# - name: Copy docker-compose file to server
# uses: appleboy/scp-action@v1
# with:
# host: ${{ secrets.EC2_SSH_HOST }}
# username: ${{ secrets.EC2_SSH_USER }}
# key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
# source: docker-compose.yml
# target: ~/devops

- name: SSH to prod server — run the app
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.EC2_SSH_HOST }}
username: ${{ secrets.EC2_SSH_USER }}
key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
script: |
cd ~/devops
# METHOD 2 (Default): Using app-tier.yml with separate Ollama EC2
cat > .env << 'EOF'
DOCKERHUB_USER=${{ vars.DOCKERHUB_USER }}
DOCKER_TAG=${{ github.sha }}
DB_USERNAME=${{ secrets.DB_USERNAME }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_ROOT_PASSWORD=${{ secrets.DB_ROOT_PASSWORD }}
OLLAMA_URL=${{ secrets.OLLAMA_URL }}
EOF
echo ${{ secrets.DOCKERHUB_TOKEN }} | sudo docker login --username ${{ vars.DOCKERHUB_USER }} --password-stdin
sudo docker compose -f app-tier.yml down
sudo docker compose -f app-tier.yml pull
sudo docker compose -f app-tier.yml up -d --force-recreate

# METHOD 1 (Alternative): Uncomment below and comment above for all-in-one setup
# cat > .env << 'EOF'
# DOCKERHUB_USER=${{ vars.DOCKERHUB_USER }}
# DOCKER_TAG=${{ github.sha }}
# DB_USERNAME=${{ secrets.DB_USERNAME }}
# DB_PASSWORD=${{ secrets.DB_PASSWORD }}
# DB_ROOT_PASSWORD=${{ secrets.DB_ROOT_PASSWORD }}
# EOF
# echo ${{ secrets.DOCKERHUB_TOKEN }} | sudo docker login --username ${{ vars.DOCKERHUB_USER }} --password-stdin
# sudo docker compose down
# sudo docker compose pull
# sudo docker compose up -d --force-recreate

# Clean up old images (keep only current + previous version)
sudo docker images ${{ vars.DOCKERHUB_USER }}/bankapp --format "{{.ID}}" | tail -n +3 | xargs -r sudo docker rmi -f || true
echo "✅ Cleaned up old Docker images"

- name: Wait for application to be ready
run: |
echo "Waiting for application to start..."
sleep 30
curl -f http://${{ secrets.EC2_SSH_HOST }}:8080/actuator/health || exit 1
echo "✅ Application is healthy!"

69 changes: 69 additions & 0 deletions .github/workflows/devsecops-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: DevSecOps end-to-end pipeline

on:
workflow_dispatch:
# push:
# branches:
# - main
# - devsecops
# pull_request:
# branches:
# - main


jobs:

# CI Security Scans

code-quality:
uses: ./.github/workflows/code-quality.yml

secrets-scan:
uses: ./.github/workflows/secrets-scan.yml
secrets: inherit

dependency-scan:
uses: ./.github/workflows/dependency-scan.yml
secrets: inherit

docker-scan:
uses: ./.github/workflows/docker-lint.yml


# SAST — Static Application Security Testing

sast-scan:
needs: [code-quality, secrets-scan, dependency-scan, docker-scan]
uses: ./.github/workflows/sast-scan.yml
secrets: inherit


# Build — only after all scans pass

build:
needs: [sast-scan]
uses: ./.github/workflows/docker-build-push.yml
secrets: inherit


# Image scan — scan the freshly built image with Trivy

trivy:
needs: [build]
uses: ./.github/workflows/image-scan.yml
secrets: inherit


# Deploy — to prod server only after image is verified clean

deploy:
needs: [trivy]
uses: ./.github/workflows/deploy-to-server.yml
secrets: inherit

# DAST — scan the live application after deployment

dast-scan:
needs: [deploy]
uses: ./.github/workflows/dast-scan.yml
secrets: inherit
29 changes: 29 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docker build & push

on:
workflow_call:


jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Code checkout
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push to Docker Hub
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ vars.DOCKERHUB_USER }}/bankapp:${{ github.ref_name }}
${{ vars.DOCKERHUB_USER }}/bankapp:latest
${{ vars.DOCKERHUB_USER }}/bankapp:${{ github.sha }}
19 changes: 19 additions & 0 deletions .github/workflows/docker-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Scan the Dockerfile for issues and best-practice violations
name: Docker lint

on:
workflow_call:


jobs:
validate-dockerfile:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Validate Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
29 changes: 29 additions & 0 deletions .github/workflows/image-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Uses Trivy image scanner for CVEs — scans the built Docker image
name: Image Scanner

on:
workflow_call:


jobs:
image-scanner:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Trivy scanner
uses: aquasecurity/trivy-action@0.35.0
with:
image-ref: ${{ vars.DOCKERHUB_USER }}/bankapp:${{ github.sha }}
severity: 'CRITICAL,HIGH'
exit-code: '1'
trivyignores: .trivyignore
trivy-config: trivy.yaml
24 changes: 24 additions & 0 deletions .github/workflows/sast-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: SAST - Static Security Scan

on:
workflow_call:

permissions:
contents: read
security-events: write

jobs:
sast:
name: SAST - Semgrep
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Run Semgrep SAST Scanner
uses: semgrep/semgrep-action@v1
with:
config: >-
p/java
p/owasp-top-ten
p/secrets
Loading