Address re-audit findings in the Jenkins chapter (v4.1)
- Add a table of all 14 Gitea webhook deliveries with commits and results, and diagnose the real timed-out delivery #3 (Jenkins still queued the build two seconds later). - Redraw the deployment figure as a UML deployment diagram with <<device>>/<<container>>/<<artifact>>/<<executionEnvironment>> stereotypes; route checkout and status through Caddy. - Show the stored Jenkins URL, free disk space, and reconciled plugin counts (59 tested, 63 locked, 66 installed). - Correct wording on push rights (jenkins-bot also has Write), the resource-limit change, five corrective actions, startup timings, and the AI log's backup statement; quote the run-1 checkout. - Fix the stray tab that printed "extttStevens-Net", the stale "version 4.0" sentence, and the overflowing VPN table row; note that grader IPs are removed from .env after grading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -113,8 +113,10 @@ Jenkins is a third service in the existing
|
||||
The first deployment kept the test's limits (256\,MiB RAM, 128\,MiB heap,
|
||||
0.5 CPU). Builds worked, but the setup wizard and plugin pages hung with
|
||||
\texttt{OutOfMemoryError: Java heap space} once Jenkins loaded the
|
||||
update-center catalog. The limits were doubled to those shown above at
|
||||
03:35; Jenkins then answered in 45\,s instead of 184\,s, used about
|
||||
update-center catalog. At 03:35 the limits were raised to those shown above
|
||||
(RAM and heap doubled to 512\,MiB and 256\,MiB, RAM plus swap 512 to
|
||||
768\,MiB, CPU 0.5 to 0.75); Jenkins then answered in 45\,s instead of
|
||||
184\,s on its next start, used about
|
||||
350\,MiB, and left about 180\,MiB of host RAM available with Gitea still
|
||||
returning 200. The service runs one executor so only one build uses memory
|
||||
at a time.
|
||||
@@ -221,7 +223,14 @@ ci.yebilly.me {
|
||||
\texttt{CI\_TEAM\_IPS} is read from the untracked, root-only
|
||||
\texttt{\textasciitilde/gitea/.env}, so home addresses are not in Git. Caddy's
|
||||
\texttt{reverse\_proxy} forwards the \texttt{X-Forwarded-*} headers, and the
|
||||
Jenkins URL is set to \texttt{https://ci.yebilly.me/}.
|
||||
Jenkins URL (\emph{Manage Jenkins $\rightarrow$ System $\rightarrow$ Jenkins
|
||||
Location}) is \texttt{https://ci.yebilly.me/}, as stored in the controller's
|
||||
configuration (read on the droplet, October 23):
|
||||
\begin{minted}{text}
|
||||
$ docker exec gitea-jenkins-1 grep jenkinsUrl \
|
||||
/var/jenkins_home/jenkins.model.JenkinsLocationConfiguration.xml
|
||||
<jenkinsUrl>https://ci.yebilly.me/</jenkinsUrl>
|
||||
\end{minted}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
@@ -251,7 +260,7 @@ HTTPS \texttt{ci} via droplet IPv6 & IPv6, not allowlisted; Oct 23 01:02:42 & 40
|
||||
HTTP \texttt{ci} via IPv6 & same & redirect & 308 \StatusPass\\
|
||||
TCP 8080, 50000, 3000 via IPv6 & same & closed & closed/filtered \StatusPass\\
|
||||
HTTPS \texttt{ci\ldots/login} from campus & \texttt{Stevens-Net}, \texttt{155.246.151.38} (Vincent); Oct 23 & 200 & Sign-in page shown \StatusPass\\
|
||||
Public IPv4 while on Stevens VPN & GlobalProtect connected; Oct 23 18:56:13 & \texttt{155.246.x.x} & Unchanged residential address; VPN is split-tunnel, so not offered as an access path\\
|
||||
Public IPv4 while on Stevens VPN & GlobalProtect connected; Oct 23 18:56:13 & Stevens address & Unchanged residential address; VPN is split-tunnel, so not offered as an access path \textbf{\footnotesize INFO}\\
|
||||
\bottomrule
|
||||
\end{tabularx}}
|
||||
|
||||
@@ -304,29 +313,30 @@ droplet.
|
||||
box/.style={draw, rounded corners, align=center, font=\small, minimum height=1.0cm},
|
||||
lbl/.style={font=\scriptsize, fill=white, inner sep=1pt},
|
||||
arr/.style={-{Stealth}, thick}]
|
||||
\node[box] (browser) at (0,0) {Team / instructor\\browser};
|
||||
\node[box, fill=devopsLightBlue] (fw) at (4.3,0) {Cloud Firewall\\\texttt{gitea-fw}\\443 / 80};
|
||||
\node[box] (caddy) at (8.6,0) {Caddy TLS proxy\\allowlist for \texttt{ci}\\alias \texttt{git.yebilly.me}};
|
||||
\node[box] (gitea) at (13.2,1.9) {Gitea \texttt{:3000}};
|
||||
\node[box] (jenkins) at (13.2,-1.9) {Jenkins controller \texttt{:8080}\\\textbf{builds run here}\\(1 executor)};
|
||||
\node[box] (gvol) at (17.4,1.9) {\texttt{gitea-data}\\SQLite + repos};
|
||||
\node[box] (jvol) at (17.4,-1.9) {\texttt{jenkins-home}\\jobs, users,\\credentials};
|
||||
\node[box] (browser) at (0,0) {\guillemotleft device\guillemotright\\Team / instructor\\browser};
|
||||
\node[box, fill=devopsLightBlue] (fw) at (4.3,0) {\guillemotleft device\guillemotright\\Cloud Firewall\\\texttt{gitea-fw}, 443 / 80};
|
||||
\node[box] (caddy) at (8.6,0) {\guillemotleft container\guillemotright\\Caddy TLS proxy\\allowlist for \texttt{ci}\\alias \texttt{git.yebilly.me}};
|
||||
\node[box] (gitea) at (13.6,2.2) {\guillemotleft container\guillemotright\\Gitea \texttt{:3000}};
|
||||
\node[box] (jenkins) at (13.6,-3.0) {\guillemotleft container\guillemotright\\Jenkins controller \texttt{:8080}\\\textbf{builds run here}\\(1 executor)};
|
||||
\node[box] (gvol) at (18.4,2.2) {\guillemotleft artifact\guillemotright\\\texttt{gitea-data}\\SQLite + repos};
|
||||
\node[box] (jvol) at (18.4,-3.0) {\guillemotleft artifact\guillemotright\\\texttt{jenkins-home}\\jobs, users,\\credentials};
|
||||
\draw[arr] (browser) -- node[lbl, above=2pt]{HTTPS} (fw);
|
||||
\draw[arr] (fw) -- (caddy);
|
||||
\draw[arr] (caddy.north) |- node[lbl, pos=0.75]{HTTP} (gitea.west);
|
||||
\draw[arr] (caddy.south) |- node[lbl, pos=0.75]{HTTP} (jenkins.west);
|
||||
\draw[arr, dashed, devopsGreen] ([xshift=-6mm]gitea.south) -- node[lbl, left=2pt]{1. webhook} ([xshift=-6mm]jenkins.north);
|
||||
\draw[arr, dashed, devopsBlue] ([xshift=6mm]jenkins.north) -- node[lbl, right=2pt, align=left]{2. checkout + status\\via Caddy alias} ([xshift=6mm]gitea.south);
|
||||
\draw[arr, dashed, devopsGreen] (gitea.south) -- node[lbl, right=2pt]{1. webhook (private)} (jenkins.north);
|
||||
\draw[arr, dashed, devopsBlue] (jenkins.north west) -- node[lbl, pos=0.5, left=3pt]{2. checkout + status} (caddy.south east);
|
||||
\draw[arr] (gitea) -- (gvol);
|
||||
\draw[arr] (jenkins) -- (jvol);
|
||||
\node[draw, dashed, rounded corners, fit=(caddy) (gitea) (jenkins) (gvol) (jvol), inner sep=8pt,
|
||||
label={[font=\scriptsize]above:Droplet \texttt{The-Ocean} (1\,GiB) / Docker network \texttt{gitea\_web}}] {};
|
||||
\node[draw, dashed, rounded corners, fit=(caddy) (gitea) (jenkins) (gvol) (jvol), inner sep=10pt,
|
||||
label={[font=\scriptsize]above:\guillemotleft device\guillemotright\ Droplet \texttt{The-Ocean} (1\,GiB) / \guillemotleft executionEnvironment\guillemotright\ Docker network \texttt{gitea\_web}}] {};
|
||||
\end{tikzpicture}}
|
||||
\caption{Actual deployment, October 2026. Only Caddy's 80/443 are public.
|
||||
Gitea sends the webhook to \texttt{http://jenkins:8080} on the private
|
||||
network; Jenkins checks out code and posts statuses to
|
||||
\texttt{https://git.yebilly.me}, which resolves to Caddy inside the Docker
|
||||
network. Builds run on the controller; there is no separate agent.}
|
||||
\caption{UML deployment diagram of the actual deployment, October 2026. Only
|
||||
Caddy's 80/443 are public. (1) Gitea sends the webhook to
|
||||
\texttt{http://jenkins:8080} on the private network. (2) Jenkins checks out
|
||||
code and posts statuses to \texttt{https://git.yebilly.me}, which resolves to
|
||||
Caddy inside the Docker network; Caddy forwards to Gitea. Builds run on the
|
||||
controller; there is no separate agent.}
|
||||
\label{Figure:JenkinsDeployment}
|
||||
\end{figure}
|
||||
|
||||
@@ -378,8 +388,35 @@ in one header is blurred.}
|
||||
\label{Figure:JenkinsWebhook}
|
||||
\end{figure}
|
||||
|
||||
All 14 deliveries to date, read from Gitea's delivery records on October 23,
|
||||
are summarized in Table~\ref{Table:JenkinsDeliveries}.
|
||||
|
||||
{\small
|
||||
\begin{tabularx}{\linewidth}{L{0.6cm}L{2.7cm}L{2.6cm}L{1.4cm}Y}
|
||||
\caption{Gitea webhook deliveries to Jenkins (UTC)\label{Table:JenkinsDeliveries}}\\
|
||||
\toprule \textbf{\#} & \textbf{Time} & \textbf{Event} & \textbf{Commit} & \textbf{Result}\\ \midrule
|
||||
1 & Oct 22 22:54:06 & test push & --- & 200 \texttt{Processed}\\
|
||||
2 & Oct 22 22:57:43 & push & \texttt{ad35197} & 200; started branch job\\
|
||||
3 & Oct 22 23:01:59 & PR \#15 opened & \texttt{ad35197} & \textbf{failed}: client timeout awaiting headers (see below)\\
|
||||
4--5 & Oct 22 23:10:32 & push, PR synchronized & \texttt{52b297c} & 200; started PR-15 run 2\\
|
||||
6--7 & Oct 22 23:15:09 & push, PR synchronized & \texttt{9381d2a} & 200; started PR-15 run 3\\
|
||||
8--9 & Oct 23 00:55:22 & PR closed, push & \texttt{9381d2a}, \texttt{420ba4c} & 200; started main run 1\\
|
||||
10--14 & Oct 23 01:21--01:24 & push, PR \#16 events & \texttt{1149e9f}, \texttt{e4f3ce5} & 200; started PR-16 run 1 and main run 2\\
|
||||
\bottomrule
|
||||
\end{tabularx}}
|
||||
|
||||
\paragraph{Diagnosing a failed delivery.}
|
||||
If a push does not start a build: (1) open \emph{Repository Settings
|
||||
Delivery~3 is a real failure. Gitea recorded \texttt{Post
|
||||
"http://jenkins:8080/gitea-webhook/post": context deadline exceeded
|
||||
(Client.Timeout exceeded while awaiting headers)}. Diagnosis: Jenkins did
|
||||
receive the event, because Gitea shows PR-15's status ``Build queued'' at
|
||||
23:02:01, two seconds later, and run~1 passed at 23:02:18. Jenkins answered
|
||||
after Gitea's delivery timeout because it was busy with the PR discovery on
|
||||
its 0.75-CPU limit. No action was needed; had the build not started,
|
||||
\emph{Redeliver} on that delivery, or \emph{Scan Multibranch Pipeline Now},
|
||||
would recover it, and raising Gitea's \texttt{webhook.DELIVER\_TIMEOUT}
|
||||
would prevent repeats. General procedure if a push does not start a build:
|
||||
(1) open \emph{Repository Settings
|
||||
$\rightarrow$ Webhooks $\rightarrow$ jenkins-ci $\rightarrow$ Recent
|
||||
Deliveries} and read the response; (2) ``can only call allowed HTTP
|
||||
servers'' means \texttt{ALLOWED\_HOST\_LIST} was lost, so recreate the Gitea
|
||||
@@ -527,8 +564,9 @@ Merge & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/commit/420ba4
|
||||
\end{tabularx}
|
||||
|
||||
Each Jenkins log names the commit it checked out
|
||||
(\texttt{Checking out Revision 52b297c2f338\ldots} for run~2,
|
||||
\texttt{9381d2aa9a11\ldots} for run~3), and each matches the PR head shown
|
||||
(\texttt{Checking out Revision ad35197ee490\ldots} for run~1,
|
||||
\texttt{52b297c2f338\ldots} for run~2, \texttt{9381d2aa9a11\ldots} for
|
||||
run~3), and each matches the PR head shown
|
||||
in Gitea at that time. The branch job \texttt{feature/issue-14}~\#1 also
|
||||
passed on \texttt{ad35197} before the PR existed; its context
|
||||
\texttt{vpn-dns-gateway/pipeline/head} is not the required one.
|
||||
@@ -565,9 +603,10 @@ credentials and their key, so a malicious \texttt{Jenkinsfile} could steal
|
||||
the bot token.\footnote{\url{https://www.jenkins.io/doc/book/security/controller-isolation/}}
|
||||
Compensating restrictions:
|
||||
\begin{itemize}[nosep]
|
||||
\item Only Billy and Vincent can push to the repository, so only they can
|
||||
change the \texttt{Jenkinsfile}; \texttt{main} accepts changes only through
|
||||
reviewed PRs.
|
||||
\item Only Billy and Vincent, plus the \texttt{jenkins-bot} identity whose
|
||||
token exists only inside Jenkins, have write access to the repository, so
|
||||
only they can change the \texttt{Jenkinsfile}; \texttt{main} accepts changes
|
||||
only through reviewed PRs, which also applies to the bot.
|
||||
\item PRs from forks are not discovered, so untrusted code never runs.
|
||||
\item No Docker socket is mounted and the container is not privileged; its
|
||||
memory, CPU, and process count are capped.
|
||||
@@ -578,7 +617,11 @@ Jenkins.
|
||||
|
||||
\paragraph{Plugin-update check.}
|
||||
On October 23 at 01:03, the 63 locked plugins were compared with the Jenkins
|
||||
update center for core 2.580.1. One newer version exists
|
||||
update center for core 2.580.1. (Counts: the capacity bundle had 59;
|
||||
\texttt{matrix-auth} and \texttt{pipeline-graph-view} with its two
|
||||
dependencies make 63 locked; Jenkins reports 66 installed, the other three
|
||||
being the theme plugins described in Section~\ref{Section:JenkinsQuality},
|
||||
which this check did not cover.) One newer version exists
|
||||
(\texttt{workflow-api} \texttt{1413.v2ff1a\_5e720fa\_} $\rightarrow$
|
||||
\texttt{1429.v7a\_1b\_efb\_a\_f7c5}); no security warning matches any installed
|
||||
version. The update was deferred: it is not a security fix and would change
|
||||
@@ -602,7 +645,7 @@ Section~\ref{Section:JenkinsTrigger}. Memory trouble (slow pages,
|
||||
\label{Section:JenkinsQuality}
|
||||
|
||||
\paragraph{Corrective actions.}
|
||||
Four problems were found and fixed during this work, each recorded with its
|
||||
Five problems were found and fixed during this work, each recorded with its
|
||||
evidence: (1) the official plugin installer ran out of its 128\,MiB heap while
|
||||
reading the update-center catalog, so the Dockerfile downloads the pinned
|
||||
plugins with \texttt{curl} and checks their SHA-256; (2) the first droplet
|
||||
@@ -610,7 +653,9 @@ capacity run failed on upload permissions, fixed by \texttt{chmod}; (3) the
|
||||
128\,MiB heap hung the web interface, fixed by the larger limits in
|
||||
Section~\ref{Section:JenkinsDeployment}; (4) matrix authorization was missing
|
||||
because the capacity bundle covered only Pipeline and Gitea, so
|
||||
\texttt{matrix-auth} was added and the image rebuilt. Three theme plugins
|
||||
\texttt{matrix-auth} was added and the image rebuilt; (5) no stage-by-stage
|
||||
run view was installed, so \texttt{pipeline-graph-view} was added the same
|
||||
way. Three theme plugins
|
||||
(\texttt{dark-theme}, \texttt{dracula-theme}, \texttt{theme-manager}) were
|
||||
installed from the web interface during setup and are not in the lockfile;
|
||||
they survive in \texttt{jenkins-home} but would be lost if the volume were
|
||||
@@ -627,15 +672,18 @@ docker compose logs --tail 100 jenkins # startup errors, OutOfMemoryError
|
||||
docker compose build jenkins && docker compose up -d jenkins
|
||||
\end{minted}
|
||||
After a droplet reboot, Docker starts all three services because of their
|
||||
restart policies; Jenkins needs about one minute before the login page
|
||||
answers. Gitea does not depend on Jenkins, so a Jenkins outage only delays
|
||||
restart policies. Measured container starts took 25\,s (warm
|
||||
\texttt{docker compose restart}) to 45\,s (first start after the limit
|
||||
change); a full droplet reboot was not tested, so allow about a minute before
|
||||
the login page answers. Gitea does not depend on Jenkins, so a Jenkins outage only delays
|
||||
checks (PRs stay blocked until Jenkins reports).
|
||||
|
||||
\paragraph{Cost, ownership, and cleanup.}
|
||||
Jenkins adds no paid resource; it uses the droplet's 1\,GiB Basic plan
|
||||
(listed at \$6/month on DigitalOcean's pricing page on October 21, 2026; the
|
||||
account's billing was not re-checked here) and about 0.9\,GB of disk for its
|
||||
image. Billy administers the droplet and Jenkins; Vincent reviews. To remove
|
||||
image. On October 23 the root filesystem had 18\,GB free of 24\,GB
|
||||
(\texttt{df -h /}, 25\% used). Billy administers the droplet and Jenkins; Vincent reviews. To remove
|
||||
Jenkins: delete the \texttt{main} protection's required check, stop and
|
||||
remove the service (\texttt{docker compose rm -sf jenkins}), delete the volume
|
||||
(\texttt{docker volume rm gitea\_jenkins-home}), remove the \texttt{ci} block
|
||||
@@ -643,7 +691,8 @@ from the Caddyfile and the \texttt{ci} DNS record, delete the webhook, and
|
||||
delete the \texttt{jenkins-bot} user and token.
|
||||
|
||||
\paragraph{Document controls.}
|
||||
This version is 4.0. Document History records the change and both updated
|
||||
This chapter was introduced in version 4.0 and corrected in 4.1 (access path,
|
||||
delivery evidence, wording). Document History records both and the updated
|
||||
tables in \ChapterRef{HostsPasswords}: the Hosts table adds \texttt{ci.yebilly.me},
|
||||
the Jenkins service, and the 1\,GiB resize; the Passwords table adds the
|
||||
Jenkins administrators, the \texttt{jenkins-bot} account, and its token.
|
||||
|
||||
Reference in New Issue
Block a user