Video in progress
An auditor asks: "who wrote each change in prod, who approved it, and when did it go out?" How do you build that traceability from Git and CI?
Every deploy is tied to an exact commit SHA, every commit gets into main only through an approved PR, and the PR is linked to a ticket. That gives the chain: ticket → PR (author, reviewers) → commit → build (artifact digest) → deploy (who, when, which environment).
📖 Answer
For banks and fintech this requirement is routine (for example, the "four eyes" principle: an author cannot approve their own code).
Each link of the chain:
- Ticket ↔ PR. The ticket ID is in the PR title or the branch name, and CI blocks a PR without an ID;
- PR ↔ approval. Branch protection: at least one approval, an author cannot approve themselves, and a new push dismisses the old approval. Admin bypasses also stay in the log and are reviewed separately;
- Commit ↔ artifact. The build writes the commit SHA into the artifact:
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>
Spring Boot Actuator's /actuator/info then shows git.commit.id, and the Docker image is labeled (org.opencontainers.image.revision);
- Artifact ↔ deploy. Deploy only through CI, by image digest (not a tag, since a tag can move). The deploy record: who started it, which digest, which environment, the approval.
With GitOps this comes out naturally: the prod state is in the config repo, every change is a PR, and the history is the audit log.
The problem spots: a hotfix done by hand with kubectl, an admin's direct push, and the original author's information in a squash merge (Co-authored-by lines help). These should be blocked technically, or at least logged under a separate "break-glass" procedure.
One more thing: Git history can be rewritten, so the main source for audit is the platform and CI logs, which are stored immutably in a separate place.
Sign up to mark studied questions and save your progress.