Skip to content

Commit

Permalink
Merge pull request #1184 from joejstuart/EC-867-1
Browse files Browse the repository at this point in the history
Rename package names under lib
  • Loading branch information
joejstuart authored Oct 10, 2024
2 parents cacea1d + d2ac82d commit dfad943
Show file tree
Hide file tree
Showing 22 changed files with 101 additions and 110 deletions.
12 changes: 6 additions & 6 deletions antora/docs/modules/ROOT/pages/pipeline_policy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Confirm the `trusted_tasks` rule data was provided, since it's required by the p
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Missing required trusted_tasks data`
* Code: `task_bundle.missing_required_data`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L93[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L92[Source, window="_blank"]
[#task_bundle__untrusted_task_bundle]
=== link:#task_bundle__untrusted_task_bundle[Task bundle is not trusted]
Expand All @@ -30,7 +30,7 @@ For each Task in the Pipeline definition, check if the Tekton Bundle used is a t
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task '%s' uses an untrusted task bundle '%s'`
* Code: `task_bundle.untrusted_task_bundle`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L78[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L77[Source, window="_blank"]
[#task_bundle__out_of_date_task_bundle]
=== link:#task_bundle__out_of_date_task_bundle[Task bundle is out of date]
Expand All @@ -40,7 +40,7 @@ For each Task in the Pipeline definition, check if the Tekton Bundle used is the
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `Pipeline task '%s' uses an out of date task bundle '%s'`
* Code: `task_bundle.out_of_date_task_bundle`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L35[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L34[Source, window="_blank"]
[#task_bundle__empty_task_bundle_reference]
=== link:#task_bundle__empty_task_bundle_reference[Task bundle reference is empty]
Expand All @@ -50,7 +50,7 @@ Check that a valid task bundle reference is being used.
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task '%s' uses an empty bundle image reference`
* Code: `task_bundle.empty_task_bundle_reference`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L65[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L64[Source, window="_blank"]
[#task_bundle__disallowed_task_reference]
=== link:#task_bundle__disallowed_task_reference[Task bundle was not used or is not defined]
Expand All @@ -60,7 +60,7 @@ Check for the existence of a task bundle. This rule will fail if the task is not
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task '%s' does not contain a bundle reference`
* Code: `task_bundle.disallowed_task_reference`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L51[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L50[Source, window="_blank"]
[#task_bundle__unpinned_task_bundle]
=== link:#task_bundle__unpinned_task_bundle[Unpinned task bundle reference]
Expand All @@ -70,7 +70,7 @@ Check if the Tekton Bundle used for the Tasks in the Pipeline definition is pinn
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `Pipeline task '%s' uses an unpinned task bundle reference '%s'`
* Code: `task_bundle.unpinned_task_bundle`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L21[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/pipeline/task_bundle.rego#L20[Source, window="_blank"]
[#basic_package]
== link:#basic_package[Pipeline definition sanity checks]
Expand Down
46 changes: 23 additions & 23 deletions antora/docs/modules/ROOT/pages/release_policy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ Confirm the `trusted_tasks` rule data was provided, since it's required by the p
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Missing required trusted_tasks data`
* Code: `attestation_task_bundle.trusted_bundles_provided`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L114[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L113[Source, window="_blank"]

[#attestation_task_bundle__task_ref_bundles_not_empty]
=== link:#attestation_task_bundle__task_ref_bundles_not_empty[Task bundle references not empty]
Expand All @@ -1647,7 +1647,7 @@ Check that a valid task bundle reference is being used.
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task '%s' uses an empty bundle image reference`
* Code: `attestation_task_bundle.task_ref_bundles_not_empty`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L76[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L75[Source, window="_blank"]

[#attestation_task_bundle__task_ref_bundles_pinned]
=== link:#attestation_task_bundle__task_ref_bundles_pinned[Task bundle references pinned to digest]
Expand All @@ -1659,7 +1659,7 @@ Check if the Tekton Bundle used for the Tasks in the Pipeline definition is pinn
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `Pipeline task '%s' uses an unpinned task bundle reference '%s'`
* Code: `attestation_task_bundle.task_ref_bundles_pinned`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L21[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L20[Source, window="_blank"]

[#attestation_task_bundle__task_ref_bundles_trusted]
=== link:#attestation_task_bundle__task_ref_bundles_trusted[Task bundles are in trusted tasks list]
Expand All @@ -1671,7 +1671,7 @@ For each Task in the SLSA Provenance attestation, check if the Tekton Bundle use
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task '%s' uses an untrusted task bundle '%s'`
* Code: `attestation_task_bundle.task_ref_bundles_trusted`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L93[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L92[Source, window="_blank"]

[#attestation_task_bundle__task_ref_bundles_current]
=== link:#attestation_task_bundle__task_ref_bundles_current[Task bundles are latest versions]
Expand All @@ -1683,7 +1683,7 @@ For each Task in the SLSA Provenance attestation, check if the Tekton Bundle use
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `Pipeline task '%s' uses an out of date task bundle '%s'`
* Code: `attestation_task_bundle.task_ref_bundles_current`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L39[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L38[Source, window="_blank"]

[#attestation_task_bundle__tasks_defined_in_bundle]
=== link:#attestation_task_bundle__tasks_defined_in_bundle[Tasks defined using bundle references]
Expand All @@ -1693,7 +1693,7 @@ Check for the existence of a task bundle. This rule will fail if the task is not
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task '%s' does not contain a bundle reference`
* Code: `attestation_task_bundle.tasks_defined_in_bundle`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L60[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/attestation_task_bundle.rego#L59[Source, window="_blank"]

[#tasks_package]
== link:#tasks_package[Tasks]
Expand All @@ -1713,7 +1713,7 @@ Ensure that the all required tasks are resolved from trusted tasks.
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `%s is required and present but not from a trusted task`
* Code: `tasks.required_untrusted_task_found`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L34[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L33[Source, window="_blank"]

[#tasks__required_tasks_found]
=== link:#tasks__required_tasks_found[All required tasks were included in the pipeline]
Expand All @@ -1725,7 +1725,7 @@ Ensure that the set of required tasks are included in the PipelineRun attestatio
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `%s is missing`
* Code: `tasks.required_tasks_found`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L166[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L165[Source, window="_blank"]

[#tasks__data_provided]
=== link:#tasks__data_provided[Data provided]
Expand All @@ -1737,7 +1737,7 @@ Confirm the expected data keys have been provided in the expected format. The ke
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `%s`
* Code: `tasks.data_provided`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L278[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L277[Source, window="_blank"]

[#tasks__future_required_tasks_found]
=== link:#tasks__future_required_tasks_found[Future required tasks were found]
Expand All @@ -1749,7 +1749,7 @@ Produce a warning when a task that will be required in the future was not includ
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `%s is missing and will be required on %s`
* Code: `tasks.future_required_tasks_found`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L84[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L83[Source, window="_blank"]

[#tasks__pinned_task_refs]
=== link:#tasks__pinned_task_refs[Pinned Task references]
Expand All @@ -1761,7 +1761,7 @@ Ensure that all Tasks in the SLSA Provenance attestation use an immuntable refer
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Task %s is used by pipeline task %s via an unpinned reference.`
* Code: `tasks.pinned_task_refs`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L213[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L212[Source, window="_blank"]

[#tasks__pipeline_has_tasks]
=== link:#tasks__pipeline_has_tasks[Pipeline run includes at least one task]
Expand All @@ -1773,7 +1773,7 @@ Ensure that at least one Task is present in the PipelineRun attestation.
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `No tasks found in PipelineRun attestation`
* Code: `tasks.pipeline_has_tasks`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L113[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L112[Source, window="_blank"]

[#tasks__pipeline_required_tasks_list_provided]
=== link:#tasks__pipeline_required_tasks_list_provided[Required tasks list for pipeline was provided]
Expand All @@ -1785,7 +1785,7 @@ Produce a warning if the required tasks list rule data was not provided.
* Rule type: [rule-type-indicator warning]#WARNING#
* WARNING message: `Required tasks do not exist for pipeline`
* Code: `tasks.pipeline_required_tasks_list_provided`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L64[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L63[Source, window="_blank"]

[#tasks__required_tasks_list_provided]
=== link:#tasks__required_tasks_list_provided[Required tasks list was provided]
Expand All @@ -1797,7 +1797,7 @@ Confirm the `required-tasks` rule data was provided, since it's required by the
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Missing required required-tasks data`
* Code: `tasks.required_tasks_list_provided`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L190[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L189[Source, window="_blank"]

[#tasks__successful_pipeline_tasks]
=== link:#tasks__successful_pipeline_tasks[Successful pipeline tasks]
Expand All @@ -1809,7 +1809,7 @@ Ensure that all of the Tasks in the Pipeline completed successfully. Note that s
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Pipeline task %q did not complete successfully, %q`
* Code: `tasks.successful_pipeline_tasks`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L137[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L136[Source, window="_blank"]

[#tasks__unsupported]
=== link:#tasks__unsupported[Task version unsupported]
Expand All @@ -1819,7 +1819,7 @@ The Tekton Task used is or will be unsupported. The Task is annotated with `buil
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Task %q is used by pipeline task %q is or will be unsupported as of %s. %s`
* Code: `tasks.unsupported`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L240[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/tasks.rego#L239[Source, window="_blank"]

[#test_package]
== link:#test_package[Test]
Expand Down Expand Up @@ -1969,7 +1969,7 @@ Confirm the expected `trusted_tasks` data keys have been provided in the expecte
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `%s`
* Code: `trusted_task.data_format`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L185[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L184[Source, window="_blank"]

[#trusted_task__pinned]
=== link:#trusted_task__pinned[Task references are pinned]
Expand All @@ -1982,7 +1982,7 @@ Check if all Tekton Tasks use a Task definition by a pinned reference. When usin
* WARNING message: `Pipeline task %q uses an unpinned task reference, %s`
* Code: `trusted_task.pinned`
* Effective from: `2024-05-07T00:00:00Z`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L25[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L24[Source, window="_blank"]

[#trusted_task__data]
=== link:#trusted_task__data[Task tracking data was provided]
Expand All @@ -1995,7 +1995,7 @@ Confirm the `trusted_tasks` rule data was provided, since it's required by the p
* FAILURE message: `Missing required trusted_tasks data`
* Code: `trusted_task.data`
* Effective from: `2024-05-07T00:00:00Z`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L135[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L134[Source, window="_blank"]

[#trusted_task__trusted]
=== link:#trusted_task__trusted[Tasks are trusted]
Expand All @@ -2008,7 +2008,7 @@ Check the trust of the Tekton Tasks used in the build Pipeline. There are two mo
* FAILURE message: `%s`
* Code: `trusted_task.trusted`
* Effective from: `2024-05-07T00:00:00Z`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L72[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L71[Source, window="_blank"]

[#trusted_task__current]
=== link:#trusted_task__current[Tasks using the latest versions]
Expand All @@ -2021,7 +2021,7 @@ Check if all Tekton Tasks use the latest known Task reference.
* WARNING message: `Pipeline task %q uses an out of date task reference, %s`
* Code: `trusted_task.current`
* Effective from: `2024-05-07T00:00:00Z`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L50[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L49[Source, window="_blank"]

[#trusted_task__valid_trusted_artifact_inputs]
=== link:#trusted_task__valid_trusted_artifact_inputs[Trusted Artifact produced in pipeline]
Expand All @@ -2033,7 +2033,7 @@ All input trusted artifacts must be produced on the pipeline. If they are not th
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Code tampering detected, input %q for task %q was not produced by the pipeline as attested.`
* Code: `trusted_task.valid_trusted_artifact_inputs`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L98[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L97[Source, window="_blank"]

[#trusted_task__trusted_parameters]
=== link:#trusted_task__trusted_parameters[Trusted parameters]
Expand All @@ -2046,7 +2046,7 @@ Confirm certain parameters provided to each builder Task have come from trusted
* FAILURE message: `The %q parameter of the %q PipelineTask includes an untrusted digest: %s`
* Code: `trusted_task.trusted_parameters`
* Effective from: `2021-07-04T00:00:00Z`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L154[Source, window="_blank"]
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/release/trusted_task.rego#L153[Source, window="_blank"]

[#rpm_ostree_task_package]
== link:#rpm_ostree_task_package[rpm-ostree Task]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions policy/lib/bundles.rego → policy/lib/tekton/bundles.rego
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package lib.bundles
package lib.tekton

import rego.v1

import data.lib.image
import data.lib.refs

# Return the bundle reference as is
bundle(task) := refs.task_ref(task).bundle
bundle(task) := task_ref(task).bundle

# Returns a subset of tasks that do not use a bundle reference.
disallowed_task_reference(tasks) := {task |
Expand Down
Loading

0 comments on commit dfad943

Please sign in to comment.