Skip to content

feat: whitelist for allowed env and paths for lua#9220

Open
rudrakhp wants to merge 1 commit into
envoyproxy:mainfrom
rudrakhp:configurable_critical_lua
Open

feat: whitelist for allowed env and paths for lua#9220
rudrakhp wants to merge 1 commit into
envoyproxy:mainfrom
rudrakhp:configurable_critical_lua

Conversation

@rudrakhp

@rudrakhp rudrakhp commented Jun 13, 2026

Copy link
Copy Markdown
Member

What type of PR is this?
feat: whitelist for allowed env and paths for lua

What this PR does / why we need it:
To allow gateway admins to configure env vars and paths to be explicitly allowed for access by Lua configured in the gateway.

Which issue(s) this PR fixes:

Fixes #7955

Release Notes: Yes

@rudrakhp rudrakhp requested a review from a team as a code owner June 13, 2026 06:14
@netlify

netlify Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 65635d5
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a2d1152989c330008ca7d0c
😎 Deploy Preview https://deploy-preview-9220--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db0ebb7b72

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/gatewayapi/luavalidator/security.lua Outdated
Comment thread internal/gatewayapi/luavalidator/security.lua Outdated
@rudrakhp rudrakhp force-pushed the configurable_critical_lua branch from db0ebb7 to 54c5aca Compare June 13, 2026 06:17
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.64516% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.88%. Comparing base (6578a6d) to head (65635d5).

Files with missing lines Patch % Lines
internal/gatewayapi/luavalidator/lua_validator.go 80.64% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9220      +/-   ##
==========================================
- Coverage   74.89%   74.88%   -0.02%     
==========================================
  Files         252      252              
  Lines       40799    40830      +31     
==========================================
+ Hits        30558    30575      +17     
- Misses       8158     8169      +11     
- Partials     2083     2086       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rudrakhp rudrakhp force-pushed the configurable_critical_lua branch 2 times, most recently from b71ccdb to 47fdd01 Compare June 13, 2026 07:22
Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
@rudrakhp rudrakhp force-pushed the configurable_critical_lua branch from 47fdd01 to 65635d5 Compare June 13, 2026 08:14
@rudrakhp rudrakhp added this to the v1.9.0-rc.1 Release milestone Jun 13, 2026
// +kubebuilder:validation:items:MaxLength=4096
// +kubebuilder:validation:XValidation:rule="self.all(p, p.trim() != '')",message="allowedPaths entries must not be blank or whitespace-only"
// +optional
AllowedPaths []string `json:"allowedPaths,omitempty"`

@zirain zirain Jun 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the configuration looks a little redundant.

luaValidationAllowlist:
  allowedPaths:

what about using following?

luaValidation:
  allowedPaths:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Problem is there is an existing luaValidation API used for configuring the mode/level. It is a string enum type so can't have child params. How about:

luaStrictValidationAllowlist:
  paths:
  envVars:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Problem is there is an existing luaValidation API used for configuring the mode/level. It is a string enum type so can't have child params. How about:

luaStrictValidationAllowlist:
  paths:
  envVars:

I'm mostly concerts with the Allow in the naming, which might be a blocker if we want to add blacklist for the validation instead of whitelist.

@rudrakhp rudrakhp Jun 15, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Got it how about:

luaStrictValidation:
  allowedPaths:
  allowedEnvVars:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds good to me.

@rudrakhp rudrakhp requested a review from zirain June 15, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable critical paths and envs for Lua validation

2 participants