|
| 1 | +// SPDX-FileCopyrightText: Copyright 2025 The SLSA Authors |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +syntax = "proto3"; |
| 5 | +package ampel.v1; |
| 6 | + |
| 7 | +import "google/protobuf/timestamp.proto"; |
| 8 | + |
| 9 | +option go_package = "github.com/slsa-framework/slsa-source-poc/sourcetool/pkg/policy"; |
| 10 | + |
| 11 | +// The repository policy definition |
| 12 | +message RepoPolicy { |
| 13 | + string canonical_repo = 1 [json_name="canonical_repo"]; |
| 14 | + repeated ProtectedBranch protected_branches = 2 [json_name="protected_branches"]; |
| 15 | + optional ProtectedTag protected_tag = 3; |
| 16 | +} |
| 17 | + |
| 18 | +// When a branch requires multiple controls, they must all be enabled |
| 19 | +// at or before 'since'. |
| 20 | +message ProtectedBranch { |
| 21 | + string name = 1; |
| 22 | + google.protobuf.Timestamp since = 2; |
| 23 | + // We override this string with slsa.SlsaSourceLevel |
| 24 | + string target_slsa_source_level = 3; |
| 25 | + bool require_review = 4; |
| 26 | + repeated OrgStatusCheckControl org_status_check_controls = 5 [json_name="org_status_check_controls"]; |
| 27 | +} |
| 28 | + |
| 29 | +// The controls required for protected tags. |
| 30 | +message ProtectedTag { |
| 31 | + google.protobuf.Timestamp since = 1; |
| 32 | + bool tag_hygiene = 2; |
| 33 | +} |
| 34 | + |
| 35 | +// Used by orgs to require that specific 'checks' are run on protected |
| 36 | +// branches and to associate those checks with a control name to include |
| 37 | +// in provenance and VSAs. |
| 38 | +// https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-status-checks-to-pass-before-merging |
| 39 | +message OrgStatusCheckControl { |
| 40 | + // The property to record in the VSA if the conditions are met. |
| 41 | + // MUST start with `ORG_SOURCE_`. |
| 42 | + // We'll overide this with slsa.ControlName |
| 43 | + string property_name = 1; |
| 44 | + |
| 45 | + // These controls have their own start time to enable orgs to enable |
| 46 | + // new ones without violating continuity on other controls. |
| 47 | + google.protobuf.Timestamp since = 2; |
| 48 | + |
| 49 | + // The name of the 'Status Check' as reported in the GitHub UI & API. |
| 50 | + string check_name = 3; |
| 51 | +} |
0 commit comments