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

use google/safetext for yaml templating. #3122

Merged
merged 2 commits into from
Jun 23, 2023

Conversation

hoskeri
Copy link
Contributor

@hoskeri hoskeri commented Jun 14, 2023

I think krel is used only with trusted inputs.

However, this should be a safe drop in replacement that blocks yaml injection attacks via package metadata templates.

/kind cleanup

What this PR does / why we need it:

use google/safetext (a drop-in replacement for text/template) to generate yaml.
This prevents certain yaml injection attacks.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Jun 14, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @hoskeri!

It looks like this is your first PR to kubernetes/release 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/release has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @hoskeri. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels Jun 14, 2023
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 14, 2023
@cpanato
Copy link
Member

cpanato commented Jun 15, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 15, 2023
@cpanato
Copy link
Member

cpanato commented Jun 15, 2023

Thanks for the PR.
I was looking at the project, and it seems it is not actively maintained, and the last commit was in Jan/2023. Not sure, to be honest. Let's check the feeling of others

cc @saschagrunert @jeremyrickard @xmudrii @Verolop @puerco @ameukam @kubernetes/release-managers

@saschagrunert
Copy link
Member

saschagrunert commented Jun 15, 2023

I'm also a bit on the fence with this change. On one side I like the additional security (preventing yaml injections), but on the other side it does not seem to be an official google project (but in the google org?).

Kind is using it since the merge of kubernetes-sigs/kind#2911

@cpanato
Copy link
Member

cpanato commented Jun 20, 2023

@saschagrunert If Kind is using i guess we can follow and use it as well

@hoskeri can you rebase and fix the conflicts? thanks

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2023
@hoskeri
Copy link
Contributor Author

hoskeri commented Jun 20, 2023

/retest

@hoskeri
Copy link
Contributor Author

hoskeri commented Jun 21, 2023

that failed cause of a timeout reading the git repo?
let's try again.

/test pull-release-integration-test

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 21, 2023
@cpanato
Copy link
Member

cpanato commented Jun 21, 2023

/hold

need to fix some lints errors @hoskeri

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 21, 2023
@hoskeri
Copy link
Contributor Author

hoskeri commented Jun 21, 2023

@saschagrunert If Kind is using i guess we can follow and use it as well

@hoskeri can you rebase and fix the conflicts? thanks

Done, thanks! The tests are now passing.

I think `krel` is used only with trusted inputs.

However, this should be a safe drop in replacement that blocks
yaml injection attacks via package metadata templates.
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 21, 2023
@hoskeri
Copy link
Contributor Author

hoskeri commented Jun 21, 2023

/hold

need to fix some lints errors @hoskeri

fixed!

@hoskeri
Copy link
Contributor Author

hoskeri commented Jun 21, 2023

/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hoskeri, saschagrunert, xmudrii

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:
  • OWNERS [saschagrunert,xmudrii]

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

@hoskeri
Copy link
Contributor Author

hoskeri commented Jun 23, 2023

@cpanato I think the hold can be removed: I've fixed the linter errors.

@xmudrii
Copy link
Member

xmudrii commented Jun 23, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 23, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8217552 into kubernetes:master Jun 23, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Jun 23, 2023
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. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/release Categorizes an issue or PR as relevant to SIG Release. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants