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 33.17% 33.55% +0.37%
==========================================
Files 78 81 +3
Lines 7433 7633 +200
==========================================
+ Hits 2466 2561 +95
- Misses 4763 4851 +88
- Partials 204 221 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a702de8 to
3872632
Compare
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
3872632 to
9f09086
Compare
- 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.
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: