-
Notifications
You must be signed in to change notification settings - Fork 38
Add extractTerraformChanges filter plugin #726
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
base: main
Are you sure you want to change the base?
Conversation
Analyzes Terraform HCL file changes to extract highest privilege level from modified JIT access configurations. Returns 'rw' for read-write, 'ro' for read-only, or null if no JIT objects modified.
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.
Orca Security Scan Summary
Status | Check | Issues by priority | |
---|---|---|---|
![]() |
Infrastructure as Code | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
SAST | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Secrets | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Vulnerabilities | ![]() ![]() ![]() ![]() |
View in Orca |
🛡️ The following SAST misconfigurations have been detected
NAME | FILE | ||
---|---|---|---|
![]() |
Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks | ...aformChanges/test.js | View in code |
![]() |
Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks | ...aformChanges/test.js | View in code |
Please mark which AI tools you used for this PR by checking the appropriate boxes:
Tip: If you want to avoid this comment in the future, you can add a label of the format |
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.
Orca Security Scan Summary
Status | Check | Issues by priority | |
---|---|---|---|
![]() |
Infrastructure as Code | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
SAST | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Secrets | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Vulnerabilities | ![]() ![]() ![]() ![]() |
View in Orca |
🛡️ The following SAST misconfigurations have been detected
NAME | FILE | ||
---|---|---|---|
![]() |
Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks | ...aformChanges/test.js | View in code |
![]() |
Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks | ...aformChanges/test.js | View in code |
![]() |
Dynamic File Path Construction from User Input Can Lead to Path Traversal Attacks | ...aformChanges/test.js | View in code |
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.
✨ PR Review
The PR introduces a new filter plugin for analyzing Terraform HCL changes to extract privilege levels from JIT configurations. The implementation includes comprehensive parsing logic with good error handling and test coverage.
1 issues detected:
🐞 Bug - Deleted lines are incorrectly tracked with the new file's line numbers instead of the original file's line numbers
Details: The diff parsing logic has an error in line number tracking. When processing deleted lines (lines starting with '-'), the code adds them to changedLines but doesn't increment currentLine. This causes incorrect line number mapping between the diff and the original content, leading to wrong JIT object detection.
File:plugins/filters/extractTerraformChanges/index.js (72-72)
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀
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.
Amazing 🎉
Analyzes Terraform HCL file changes to extract highest privilege level from modified JIT access configurations. Returns 'rw' for read-write, 'ro' for read-only, or null if no JIT objects modified.
✨ PR Description
The purpose and impact of these changes is to introduce a new GitStream filter called extractTerraformChanges that analyzes Terraform HCL file changes to extract the highest privilege level from modified JIT access configurations.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀