-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
feat: add a _before hook for plugins #7542
Conversation
Welcome @guilhem! |
Hi @guilhem. 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 Once the patch is verified, the new status will be reflected by the 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. |
Hi @guilhem and thanks for your PR. Can you please clarify me when this hook would be required? I can see you adding it into the code but couldn't see why/the use case. Thanks |
Hi @rikatz, Problem is because, in |
Current implementation is a custom template with https://gist.github.com/guilhem/52a2722eceffcd7a29b3b5687deedcd6#file-main-lua |
@tao12345666333 @ElvinEfendi thoughts on this? @guilhem you use those with custom-snippets or something like that? Just curious :) |
Nope, it's a plugin installed on all ingress-nginx instances. |
Adding a hook does mean that we can do some things more flexibly. |
Main reason for me: Other common usage of "before" hook can be to execute before all other plugins. Ordering can be important. |
Gotta say I'm still just worried about if this can be used for the evil :D We've had some problems in past with us not sanitizing properly things in Lua side, so can this be, somehow used by a malicious user to run something just appending the _before suffix in some crafted annotation value? Sorry for the dumb question :) |
You are questioning far beyond my skills ^^ |
No problem @guilhem :) I will try to think a bit more as well. I'm not opposed to the feature, just don't wanna add something more that can turn into a future concern :) |
As per @theunrealgeek mention in Slack: "Following up on #7542 which adds the before hook to Lua plugins. At least in my opinion getting the Lua plugin installed needs quite elevated privileges, and any CVE like possibility is perhaps already present with what support exists and adding the before doesn't make it any worse.". I can take that, so this is approved. /approve |
/hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guilhem, rikatz 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 |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/kind bug
/triage accepted
/priority important-longterm
/lifecycle frozen |
@iamNoah1: The In response to this:
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. |
/remove-lifecycle rotten |
Current plugin implementation prevents executing before ingress logic. For example, can be used to correctly set X-Forwarded-Proto before redirect logic. Signed-off-by: Guilhem Lettron <guilhem@barpilot.io>
Gentle Ping |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
Current plugin implementation prevents executing before ingress logic.
For example, can be used to correctly set
X-Forwarded-Proto
before redirect logic.