Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEP-0089] Add a config map to support SPIRE initialization. #5902

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

jagathprakash
Copy link
Member

@jagathprakash jagathprakash commented Dec 20, 2022

This PR is one among the set of PRs done to implement TEP-0089.
This PR has been derived from the larger PRs PR#5715 and PR#4759 by
@pxp928 and @lumjjb.

This PR is addressing the problem of non-falisfiable provenance discussed in TEP-0089
SPIRE is a tool which provides cryptographic identities to workloads in a cluster.
These identities are also associated with a key pair, which can be used to
sign TaskRun results to track if they have been modified by other workloads.

Using SPIRE is one of the ways to address non-falsifiable provenance.

This PR has the following changes

  1. Modify the feature flag to control non-falsifiability from enable-spire to enforce-nonfalsifiability="spire".
    This is in accordance to the approved TEP.
  2. Add a configmap config-spire to initialize SPIRE.

Signed-off-by: jagathprakash 31057312+jagathprakash@users.noreply.github.com

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • [] Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

  • A new configMap spire-config has been introduced in this PR. This configMap has the following details
    • spire-trust-domain: specifies the SPIRE trust domain to use.
    • spire-socket-path: specifies the SPIRE agent socket for SPIFFE workload API.
    • spire-server-addr: specifies the SPIRE server address for workload/node registration.
    • spire-node-alias-prefix: specifies the SPIRE node alias prefix to use.
      These are the details of an existing SPIRE deployment. This implies that SPIRE should be up and running if the SPIRE features has to be used. For now this PR is just adding a configMap and as such does nothing, but later the configMap will be used to initialize the SPIRE client.
  • The feature flag gating this feature was previously called "enable-spire" and it was a boolean flag. This has now been changed to "enforce-nonfalsifiablity" which is a string and takes the strings "" (which is none) or "spire". This is in conformance to TEP-0089.

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Dec 20, 2022
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 20, 2022
@jagathprakash
Copy link
Member Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 20, 2022
@jagathprakash
Copy link
Member Author

/assign @bobcatfish

@jagathprakash
Copy link
Member Author

/assign @afrittoli

@jagathprakash
Copy link
Member Author

/assign @lumjjb @pxp928

@tekton-robot
Copy link
Collaborator

@jagathprakash: GitHub didn't allow me to assign the following users: lumjjb, pxp928.

Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @lumjjb @pxp928

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.1% 28.8% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.1% 28.8% 0.6

@jagathprakash
Copy link
Member Author

/test tekton-pipeline-unit-tests

@jagathprakash
Copy link
Member Author

/test pull-tekton-pipeline-alpha-integration-tests

@jagathprakash
Copy link
Member Author

/retest

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-using-tekton to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

Copy link
Member

@Yongxuanzhang Yongxuanzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one minor comment

Comment on lines 65 to 66
if d := cmp.Diff(got, want); d != "" {
t.Errorf("Diff:\n%s", diff.PrintWantGot(d))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be cmp.Diff(want, got) since we use PrintWantGot?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Thanks for finding this.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 86.7% 88.8% 2.1
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2023
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 87.3% 89.5% 2.2
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 87.3% 89.5% 2.2
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@bobcatfish
Copy link
Collaborator

Thanks for all the back and forth!

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2023
@Yongxuanzhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2023
@bobcatfish
Copy link
Collaborator

Looks like there is a rebasing problem stopping this from merging @jagathprakash

Also looks like there are a bunch of commits in this PR that should probably be squashed together before merging, plus a merge commit that we wouldn't want to include. Putting a hold on this just to make sure that gets resolved before merging, feel free to remove after the commits are fixed:

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 27, 2023
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 87.3% 89.6% 2.3
pkg/apis/config/spire_config.go Do not exist 88.2%
pkg/apis/config/store.go 100.0% 87.0% -13.0
test/controller.go 28.5% 29.1% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 87.3% 89.6% 2.3
pkg/apis/config/spire_config.go Do not exist 88.2%
pkg/apis/config/store.go 100.0% 87.0% -13.0
test/controller.go 28.5% 29.1% 0.6

This PR is one among the set of PRs done to implement TEP-0089.
This PR has been derived from the larger PRs  PR#5715 and PR#4759 by
@pxp928 and @lumjjb.

This PR is addressing the problem of non-falisfiable provenance discussed in TEP-0089.
SPIRE is a tool which provides cryptographic identities to workloads in a cluster.
These identities are also associated with a key pair, which can be used to
sign TaskRun results to track if they have been modified by other workloads.

Using SPIRE is one of the ways to address non-falsifiable provenance.

This PR has the following changes
1. Modify the feature flag to control non-falsifiability from enable-spire to enforce-nonfalsifiability="spire".
   This is in accordance to the approved TEP.
2. Add a configmap config-spire to initialize SPIRE.

Signed-off-by: jagathprakash <31057312+jagathprakash@users.noreply.github.com>
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 87.3% 89.5% 2.2
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 87.3% 89.5% 2.2
pkg/apis/config/spire_config.go Do not exist 88.2%
test/controller.go 28.5% 29.1% 0.6

@Yongxuanzhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2023
@jagathprakash
Copy link
Member Author

/hold cancel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants