CI/CD: job trust, release gates, and artifact provenance
Study-time guide: 20 min reading and analysis, 110 min core exercises, 50 min review and deliverable. Additional external-platform execution is estimated separately.
Lesson 1. Identify who controls code receiving credentials
The report team adds a scanner to its pipeline and considers the problem solved. However, an external pull request can modify code executed by a runner. Giving that job a publication secret creates a trust problem independent of scanner quality. The runner executes steps, a job performs a particular unit of work, and an artifact is a build output. Inputs, workflow definitions, dependencies, and outputs have different origins and permissions.
Draw change → trigger → runner → build → registry → deployment. For each transition, identify an owner and a verifiable condition. A privileged job must not execute untrusted code with secrets merely because a branch resembles a release name. Self-managed GitLab requires runner isolation and job-token review. GitHub Actions requires review of events, permissions, and workflow origins. The transferable skill is examining the boundary rather than copying a product name.
Lesson 2. Define an explicit gate decision
A gate determines admission to the next stage. Distinguish confirmed risk, an approved temporary exception, and an incomplete check. A scanner failure or missing report does not establish a clean build. Code version, instrument status, and report integrity matter. An indefinite component-name exclusion may hide unrelated future risk.
The local model below is not real CI configuration. It implements a testable contract without network access or packages. Save it as gate_lab.py, run Python 3, and compare actual output with case intentions.
from datetime import date
today = date(2026, 10, 6)
def gate(scan_ok, confirmed, exception_until=None):
if not scan_ok:
return 'incomplete'
if not confirmed:
return 'allow'
if exception_until is not None and exception_until >= today:
return 'exception'
return 'block'
assert gate(True, False) == 'allow'
assert gate(False, False) == 'incomplete'
assert gate(True, True, date(2026, 10, 5)) == 'block'
assert gate(True, True, date(2026, 10, 7)) == 'exception'
print('four training gate states checked')
The date is fixed for repeatability rather than automatically tracking today. Real exceptions also need owner, scope, rationale, and a specific finding. A date alone is insufficient. An incomplete state needs an explicit decision path, such as stopping publication or an agreed procedure documenting unverified coverage. Do not hide failure using || true merely to produce a green job.
Practice: challenge your own rule
Run the unchanged model and record all four states. In a separate copy, make the first branch allow; the failed-scanner case should detect the defect. Restore the original. Propose two additional cases: an exception for another finding and an unconfirmed warning requiring triage. Identify the fields and owners needed by a production gate instead of adding undefined complexity.
Review a training workflow or draw its design without connecting CI. Identify write-enabled jobs, external-action pinning, workflow-change permissions, and separation between untrusted review and publication. Pin reviewed third-party actions to a full commit SHA and record provenance because tags can move. Short-lived OIDC access can avoid permanent keys, but the trust policy still needs a restricted context. OIDC does not justify giving every workflow a deployment role.
Lesson 3. Publish the object that was checked
Scanning one image and publishing another through a mutable tag breaks the evidence chain. Use a content digest and a verifiable path from build to deployment. Provenance describes build origin. A signature establishes a signer’s statement under verification conditions. A signed artifact can contain defects, so provenance, checks, and release approval remain separate properties.
For a Russian organization, agree on source hosting, runner location, and external dependencies according to project requirements. Self-managed GitLab is not automatically secure because it is inside a network. A runner owner must know which jobs share machines and what survives execution. Submit a gate policy, job trust model, and artifact map with digest, check statuses, and exceptions. If you ran only the local model, state that no real CI scanner was executed.
Consult GitHub secure use, GitLab job-token guidance, and SLSA provenance. The deliverable explains why a particular build was admitted or stopped and permits the decision to be reproduced from preserved evidence.
Where to put a check
Change the conditions and observe this training model. It runs in your browser and does not change your computer.
A team is preparing a release. Enable the independent checks and see what remains unknown.
Choose conditions above to see an explanation of the result.
Independent exercise · Russian

В ноябре 2026 года служба доставки обновляет диспетчерскую программу перед вечерней сменой. Дежурный видит зелёный статус тестов и кнопку публикации. Ему выдали выписку из журнала. В ней A и B обозначают два различных полных digest образов.
Evidence
16:00 защищённая сборка 731 выпустила A из коммита C12. В 16:06 проверка образа A прошла. В 16:08 задача предпросмотра 732 записала под тем же тегом «вечер» образ B. В 16:10 этап публикации разрешил тег в B. У задачи 732 есть право записи в реестр выпуска.
Assignment
Запишите решение дежурного для B и поправку к конфигурации двух задач. Перечислите, какие поля записи о проверке должен сверять этап публикации.
Compare your reasoning
У B нет относящейся к нему проверки. Публикацию следует остановить. Задаче предпросмотра выделите собственный реестр или пространство имён без записи в выпуск. Этап публикации получает неизменяемый digest и сверяет с ним результат проверки, коммит и идентичность доверенной задачи. По данным выписки связь подтверждена для C12, 731 и A.
Personal practice environment
Check an excerpt, find matching lines and compute the SHA-256 of the original text. Temporary data expires after 30 minutes or when you close the environment.
Sign in