michaelvl / gha-reusable-workflows

Reusable GitHub action workflows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Reusable Workflows

This repository have reusable workflows for building a SLSA level 3 secure software supply chain.

The following figure illustrates SLSA Supply chain threats:

SLSA Supply chain threats

See example application pository for an example use of the workflows from this repositoty.

Protections

Mitigation of threats as described by SLSA are described below.

Legend

  • πŸ“ Attestation or other metadata produced/used by workflows.
  • β›” Control/governance point, i.e. decision point for accepting artifacts.
  • 🎩 Trusted process through separation of duties.
  • ❌ No mitigation

Mitigation mechanisms for threat-points from figure above:

  • A. Submit unauthorized source:
    • πŸ“ PR provenance attestation showing PR status, who reviewed, approved and merged etc.
    • TODO: Investigate Gittuf
  • B. Compromised source repository:
    • ❌ None
    • TODO: Produce Git signature attestation
  • C. Build from modified source
    • ❌ None
    • TODO: Produce Git signature attestation
  • D. Compromised dependencies
    • πŸ“ SBOM attestation
    • πŸ“ Container CVE scan attestation
  • E. Compromised build process
  • F. Upload modified artifacts
    • πŸ“ Container digest used throughout workflows
    • πŸ“ Container signed
  • G. Compromised artifact storage
    • πŸ“ Container digest used throughout workflows
    • πŸ“ Container signed
  • H. Deploy compromised artifact

Note, that SLSA levels describe the build-phase and does not cover the source-phase, i.e. tampering with the source prior to building.

Pull-request Attestation

The policy-verification workflow applies Rego-based organisation policies to the attestions produced by prior workflows using artifact-underwriter. Based on the policy verification result, a Verification Summary Attestation (VSA) is issued.

The attestations produced by the workflows are generally standardised, except for the pull-request attestation since no standard exists. The produced pull-request attestation are summarised below.

{
  "_type": "https://in-toto.io/Statement/v0.1",
  "predicateType": "https://github.com/michaelvl/gha-reusable-workflows/pr-provenance",
  "subject": [
     ...
  ],
  "predicate": {
    "pull_requests": {
      "associatedPullRequests": {
        "nodes": [
          {
            "author": {
              ...           # Who created the PR
            },
            "approvers": {
              ...           # Who approved the PR
            },
            "assignees": {
              ...           # PR review assignees
            },
            "body": ...,    # Body text of PR
            "mergedAt": ...
            "mergedBy": ...   # Who merged the PR
            "reviewDecision": # Overall review state
            "state": "MERGED",
            "title": ...
          }
        ]
      },
    },
    "repository": {         # Git references
      "digest": {
        "sha1": ...
      },
      "name": ...
      "ref": ...
       ...
    }
  }
}

Links

About

Reusable GitHub action workflows

License:Apache License 2.0


Languages

Language:Shell 51.3%Language:Open Policy Agent 39.4%Language:Makefile 9.3%