-
Notifications
You must be signed in to change notification settings - Fork 2k
Add way to customize environmentCheck Actions QL #22173
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| import codeql.actions.Ast | ||
|
|
||
| abstract class CustomEnvEnable extends Environment { } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,6 +277,18 @@ abstract class LabelCheck extends ControlCheck { | |
| } | ||
|
|
||
| class EnvironmentCheck extends ControlCheck instanceof Environment { | ||
| EnvironmentCheck() { | ||
| exists(string selected | | ||
| selectDeploymentEnvironmentDataModel(selected) and | ||
| if selected = "EnvironmentCheckMaD" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for looking into this! As far as I understand the idea of the pull request is to make it configurable which
A couple of questions:
|
||
| then enabledDeploymentEnvironmentDataModel(this.(Environment).getName()) | ||
| else | ||
| if selected = "EnvironmentCheckCustomQL" | ||
| then this instanceof CustomEnvEnable | ||
| else this instanceof Environment | ||
| ) | ||
| } | ||
|
|
||
| // Environment checks are not effective against any mutable attacks | ||
| // they do actually protect against untrusted code execution (sha) | ||
| override predicate protectsCategoryAndEvent(string category, string event) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/actions-all | ||
| extensible: selectDeploymentEnvironmentDataModel | ||
| data: | ||
| # The possible values this can take are: | ||
| # EnvironmentCheckCustomQL - for a custom QL implementation for the sufficient EnvironmentCheck. | ||
| # EnvironmentCheckMaD - for a custom MaD list of deployment environments that are relevant to a database. | ||
| - [""] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the current logic in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment is only relevant in case we need to keep both the Yaml and abstract class option. |
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||||
| extensions: | ||||||||
| - addsTo: | ||||||||
| pack: codeql/actions-all | ||||||||
| extensible: enabledDeploymentEnvironmentDataModel | ||||||||
| data: | ||||||||
| - [""] | ||||||||
|
Comment on lines
+5
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
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.
Missing QL doc.