-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make StepActions secure by default ? #7497
Comments
I "think" I would vote for consistency (and documentation). |
Good point. I added this point for context in the original message. |
/cc @aaron-prindle |
My concern is largely in line with the motivation of https://github.com/tektoncd/community/blob/main/teps/0146-parameters-in-script.md I understand we don't want to remove the existing behavior because v1 compatibility, but StepActions give us an opportunity to move users in the right direction and make this change in a non-breaking way. I don't see v1 leaving any time soon - waiting on a v2 doesn't seem pragmatic if we know this is problematic behavior. |
@wlynch do you think that based on https://github.com/tektoncd/community/blob/main/teps/0146-parameters-in-script.md, we should take the same approach for both, There, instead of not allowing params in scripts, I think it is suggesting that users use a suffix |
@chitrangpatel that doesn't necessary work, |
Agreed. I think the TEP goes into more details about how it can enable this for any script (not just bash). I'm definitely not capturing all the different cases here. My main point here was that we should try and take the same secure approach for |
Another point/question: |
Agreed! A consistent approach in that TEP would be preferred. WDYT @wlynch ? |
Should? Yes - if we were to do this over again today I think this is what I'd advocate for. The less invasive approach here would be to leave the existing behavior as-is, and add a check for catlin to discourage use of it (similar to the scorecards dangerous workflow check). This probably needs to be broken down into 2 questions:
For 1 it sounds like we want to disallow the behavior for script blocks everywhere. |
Discussed in the API WG meeting. In v1:
In v2:
cc @wlynch @vdemeester @pritidesai I will close this now. Feel free to reopen to add any concerns with this approach. |
Based on discussions in tektoncd#7497 and consensus in the API WG, we disallow direct parameter substitution in scripts. While we cannot do this for inlined-steps since it is a major breaking change in `v1`, we can do this in `Step Actions`. In this PR we add validation that params cannot be directly replaced in `scripts` of `StepActions`.
Based on discussions in tektoncd#7497 and consensus in the API WG, we disallow direct parameter substitution in scripts. While we cannot do this for inlined-steps since it is a major breaking change in `v1`, we can do this in `Step Actions`. In this PR we add validation that params cannot be directly replaced in `scripts` of `StepActions`.
Based on discussions in #7497 and consensus in the API WG, we disallow direct parameter substitution in scripts. While we cannot do this for inlined-steps since it is a major breaking change in `v1`, we can do this in `Step Actions`. In this PR we add validation that params cannot be directly replaced in `scripts` of `StepActions`.
Today, we allow
param
substitution directly in thescripts
. For inlined-steps, we cannot change that behaviour because of v1 API compatibility reasons.However,
StepActions
are an alpha feature. We can try to make them secure by default before they reachbeta
.The proposal here to NOT allow
param
substitutions inscripts
inStepActions
. Users would need to add the params asenv
variables and use theenv vars
in scripts. In turn, we would not need to enable sharing ofstep
results inscripts
as well and take thesketchy
approach of modifying the user's script.This reduces the chances of
shell attacks
.Alternatively:
The reason for not doing this would be
consistency
withinlined-steps
. We could do this by default intekton/v2
(?)Here we can call this out and provide best practices via documentation.
WDYT ??
cc @wlynch @vdemeester @afrittoli
The text was updated successfully, but these errors were encountered: