feat: add Lua sandbox validation for plugins via deck plugin lint#2068
Open
thesp0nge wants to merge 6 commits into
Open
feat: add Lua sandbox validation for plugins via deck plugin lint#2068thesp0nge wants to merge 6 commits into
thesp0nge wants to merge 6 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2068 +/- ##
==========================================
+ Coverage 36.73% 37.01% +0.28%
==========================================
Files 78 81 +3
Lines 7429 7629 +200
==========================================
+ Hits 2729 2824 +95
- Misses 4455 4543 +88
- Partials 245 262 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a702de8 to
3872632
Compare
3872632 to
9f09086
Compare
Contributor
|
@bungle @thesp0nge reviewed from decK perspective - LGTM, I've not deeply gone through the AST validation though. |
harshadixit12
previously approved these changes
Jul 7, 2026
Contributor
|
@thesp0nge can we please resolve the conflicts? |
Introduces a robust static analysis tool for Lua plugin code within decK. The linter checks for security evasion patterns and compatibility with Kong Gateway sandbox levels (OSS and Enterprise profiles). Key features: - AST-based semantic analysis using gopher-lua. - Multi-policy support via embedded YAML Knowledge Base. - Support for stdin, literal code, and file input. - Detection of dangerous side-channel attacks (e.g., SQL-to-shell). - Detailed reporting with line numbers and severity levels.
- Fix unused-parameter in executePluginLint - Wrap long lines in pluginLintCmd flags - Replace blocked gopkg.in/yaml.v3 with sigs.k8s.io/yaml - Apply proper formatting (gci, gofumpt, gofmt) across modified files
- Replace gopkg.in/yaml.v3 with sigs.k8s.io/yaml in validator.go to align with project standards and fix CI failures. - Remove obsolete and unused policy files in pkg/lua/policies, keeping only the active ones in plugin/lua/policies
- Add "Reading input from stdin..." hint to plugin lint command. - Apply proper formatting across modified files.
- Fix the copy-pasted description for the `--sandbox` (`-s`) flag to list the actual sandbox profiles (lua, standard, strict, lax). - Correct the missing closing bracket in the `--edition` (`-e`) flag description.
…linting
- Simplify plugin command description to reflect that only the lint
subcommand is currently exposed.
c8e578e to
38908ff
Compare
Author
|
@harshadixit12 solved |
| @@ -0,0 +1,17 @@ | |||
| package cmd | |||
|
|
|||
Contributor
There was a problem hiding this comment.
cc: @Prashansa-K for visibility - I figured this shouldn't be under deck file lint because the new command is intended for a specific purpose, and can't be configured by users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a robust static analysis tool for Lua plugin code within decK. The linter checks for security evasion patterns and compatibility with Kong Gateway sandbox levels (OSS and Enterprise profiles).
Key features: