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

Generate SRP source provenance file in CI #5177

Merged
merged 28 commits into from
Aug 24, 2022
Merged

Conversation

antgamdia
Copy link
Contributor

@antgamdia antgamdia commented Aug 8, 2022

Description of the change

This PR is adding an additional step in the CI (after pushing the images) to report the provenance file to our corporate endpoint. This is solely an internal requirement, not affecting the rest of the components whatsoever.

Benefits

We will comply with the SRP checkpoint.

Possible drawbacks

N/A

Applicable issues

Additional information

It is not working as the UID must be registered in advance in our systems (which is an ongoing task pending validation), therefore, the PR is marked as a draft as the CI step is currently failing.

Remember to add the credentials to our system.

Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
@netlify
Copy link

netlify bot commented Aug 8, 2022

Deploy Preview for kubeapps-dev canceled.

Name Link
🔨 Latest commit ca225ad
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/6305e2a9ac2fbb0008c5f84c

Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
Signed-off-by: Antonio Gamez Diaz <[email protected]>
sudo mv ./srp /usr/local/bin/
srp --version
srp config --srp-endpoint << pipeline.parameters.SRP_ENDPOINT >>
srp config auth --client-id $KUBEAPPS_SRP_CLIENT_ID --client-secret $KUBEAPPS_SRP_CLIENT_SECRET
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already set and properly stored in our corporate tool

srp config --srp-endpoint << pipeline.parameters.SRP_ENDPOINT >>
srp config auth --client-id $KUBEAPPS_SRP_CLIENT_ID --client-secret $KUBEAPPS_SRP_CLIENT_SECRET
# - run:
# name: Install and configure the SRP observer tool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't working yet, but the team is working on providing a public endpoint for it. I'll send another PR once we have it.

path: source-provenance.json
# TODO(agamez): we will need to create the "network provenance" file soon.
# - run:
# name: Generate the "network provenance" file
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We may have to ask for a reporter for Rust, I haven't been able to make it work. However, it is not a priority right now. The provenance file is enough.

- run:
name: Validate and submit the provenance files to the SRP Metadata service
command: |
srp uid validate "uid.mtd.provenance_2_5.fragment(obj_uid=uid.obj.build.circleci(instance='circleci.com',type='<< pipeline.project.type >>',namespace='${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}',branch='${CIRCLE_BRANCH}',commit_id='${CIRCLE_SHA1}',build_id='<< pipeline.number >>/${CIRCLE_WORKFLOW_ID}/${CIRCLE_BUILD_NUM}'),revision='')"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is an upstream issue or the format for CircleCI happens to change, this will throw an error.

@@ -108,6 +108,12 @@ parameters:
README_GENERATOR_REPO:
type: "string"
default: "bitnami-labs/readme-generator-for-helm"
SRP_ENDPOINT:
type: "string"
default: "https://apigw.vmware.com/v1/s1/api/helix-beta"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required for working outside the corporate network

Signed-off-by: Antonio Gamez Diaz <[email protected]>
@antgamdia antgamdia marked this pull request as ready for review August 24, 2022 08:35
@antgamdia
Copy link
Contributor Author

It's finally working now!

image

Copy link
Collaborator

@castelblanque castelblanque left a comment

Choose a reason for hiding this comment

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

Great! Thanks for the effort.

One task for the future will be to move all the logic into a container, so that:

  • CircleCI spec is simpler
  • Migration to e.g. GitHub actions is easier
    But we can consider this as something for the eventual migration to GitHub actions.

@antgamdia antgamdia merged commit 18cce4f into main Aug 24, 2022
@antgamdia antgamdia deleted the 5176-srp-source-prov branch August 24, 2022 09:45
@antgamdia antgamdia mentioned this pull request Aug 24, 2022
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SRP compliance: report provenance file
3 participants