Assignment 8 secure delivery foundation #17

Merged
nkogut merged 17 commits from assignment8/secure-delivery into main 2026-11-07 21:38:42 +00:00
2 changed files with 21 additions and 0 deletions
Showing only changes of commit b0e8cead18 - Show all commits
@@ -0,0 +1,19 @@
pipeline {
agent { label 'assignment8-trusted' }
options { skipDefaultCheckout(); timeout(time: 5, unit: 'MINUTES') }
stages {
stage('Checkout') { steps { checkout scm } }
stage('Authenticate target registry reader') {
steps {
withCredentials([sshUserPrivateKey(credentialsId: 'assignment8-deploy-ssh', keyFileVariable: 'DEPLOY_KEY', usernameVariable: 'DEPLOY_USER'), usernamePassword(credentialsId: 'assignment8-registry-read', usernameVariable: 'REG_USER', passwordVariable: 'REG_TOKEN')]) {
sh '''#!/bin/sh
set +x
set -eu
case "$REG_USER" in *[!a-zA-Z0-9_.-]*|'') echo 'Invalid registry username' >&2; exit 1;; esac
printf '%s' "$REG_TOKEN" | ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile="$WORKSPACE/secure-delivery/ansible/known_hosts" -i "$DEPLOY_KEY" "$DEPLOY_USER@172.20.0.1" "sudo -n docker login myfileagent.tech --username $REG_USER --password-stdin"
'''
}
}
}
}
}
+2
View File
@@ -66,3 +66,5 @@
## Proxy preparation ## Proxy preparation
- Validated and reloaded existing Caddy configuration with staging.myfileagent.tech -> pricing-staging:8000 and app.myfileagent.tech -> pricing-production:8000. Saved previous configuration at /home/codex/myfileagent-gitea/Caddyfile.before-assignment8. Gitea, Jenkins and Grafana HTTPS login routes returned 200 with certificate validation. New staging and app HTTPS endpoints returned 502 with certificate validation successful, expected before app containers exist. One initial staging DNS lookup timed out; retry reached HTTPS. - Validated and reloaded existing Caddy configuration with staging.myfileagent.tech -> pricing-staging:8000 and app.myfileagent.tech -> pricing-production:8000. Saved previous configuration at /home/codex/myfileagent-gitea/Caddyfile.before-assignment8. Gitea, Jenkins and Grafana HTTPS login routes returned 200 with certificate validation. New staging and app HTTPS endpoints returned 502 with certificate validation successful, expected before app containers exist. One initial staging DNS lookup timed out; retry reached HTTPS.
- Jenkinsfile.release.draft is untested and not enabled. It requires reviewed source on protected main, package publication rights, target registry authentication, scan and deployment validation before operational use. - Jenkinsfile.release.draft is untested and not enabled. It requires reviewed source on protected main, package publication rights, target registry authentication, scan and deployment validation before operational use.
- Prepared Jenkinsfile.registry-read-setup to configure root Docker registry authentication using a separate read-only Jenkins credential over pinned SSH. Draft only; not run. Root Docker configuration will hold authentication material and must be protected and removed after assessment.