Prepare Assignment 8 secure delivery and rollback
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good

Add the locked pricing service, trusted-agent pipeline, Ansible deployments, security gates, recovery runbooks, prerequisite evidence, and preparation manual.

Prepared with Codex assistance. Vincent explicitly authorized this local commit and will handle the push. Assessed releases and recovery exercises remain pending.
This commit is contained in:
2026-11-14 17:09:25 -05:00
parent 8beefde2a4
commit bf28adc7fb
51 changed files with 2091 additions and 14 deletions
+9 -2
View File
@@ -1,7 +1,12 @@
This group document records the SSW 590 coursework and its supporting
commands, designs, and evidence. Assignment 7 introduces site reliability
commands, designs, and evidence. Assignment 8 prepares secure delivery with
a trusted Jenkins agent, locked Flask/Gunicorn service, security gates,
Ansible, scoped deployment credentials and recovery runbooks. The prerequisite
job passed; reviewed v1/v2 publication, DNS/TLS, promotion, rollback and staging
recovery remain pending. This draft is not ready for submission.
Assignment 7 introduced site reliability
engineering: Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter
run as four pinned containers beside Gitea and Jenkins on the 1\,GiB
run as four pinned containers beside Gitea and Jenkins on the originally 1\,GiB
DigitalOcean droplet, with Grafana at \url{https://metrics.yebilly.me/login}
for approved networks only. A dashboard shows host CPU, memory, and disk and
the HTTPS availability of Gitea and Jenkins. A 99\% availability objective is
@@ -11,3 +16,5 @@ shown firing and resolving; the availability rule through a planned Jenkins
outage that was detected in about two minutes and recovered about a minute
after restart. Earlier chapters retain the group's prior assignment
results, including the Jenkins merge gate and the Gitea Actions manual build.
On November 14 the team resized the droplet to 2\,GiB without enlarging its
disk, updated packages and verified the existing services.
+55
View File
@@ -779,3 +779,58 @@ changed. The missed pre-deployment build observation remains a limitation;
later results do not recreate it. Commits, pushes, peer approval, and submission
remain with the group. This local revision is not described as an Actions
artifact or as already approved in Gitea.
\section{Assignment 8 Secure Delivery Preparation and Agent Setup}
Date: November 14, 2026; Tool: OpenAI Codex; Human: Vincent Sun.
Inputs: Vincent's request to implement the next assignment today, instructor
manual 1.43 Chapter 6 and Examples.zip, the Canvas assignment page, repository
AI requirements/guide, earlier configuration, and live read-only service checks.
Vincent retained commits/pushes and reported Billy unavailable until tonight.
Codex read the assignment, preserved prior work, verified remote main
\texttt{8beefde}, and created \texttt{codex/assignment8-secure-delivery}.
It adapted the instructor's v1 and Ansible starters, locked dependencies and
tool images, prepared a dedicated delivery pipeline, scan policy, immutable
release validation, idempotence gate, failure modes, observer and runbooks.
The original instructor authorship remains identified.
Human/AI corrections and execution: Vincent supplied his encrypted-key SSH
command and enabled Windows ssh-agent, initially also unloading the key; Codex
explained reloading it and keeping passphrases out of chat. Browser-console
and network limitations were distinguished from successful access. Vincent
resized The-Ocean to 2\,GiB while retaining disk size and applied host updates;
Codex verified resource and existing-service status. With authorization to
continue setup, Codex backed up Jenkins/Gitea, configured the restricted deploy
key and root sudo, separate package-scoped tokens under vsun1, folder-scoped
Jenkins credentials, exclusive laptop agent and disabled release job. Secret
values were transferred only through protected runtime storage and were not
printed or placed in Git. Agent prerequisite build 1 passed with real credential
binding, strict SSH host-key checking and noninteractive sudo.
Checks/corrections: local v1 tests passed; a generated wrong-price test failed
as intended; the scanner-supported synthetic fixture blocked delivery; the
dependency audit and final runtime-image gate passed their configured policies.
Earlier Debian and installer-containing Alpine scans failed and were retained;
Codex selected the Alpine runtime and removed unused pip/ensurepip without
adding scanner exceptions. The installed Jenkins parser rejected the initial
timestamps option because its plugin is absent; Codex removed that option and
retained explicit UTC evidence. Browser editor insertion briefly concatenated
two validation snippets; the editor was cleared and the read-only validation
repeated successfully. The host setup script compiled against installed plugin
classes before application. Ansible syntax and agent Compose checks passed.
Outputs used: \ChapterRef{SecureDelivery}, version 6.0 preparation, the adapted
application/toolchain, pipeline and control tests, bootstrap, runbooks, issue
draft, planned proxy and production-monitoring additions, actual prerequisite
inventory, Hosts/Passwords hints, history and this record. Existing Billy/Claude
records are unchanged. Source/configuration release SHAs and registry digests
have not been invented. The local preflight image explicitly identifies itself
as uncommitted preparation, not a reviewed release.
Unresolved items: application DNS requires the domain owner's access; distinct
names are explicitly required, so path-only routing was rejected as a substitute.
Vincent/Billy must create the issue, commit/push and review/merge v1 and later
changes. Real Jenkins blocked-gate runs, v1/v2 publication, interactive production
approvals, idempotence, both recovery exercises, timing/monitoring correlation
and final submission review remain pending. Proxy/monitoring additions are not
deployed before DNS and healthy production. No commit, push, peer review,
production approval or submission was performed by Codex.
+6 -5
View File
@@ -34,16 +34,16 @@
\definecolor{devopsLightBlue}{RGB}{232,240,247}
% Replace these values for each assignment.
\newcommand{\AssignmentTitle}{Grafana and Prometheus SRE -- Group}
\newcommand{\AssignmentNumber}{7}
\newcommand{\DocumentVersion}{5.1}
\newcommand{\AssignmentTitle}{Secure Delivery and Rollback -- Group}
\newcommand{\AssignmentNumber}{8}
\newcommand{\DocumentVersion}{6.0}
\newcommand{\DocumentStatus}{Draft}
\newcommand{\CourseNumber}{SSW 590}
\newcommand{\CourseName}{DevOps}
\newcommand{\Authors}{Vincent Sun and Billy Ye}
\newcommand{\Organization}{Stevens Institute of Technology}
\newcommand{\DocumentDate}{10/28/2026}
\newcommand{\DueDate}{Friday by 11:59pm}
\newcommand{\DocumentDate}{11/14/2026}
\newcommand{\DueDate}{November 13, 2026 (team reports an extension)}
% CI writes this ignored file in its checkout; ordinary local builds stay unchanged.
\providecommand{\CIBuildSuffix}{}
\InputIfFileExists{ci-build-metadata.tex}{}{}
@@ -148,6 +148,7 @@
\include{devopsAutomatedManualBuild}
\include{devopsJenkins}
\include{devopsSRE}
\include{devopsSecureDelivery}
\include{devopsHostsPasswords}
% Restore when a chapter cites devopsReferences.bib.
+1
View File
@@ -12,6 +12,7 @@ link each entry to the changed chapter, table, figure, or controlled artifact.
\multicolumn{4}{l}{\small\itshape Document Update History (continued)}\\
\toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule
\endhead \bottomrule \endlastfoot
November 14, 2026 / 6.0 preparation & VS, CDX & Prepared Assignment 8 with instructor v1 source, exact dependencies/base digest, trusted laptop Jenkins agent, security gates, Ansible, restricted production approval and recovery automation. Recorded actual local checks and passing agent prerequisite build 1. Vincent resized the droplet to 2\,GiB and updated packages; Codex configured deployment access, folder-scoped credentials and a disabled release job after backups. Added planned proxy/monitoring changes, architecture and runbooks. Updated Hosts and hints-only Passwords tables. Reviewed release commits, DNS/TLS, v1/v2 promotion, both recoveries and final evidence remain pending; this is a preparation draft. & \ChapterRef{SecureDelivery}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
October 28, 2026 / 5.1 & VS, CDX & Reviewed run-11 against instructor Chapter 5; added Vincent's external IPv4/IPv6 TCP retest (18 expected outcomes), pinned deployment links to the reviewed merge, recorded final PR approval and CI/build results, and qualified timing, sampling, and memory-pressure conclusions. Documented local TinyTeX builds to one ignored PDF. Hosts and Passwords tables are unchanged because no deployed service, account, or credential changed. & \ChapterRef{SREMonitoring}, \ChapterRef{AIPromptLog}\\
October 28, 2026 / 5.0 & BY, CD & Assignment 7: added \ChapterRef{SREMonitoring}. Deployed Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter on The-Ocean (pinned by digest, memory-capped, no host ports) after a capacity trial on the 1\,GiB plan; disabled four unused host services and added a second swap file; added \texttt{metrics.yebilly.me} behind the Jenkins allowlist and a private probe network. Recorded the dashboard, normal-build comparison, SLI/SLO worked example and measured window, contact-point, capacity-alert, collection-health, and Jenkins-outage tests with Discord notifications, restart persistence, blameless review, and improvement issues \#20 and \#21. After an independent review of the draft: added the collection-health rule and its test, replaced the initial Grafana administrator password, ran Blackbox Exporter as non-root, and added runbooks, network and storage detail in the diagram, host CPU checks, a targets table, citations with a Bibliography, and four corrected figures. \textbf{Updated the Hosts table} (monitoring containers, ports, volumes, \texttt{metrics} DNS, swap, monitoring and backup status) and \textbf{the Passwords table} (Grafana accounts, monitoring secrets file, Discord webhook). Set the Assignment 7 title page and abstract; added glossary terms. & Title and abstract, \ChapterRef{SREMonitoring}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
October 23, 2026 / 4.2 & VS, CDX & Corrected the Jenkins lockfile link to the recorded 63-plugin revision; clarified clean reproduction, Jenkins revision selection, and the unconfirmed webhook-timeout cause. Scoped the existing update-check result to the 63 checked plugins. Theme plugins are unchanged at Vincent's direction. Hosts and Passwords tables are unchanged because no service, account, or credential changed. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\
+26 -3
View File
@@ -19,6 +19,9 @@ On October 28, 2026 (\ChapterRef{SREMonitoring}) the droplet record gained
the four monitoring containers, \texttt{metrics.yebilly.me}, the second swap
file, and real monitoring status; the Passwords table gained the Grafana
accounts, the monitoring secrets file, and the Discord webhook.
On November 14, 2026 (\ChapterRef{SecureDelivery}), Vincent resized the droplet
to 2\,GiB and updated host packages. The tables gained deployment access and a
trusted laptop Jenkins agent. Pricing DNS and deployments remain pending.
\section{Hosts}
\small
@@ -36,8 +39,8 @@ since 28 Oct 2026 also the monitoring stack (Prometheus 3.15.1, Grafana OSS
stopped with restart policy \texttt{no}; its Caddy route remains\\
Environment & Course production (team use)\\
Provider & DigitalOcean, NYC1; Ubuntu 24.04 LTS; 1 vCPU; resized from
512\,MB to the 1\,GiB Basic plan in October 2026 (961\,MiB reported, 25\,GB
plan disk); swap files \texttt{/swapfile} and \texttt{/swapfile2}, 1\,GiB
512\,MB to 1\,GiB in October, then to 2\,GiB on November 14, 2026
(1,967\,MiB reported, original 25\,GB plan disk retained); swap files \texttt{/swapfile} and \texttt{/swapfile2}, 1\,GiB
each (second added 28 Oct 2026); \texttt{multipathd}, \texttt{fwupd},
\texttt{udisks2}, and \texttt{ModemManager} disabled and masked\\
Public address / DNS & IPv4 \texttt{147.182.178.136}; \texttt{A} records
@@ -62,7 +65,9 @@ otherwise; monitoring ports 9090, 9100, 9115 not reachable\\
Owner & BY (server administration); VS (review)\\
HTTPS URLs & \url{https://git.yebilly.me}, \url{https://ci.yebilly.me/login},
\url{https://metrics.yebilly.me/login}\\
Backup status & No backup job; container-replacement persistence verified for
Backup status & No scheduled backup job; manual Gitea SQLite and Jenkins-home
backups saved in a protected root directory before the November 14 delivery
bootstrap. Container-replacement persistence verified for
Gitea (\ChapterRef{GiteaFoundation}), restart persistence for Jenkins
(\ChapterRef{JenkinsCI}) and for Prometheus and Grafana
(\ChapterRef{SREMonitoring}); manual volume backup procedure in
@@ -89,6 +94,12 @@ Network path & Outbound HTTPS to \texttt{git.yebilly.me:443} and GitHub Actions
Execution label & \texttt{latex-local}; local image \texttt{ssw590-manual-ci:20261007}\\
Persistent state & Runner registration in named Docker volume \texttt{ssw590-local-runner-data}; compiler image retained in Docker Desktop\\
Availability & Start Docker Desktop and the versioned runner helper after reboot; laptop must remain awake for jobs\\
Assignment 8 agent & Separate Jenkins node \texttt{ssw590-vince-delivery},
label \texttt{delivery-trusted}, one exclusive executor; Docker/Python/Ansible/
scanners in image \texttt{ssw590-delivery-agent:20261114}; 2\,GiB / 2 CPU cap;
outbound HTTPS/WebSocket to Jenkins. Docker socket access is administrative.
Identity in \texttt{ssw590-delivery-identity}, workspace/cache in
\texttt{ssw590-delivery-workspace}; prerequisite build 1 passed on November 14.\\
Monitoring / backup & Runner logs and Gitea Actions checked manually; no automatic backup of runner registration configured\\
\end{tabularx}
\normalsize
@@ -104,6 +115,18 @@ Monitoring / backup & Runner logs and Gitea Actions checked manually; no automat
\endhead
\bottomrule \endlastfoot
Gitea local runner identity & VS & Docker volume \texttt{ssw590-local-runner-data}, file \texttt{/data/.runner}; generated identity, no values in Git; registration token supplied privately from repository settings & Repository runner; Docker control on VS laptop\\
Jenkins delivery agent identity & VS & Protected Jenkins-generated identity and local Docker volume
\texttt{ssw590-delivery-identity}; outside Git & Trusted laptop agent; Docker control\\
Deployment SSH key & VS & Jenkins folder \texttt{secure-delivery}, credential
\texttt{delivery-deploy-ssh}; encrypted in Jenkins home & \texttt{deploy} SSH;
passwordless root sudo for Ansible\\
Pinned deployment host key & VS & Same folder, file credential
\texttt{delivery-known-hosts}; public key verified over existing pinned SSH &
Strict host verification\\
Package-write token & VS & Same folder, credential \texttt{delivery-registry-write};
distinct named token under Gitea \texttt{vsun1}; no value in report & Package write only\\
Package-read token & VS & Root Docker login configuration on The-Ocean;
distinct named token under Gitea \texttt{vsun1}; bootstrap metadata retains name & Package read only\\
Gitea \texttt{bill} & BY & BY's password manager & Site administrator\\
Gitea \texttt{vsun1} & VS & VS's password manager & Repository administrator\\
Gitea \texttt{jenkins-bot} (added 22 Oct 2026) & BY & BY's password manager; used only to create its token & Write collaborator on \texttt{vpn-dns-gateway}\\
+251
View File
@@ -0,0 +1,251 @@
\chapter{Secure Delivery and Rollback}
\ChapterLabel{SecureDelivery}
\index{secure delivery}\index{rollback}\index{Ansible}\index{immutable image}
\section{Scope and Current Status}
Assignment 8 implements Chapter 6 of instructor manual version 1.43, using its
Startup Pricing Service and the existing Gitea, Jenkins, Caddy and monitoring
foundation. The Canvas page lists November 13, 2026 at 11:59pm; Vincent reports
an extension. This version records preparation on November 14, not a completed
release exercise. \textbf{It is not ready for submission.} Reviewed v1/v2
publication, promotion, production rollback, staging failure/recovery and
monitoring correlation remain pending. No approval, release digest or successful
deployment is inferred from a tool installation or local smoke test.
The instructor's v1 source and tests were copied from
\path{Examples/dosSecureDelivery/v1/} to \path{delivery/app/}. Flask validates
requests and calculates the price; Gunicorn serves it with one worker on private
port 8000. There is no payment processing, customer data or application volume.
For three units v1 returns USD 30; the separate v2 source/test change must return
USD 36. The image embeds its actual source commit during the build. Health,
identity and pricing are verified separately.
\section{Deployment and Trust Boundaries}
\begin{figure}[htbp]
\centering
\renewcommand{\theHfigure}{delivery.\arabic{figure}}
\resizebox{\linewidth}{!}{%
\begin{tikzpicture}[
box/.style={draw=devopsBlue,rounded corners,align=center,text width=3.6cm,
minimum height=1.5cm,font=\footnotesize,fill=white},
data/.style={box,draw=devopsGray,fill=gray!12,font=\scriptsize},
planned/.style={box,dashed,fill=devopsLightBlue},
flow/.style={-{Latex},thick}, note/.style={font=\scriptsize,align=center,fill=white,inner sep=1pt}]
\node[box] (agent) at (4.8,2.7) {Vincent's laptop\\Trusted delivery agent\\Docker, scans and Ansible};
\node[data,text width=3.8cm] (local) at (0,2.7) {Local Docker volumes\\\texttt{ssw590-delivery-identity}\\\texttt{ssw590-delivery-workspace}};
\node[box] (git) at (0,0) {Gitea + OCI registry\\\texttt{git.yebilly.me}\\SQLite retained};
\node[box] (jenkins) at (4.8,0) {Jenkins controller\\\texttt{ci.yebilly.me}\\Schedules trusted job};
\node[box] (host) at (9.6,0) {The-Ocean host\\\texttt{deploy} SSH account\\Python, Docker/Compose};
\node[box] (monitor) at (0,-2.8) {Prometheus, Grafana,\\Blackbox and Node Exporter\\Private metrics ports};
\node[box] (proxy) at (4.8,-2.8) {Caddy TLS proxy\\Public 80/443\\Private \texttt{gitea\_web} network};
\node[planned] (stage) at (9.6,-2.8) {Planned staging app\\\texttt{staging.yebilly.me}\\{\scriptsize\texttt{pricing-staging:8000}}};
\node[planned] (prod) at (9.6,-5.2) {Production app (planned)\\\texttt{app.yebilly.me}\\{\scriptsize\texttt{pricing-production:8000}}};
\node[data,text width=12.9cm,align=left] (storage) at (4.8,-8.45) {
\textbf{Persistent state and read-only mounts on The-Ocean}\\[3pt]
\begin{tabular}{@{}ll@{}}
Gitea & \texttt{gitea\_gitea-data} $\rightarrow$ \texttt{/data} (includes SQLite)\\
Jenkins & \texttt{gitea\_jenkins-home} $\rightarrow$ \texttt{/var/jenkins\_home}\\
Caddy certificates & \texttt{gitea\_caddy-data} $\rightarrow$ \texttt{/data}\\
Caddy configuration & \texttt{gitea\_caddy-config} $\rightarrow$ \texttt{/config}\\
Prometheus & \texttt{monitoring\_prometheus\_data} $\rightarrow$ \texttt{/prometheus}\\
Grafana & \texttt{monitoring\_grafana\_data} $\rightarrow$ \texttt{/var/lib/grafana}\\
Proxy bind mount & \texttt{/root/gitea/Caddyfile} $\rightarrow$ \texttt{/etc/caddy/Caddyfile} (ro)\\
Monitoring mounts & \texttt{/root/monitoring/}: configuration (ro); host \texttt{/} $\rightarrow$ \texttt{/host} (ro)\\
Planned app config & \texttt{/opt/startup/pricing-\{staging,production\}}; no app data volume
\end{tabular}};
\node[draw,dashed,rounded corners,fit=(git)(host)(monitor)(prod)(storage),
inner sep=0.55cm,label={[font=\small]below:Existing droplet: 1 vCPU, 2 GiB RAM, 25 GB plan disk}] {};
\draw[flow,dotted] (local)--(agent);
\draw[flow] (agent)--node[note,right,pos=0.25]{HTTPS}(jenkins);
\draw[flow] (agent.south west)--node[note,above,sloped]{Git / OCI}(git.north east);
\draw[flow] (agent.south east)--node[note,above,sloped]{SSH}(host.north west);
\draw[flow] (git)--node[note,above]{hook}(jenkins);
\draw[flow,dashed] (host)--node[note,right]{apply}(stage);
\draw[flow,dashed] (host.east)--++(0.35,0)|-(prod.east);
\draw[flow,dashed] (monitor)--node[note,above]{probe}(proxy);
\draw[flow,dashed] (proxy)--node[note,above]{HTTP}(stage);
\draw[flow,dashed] (proxy.south east)--node[note,above,sloped]{HTTP}(prod.north west);
\end{tikzpicture}}
\caption{Preparation architecture. Solid boxes are installed; dashed blue boxes
and connections are planned application work. Gray boxes identify durable state
or read-only mounts. Pricing is stateless; each environment retains only its
Compose and release files on the host. The agent and its Docker socket are on
the laptop, outside the droplet.}
\label{Figure:SecureDeliveryArchitecture}
\end{figure}
The exclusive node \texttt{ssw590-vince-delivery} has one executor and label
\texttt{delivery-trusted}. It connects to Jenkins over HTTPS/WebSocket, with no
published agent or Docker API port. Docker socket membership (group 0 in the
Linux VM) grants administrative Docker control. The \texttt{deploy} account's
\texttt{NOPASSWD} sudo permits root commands for Ansible; a separate account
does not remove that administrative authority. Its authorized key disables SSH
forwarding and PTY allocation. The host's ED25519 key was read through the
existing strictly pinned administrator SSH connection and stored as a Jenkins
file credential; verification is not disabled.
Deployment credentials belong to the \texttt{secure-delivery} Jenkins folder,
not the root multibranch PR job. That job retains its earlier ordinary tests,
plus Python syntax and release-control tests; it does not bind delivery
credentials or a Docker socket. The new release job loads
\path{delivery/Jenkinsfile} from protected main and is currently disabled.
Only trusted reviewed code may use the privileged node. Exclusive scheduling
is not a defense against an administrator or an author permitted to select that
node; the two-member repository and Jenkins administration remain trust boundaries.
Shared proxy-network membership is a lab simplification, not strong lateral
isolation. Both environments share the droplet's failure domain.
\section{Installation Inventory and Preparation Evidence}
\small
\begin{longtable}{@{}L{3.0cm}L{9.9cm}@{}}
\toprule Item & Verified selection or result\\\midrule\endhead
Trusted agent & Python 3.13.5; Ansible core 2.21.6 in
\texttt{/opt/delivery-tools}; community.docker 5.4.0 and its
community.library\_inventory\_filtering\_v1 dependency 1.1.5.\\
Build and scan tools & Docker 29.9.3, Compose 5.7.1, Trivy 0.76.2 and
pip-audit 2.10.1. Base tool images are pinned in the agent Dockerfile;
direct/transitive Python tools and collections are locked in Git.\\
Target & Ubuntu 24.04 LTS; Python 3.12.3; Docker 29.9.3 and Compose 5.7.1.
At 20:46 UTC: 1,967 MiB RAM, 878 MiB available, 102 MiB swap used; root
filesystem 41\% used. This is one prerequisite sample, not a load test.\\
Runtime image & Python 3.13 Alpine, Linux/amd64, selected registry digest:
\newline\texttt{sha256:9ef1a599f863231c3d91e941389bfdc4}\allowbreak%
\texttt{a2d6070557243d54df1a4e57015b960e}.\\
Application lock & Flask 3.1.3; Gunicorn 23.0.0; blinker 1.9.0; click 8.5.1;
itsdangerous 2.2.0; Jinja2 3.1.6; MarkupSafe 3.0.4; packaging 26.3;
Werkzeug 3.1.9. No claim is made that a pinned version remains vulnerability-free.\\
Runtime constraints & UID 10001; one Gunicorn worker; 64 MiB RAM / 96 MiB
RAM+swap; 0.25 CPU; 64 PIDs; read-only root; 16 MiB temporary filesystem;
all capabilities dropped and no host application port.\\
Jenkins prerequisite run &
\href{https://ci.yebilly.me/job/secure-delivery/job/agent-preflight/1/}{Agent preflight build 1}
passed on November 14 at 20:46 UTC, including strict-key SSH as deploy and
noninteractive sudo. \path{delivery/evidence/agent-preflight-1.txt} preserves
its non-secret inventory. This run did not deploy an application.\\
Local tests & Three Flask tests passed; a generated wrong-price assertion
failed as intended; twelve release/security-control tests passed. Gunicorn
health/identity/price/invalid-input smoke checks passed under the stated cap.
Its baked identity was explicitly \texttt{uncommitted-preflight}, not a release SHA.\\
Local scans & Source/dependency gates passed; a generated synthetic secret
blocked the gate. At 20:32 UTC the complete runtime-image gate passed with no
HIGH/CRITICAL findings. Reports and exit codes remain in ignored local evidence.
Assessed Jenkins gate runs and published-image scans remain pending.\\
\bottomrule
\end{longtable}
\normalsize
Vincent resized the droplet while keeping its 25 GB plan disk, then updated
packages. Post-maintenance checks found all seven earlier containers running,
no failed systemd services, no required reboot marker, and HTTP 200 for Gitea,
Jenkins and Grafana from the laptop. Before administrator bootstrap, a protected
consistent Jenkins-home archive and an online Gitea SQLite backup were saved
under \path{/root/ssw590-delivery-bootstrap/}. The one-time setup then created
the deploy key, distinct package-only tokens under \texttt{vsun1}, the folder,
node and disabled release job. No token or private key was printed or copied
into the repository. Private bootstrap inputs were removed after Jenkins stored
the credentials; generated agent identity stays in protected named volumes.
\section{Prepared Pipeline and Release Records}
The normal release path is checkout of reviewed main ancestry, control and
application tests, repository-secret and dependency checks, build, image scan,
registry push/pull, exact digest recording, staging deployment, unchanged rerun,
human approval, and production deployment. Existing commit tags are reused on
retry rather than overwritten. A new image is scanned before push and again by
its registry digest. The same digest is promoted without rebuilding. Concurrent
delivery builds are disabled. Release and scan reports are archived on failure
and before the approval prompt.
The policy in \path{delivery/SECURITY.md} was selected before the scans: block
detected secrets, HIGH/CRITICAL image findings (including unfixed issues), all
reported Python dependency advisories, scanner errors and missing/malformed
reports. No exceptions are approved. A proposed exception requires instructor
acceptance, advisory ID, owner, rationale, controls and expiry. Earlier Debian
and installer-containing Alpine preflight scans failed; their reports were
retained. The runtime was changed to the pinned Alpine base and unneeded pip/
ensurepip were removed; the scanner policy was not weakened.
The release record contains source and configuration commits, exact registry
digest, version/expected total, environment, public URL, proxy network, build
URL and creation time. Both commits must be ancestors of protected main. Only
the expected team registry, URL/environment pair and metadata fields are
accepted. Production requires an input restricted to \texttt{billy,vsun1},
with a 20-minute timeout; the actual human approval and UTC time are recorded.
Administrators retain their normal override powers. No unattended approval is
claimed. Ansible restores the selected playbook/template from the recorded
configuration commit, deploys without rebuilding, waits for health, then checks
HTTPS health, version, source commit and price. A separate JSON recap records
timing and makes a nonzero changed count on the unchanged rerun a blocking error.
\small
\begin{tabularx}{\linewidth}{L{2.1cm}Y Y}
\toprule Traceability field & v1 & v2\\\midrule
Source / config commits & Pending review and merge & Separate change pending\\
Registry digest / Jenkins release build & Not published / not run & Not published / not run\\
Staging + unchanged rerun & Pending & Pending\\
Production approval / result & No approval or promotion yet & No approval or promotion yet\\
Recovery evidence & Healthy rollback pending & Staging failure/recovery pending\\
\bottomrule
\end{tabularx}
\normalsize
\section{Release, Recovery and Monitoring Runbooks}
The versioned \path{delivery/RUNBOOKS.md} gives the executable sequence.
Vincent handles commits/pushes; Billy reviews repository changes. Once reviewed
v1 is on main and DNS/TLS are ready, enable the delivery job, demonstrate
\texttt{blocked-test} and \texttt{blocked-secret}, then run \texttt{release}.
Verify staging and changed=0 before a real human approval promotes v1. Save and
review its generated staging/production records. Apply the supplied v2 source
and test changes in another reviewed commit and repeat, expecting 36.
For healthy production rollback, record detection/decision time, start the
HTTPS observer, select the committed v1 production record and approve the
operation. Ansible restores its original image and configuration, then verifies
v1, original source SHA and total 30. Preserve start, recovery, verification and
sampled interruption. A zero-failure sample set cannot prove zero downtime
between requests.
For failed staging deployment recovery, use a separate reviewed configuration
commit to bind Gunicorn to 8001 only in staging while the image healthcheck
still probes 8000. Run \texttt{staging-failure} with the good v2 staging release
record and bad configuration SHA. Compose wait must fail and Jenkins must stop
before production. Restore/review the correct template and rerun
\texttt{recover-staging} with the original good record. Verify v2, its source,
total 36 and changed=0. Do not alter shared infrastructure or data to create
the failure.
The production \texttt{/health} probe and Grafana availability panel are prepared
in Git but not deployed while production is absent. Apply them after health is
verified, keeping existing Gitea/Jenkins probes and host metrics. Correlate real
Prometheus/Grafana samples with release/rollback times; 30-second scrapes and
alert durations can miss a brief interruption. Uptime probes do not verify
pricing. The observer in \path{delivery/ci/observe.py} records finer HTTPS
samples without treating an intended failure as an observer-script failure.
This stateless service needs no database restore. A real incompatible schema,
external payment or stored state could make image-only rollback unsafe. A
compatible expand/migrate/contract approach keeps both old and new code working
during migration and delays destructive changes until rollback is no longer
needed. This assignment does not add a database.
\section{Outstanding Work and Cleanup Boundary}
The domain owner must create two A records: \texttt{staging} and \texttt{app}.
Both must point to \texttt{147.182.178.136}. Neither resolved during
preparation. Distinct DNS hostnames are an explicit instructor requirement, so
an existing-host path substitute is not described as equivalent. The prepared
Caddy additions must be validated and reloaded after DNS is correct, without
removing earlier routes or certificate storage. The public application port is
HTTPS 443, with internal port 8000 remaining private.
The issue draft, feature branch and code are prepared locally. Issue creation,
commit/push, peer review/merge, both assessed releases, production approvals,
both recovery demonstrations, final traceability and monitoring evidence, and
the final submission review remain outstanding. Local checks are not a
replacement for those executions.
After grading, only when instructed, retain required evidence and remove only
the two pricing projects, their routes, monitoring additions and test DNS.
Revoke their package tokens; retire deploy access and the delivery node/folder
after preserving job history. Do not prune Docker or use \texttt{down -v}.
Preserve earlier Gitea/Jenkins/proxy/monitoring services and all shared volumes.
The local agent, cache/identity volumes and protected remote backup are retained
while work and assessment remain in progress.