Compare commits

...

34 Commits

Author SHA1 Message Date
pm c62b6321d7 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Successful in 1m1s
deploy updated
2026-05-11 14:00:30 +00:00
pm acfab03928 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Successful in 1m4s
atualizar deploy
2026-05-11 12:24:07 +00:00
pm 1a3296ae66 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Successful in 1m1s
atualizar deploy para download report
2026-05-08 16:47:03 +00:00
pm 666ec4ae28 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Successful in 1m2s
atualizar deploy file
2026-05-08 16:38:11 +00:00
pm 857db7df24 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 1m0s
atualizar deploy
2026-05-08 16:33:43 +00:00
pm 2af56ecc7f Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 59s
atualizar deploy file
2026-05-08 16:30:09 +00:00
pm 55e86d7602 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 34s
atualizar deploy file
2026-05-08 16:27:33 +00:00
pm 852ac6b30c Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 34s
atualizar deploy 66x
2026-05-08 16:21:12 +00:00
pm db474703e2 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Successful in 1m1s
atualizar deploy 4x
2026-05-08 16:10:17 +00:00
pm 134462e684 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Successful in 1m1s
deploy atualização
2026-05-08 15:58:34 +00:00
pm 1a2b983e56 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 1m0s
atualizar deploy file 2x
2026-05-08 15:43:42 +00:00
pm 39d50c72d5 Modificar .gitea/workflows/deploy.yaml
Atualizar deploy file 2x
2026-05-08 15:43:05 +00:00
pm 5a061a13fc Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 1m33s
atualizar porta sandbox
2026-05-08 15:38:20 +00:00
pm 9963e5339c test: validar pipeline integrada com Sandbox e OWASP ZAP
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 27s
2026-05-08 16:35:24 +01:00
pm 77188965aa Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate-and-deploy (push) Failing after 41s
atualizar deploy file
2026-05-08 15:31:56 +00:00
pm b2c52651bd Modificar index.html
DevSecOps Enterprise Pipeline / security-gate (push) Successful in 27s
DevSecOps Enterprise Pipeline / deploy (push) Successful in 3s
tudo  a funcionar
2026-05-08 12:17:53 +00:00
pm 0a838c5d63 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 25s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
asd
2026-05-08 12:15:11 +00:00
pm b8b7c22dc0 Eliminar trigger.txt
DevSecOps Enterprise Pipeline / security-gate (push) Successful in 20s
DevSecOps Enterprise Pipeline / deploy (push) Successful in 4s
2026-05-08 12:13:55 +00:00
pm d947b9a757 Eliminar forcar_trigger.txt
DevSecOps Enterprise Pipeline / security-gate (push) Successful in 20s
DevSecOps Enterprise Pipeline / deploy (push) Successful in 3s
2026-05-08 12:13:50 +00:00
pm 3a6358593b Eliminar .gitleaksignore
DevSecOps Enterprise Pipeline / security-gate (push) Successful in 21s
DevSecOps Enterprise Pipeline / deploy (push) Successful in 3s
2026-05-08 12:13:44 +00:00
pm 0f83b68319 Modificar .gitleaksignore
DevSecOps Enterprise Pipeline / security-gate (push) Successful in 20s
DevSecOps Enterprise Pipeline / deploy (push) Successful in 3s
asd
2026-05-08 12:09:41 +00:00
pm e5da932e69 Modificar .gitea/workflows/deploy.yaml
DevSecOps Enterprise Pipeline / security-gate (push) Successful in 21s
DevSecOps Enterprise Pipeline / deploy (push) Successful in 3s
asd
2026-05-08 12:07:51 +00:00
pm 0458ae118a Modificar .gitleaksignore
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
asd
2026-05-08 12:05:30 +00:00
pm cd8e83945c test: injetar vulnerabilidade XSS para avaliar SonarQube 6x
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 13:03:20 +01:00
pm 99173dea56 test: injetar vulnerabilidade XSS para avaliar SonarQube 5x
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 12:56:07 +01:00
pm 4786dea695 test: injetar vulnerabilidade XSS para avaliar SonarQube 4x
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 12:00:33 +01:00
pm ab0971646b Modificar index.html
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
asd
2026-05-08 10:57:40 +00:00
pm 967cdf3cad test: injetar vulnerabilidade XSS para avaliar SonarQube 3x
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 4s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 11:55:40 +01:00
pm 4636023ec1 test: injetar vulnerabilidade XSS para avaliar SonarQube 2x
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 11:54:41 +01:00
pm ab83d7ece0 test: injetar vulnerabilidade XSS para avaliar SonarQube
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 4s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 11:49:05 +01:00
pm 03ef21c347 test: adicionar chave Stripe para testar bloqueio
DevSecOps Enterprise Pipeline / security-gate (push) Failing after 3s
DevSecOps Enterprise Pipeline / deploy (push) Has been skipped
2026-05-08 11:45:23 +01:00
pm 5a240bbb59 test: adicionar chave Stripe para testar bloqueio 2026-05-08 11:45:23 +01:00
pm c33ca90825 test: adicionar chave Stripe para testar bloqueio do Gitleaks 2026-05-08 11:45:23 +01:00
pm 10b3b69312 test: adicionar chave Stripe simulada 2026-05-08 11:45:23 +01:00
5 changed files with 108 additions and 31 deletions
+107 -24
View File
@@ -4,7 +4,7 @@ on:
branches: [ main ]
jobs:
security-gate:
security-gate-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
@@ -12,19 +12,23 @@ jobs:
with:
fetch-depth: 0
# 1. SECRET SCANNING (Ativo: Ignora o commit antigo graças ao .gitleaksignore, mas bloqueia novas fugas)
# ==========================================
# STAGE 1: STATIC SECURITY TESTING (SAST, SCA)
# ==========================================
# 1.1. Secret Scanning: Detect hardcoded secrets and credentials
- name: Gitleaks Scan
run: |
curl -sL https://github.com/gitleaks/gitleaks/releases/download/v8.18.2/gitleaks_8.18.2_linux_x64.tar.gz | tar -xz -C /tmp
/tmp/gitleaks detect --source . --verbose --redact --exit-code 1
/tmp/gitleaks protect --source . --verbose --redact --staged --exit-code 1
# 2. SCA - Verifica vulnerabilidades no Nginx
# 1.2. Software Composition Analysis (SCA): Check for infrastructure vulnerabilities
- name: Scan Docker Image Vulnerabilities (Trivy)
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
trivy image --severity HIGH,CRITICAL nginx:alpine
# 3. SAST - Análise de Código com SonarQube
# 1.3. Static Application Security Testing (SAST): Source code quality and security
- name: SonarQube Analysis
run: |
curl -sL https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip -o sonar-scanner.zip
@@ -33,28 +37,107 @@ jobs:
-Dsonar.projectKey=website-test \
-Dsonar.sources=. \
-Dsonar.host.url=http://51.89.40.2:9000 \
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.qualitygate.wait=true
deploy:
needs: security-gate
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
# ==========================================
# STAGE 2: DYNAMIC TEST ENVIRONMENT
# ==========================================
# 4. DEPLOY ATÓMICO E HARDENING
- name: Hardened Deploy
- name: Provision Ephemeral Sandbox
run: |
docker exec website-test-backend tar -czf /tmp/index_backup.tar.gz -C /usr/share/nginx/html index.html || true
docker exec website-test-backend sh -c "rm -rf /usr/share/nginx/html/*"
docker cp index.html website-test-backend:/usr/share/nginx/html/index.html
docker exec website-test-backend chown root:root /usr/share/nginx/html/index.html
docker exec website-test-backend chmod 444 /usr/share/nginx/html/index.html
# Testar o acesso local por dentro do próprio container Nginx
docker exec website-test-backend curl --silent --show-error --fail http://localhost:80 || exit 1
# Remove any residual sandbox containers
docker rm -f website-test-sandbox || true
# Deploy sandbox. Using Docker internal network prevents external exposure.
docker run -d --name website-test-sandbox nginx:alpine
# Copy the current codebase to the sandbox container
docker cp index.html website-test-sandbox:/usr/share/nginx/html/index.html
# Allow Nginx service to initialize
sleep 5
# 5. AUDITORIA DE DEPLOY
- name: Slack/Discord Notification
# ==========================================
# STAGE 3: DYNAMIC APPLICATION SECURITY TESTING
# ==========================================
- name: OWASP ZAP Baseline Scan
run: |
# Initialize test report directory
mkdir -p qatests
# PREVENTIVE CLEANUP: Ensure no leftover containers or volumes exist
docker rm -f zap-scanner || true
docker volume rm zap-reports || true
# Create a managed Docker volume to prevent host/runner path conflicts
docker volume create zap-reports
# Execute ZAP scan mounting the managed volume.
# The '-I' flag ensures the pipeline doesn't fail on warnings.
docker run --user root --name zap-scanner \
--link website-test-sandbox:website-test-sandbox \
-v zap-reports:/zap/wrk/:rw \
-t ghcr.io/zaproxy/zaproxy:stable zap-baseline.py \
-t http://website-test-sandbox \
-r report.html \
-I || true
# Extract the HTML report from the ZAP container to the runner workspace
docker cp zap-scanner:/zap/wrk/report.html qatests/report.html
# Teardown ZAP container and volume to free up resources
docker rm -f zap-scanner || true
docker volume rm zap-reports || true
# Ensure sandbox is destroyed even if previous DAST steps fail
- name: Teardown Ephemeral Sandbox
if: always()
run: |
echo "Deploy finalizado com status: ${{ job.status }}"
docker rm -f website-test-sandbox || true
# ==========================================
# STAGE 4: PRODUCTION DEPLOYMENT
# ==========================================
- name: Hardened Production Deployment
run: |
# Create a backup of the current production state
docker exec website-test-backend tar -czf /tmp/index_backup.tar.gz -C /usr/share/nginx/html index.html || true
# Clear the production directory and deploy the approved artifact
docker exec website-test-backend sh -c "rm -rf /usr/share/nginx/html/*"
docker cp index.html website-test-backend:/usr/share/nginx/html/index.html
# Apply strict file system permissions (Hardening)
docker exec website-test-backend chown root:root /usr/share/nginx/html/index.html
docker exec website-test-backend chmod 444 /usr/share/nginx/html/index.html
# Healthcheck: Verify local response from the production container
docker exec website-test-backend curl --silent --show-error --fail http://localhost:80 || exit 1
# ==========================================
# STAGE 5: ARTIFACT MANAGEMENT & REPORTING
# ==========================================
- name: Publish ZAP Report to Production Web Server
if: always()
run: |
# Host the report directly on the Nginx container to bypass Gitea's artifact download bug
# Accessible at: http://51.89.40.2:8080/zap-report.html
docker cp qatests/report.html website-test-backend:/usr/share/nginx/html/zap-report.html || true
docker exec website-test-backend chmod 444 /usr/share/nginx/html/zap-report.html || true
- name: Archive ZAP Report (Raw HTML)
if: always()
uses: actions/upload-artifact@v3
with:
name: owasp-zap-report
# Upload the raw HTML file to Gitea Artifacts
path: qatests/report.html
- name: Pipeline Status Notification
if: always()
run: |
echo "Pipeline finished with status: ${{ job.status }}"
-2
View File
@@ -1,2 +0,0 @@
[allowlist]
commits = [ "ba0a1cd1a397bf43162e903f663876ee356ce32c" ]
-1
View File
@@ -1 +0,0 @@
"atualizacao-pipelines"
+1 -3
View File
@@ -3,12 +3,10 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nexus Solutions | Inovação Tecnológica</title>
<title>Nexus Solutions | Segurança e Inovação 2026</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50 text-gray-900 font-sans">
<!-- TODO: Remover esta chave de teste antes de ir para produção -->
<nav class="sticky top-0 bg-white/90 backdrop-blur-sm z-50 border-b border-gray-100 py-4 px-6 flex justify-between items-center">
<div class="text-2xl font-black text-blue-700 tracking-tighter">NEXUS<span class="text-gray-400">.</span></div>
<div class="hidden md:flex space-x-8 font-medium text-gray-600">
-1
View File
@@ -1 +0,0 @@
"teste"