-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix non-raw-regex-pattern and some issues in linting
- Loading branch information
1 parent
31f3003
commit 60ec7f2
Showing
26 changed files
with
161 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
7 changes: 4 additions & 3 deletions
7
.../azureResourceManager/role_definitions_allow_custom_subscription_role_creation/query.rego
This file contains 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
This file contains 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
This file contains 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
This file contains 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
15 changes: 9 additions & 6 deletions
15
assets/queries/dockerfile/healthcheck_instruction_missing/query.rego
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
package Cx | ||
|
||
import data.generic.dockerfile as dockerLib | ||
import future.keywords.in | ||
|
||
CxPolicy[result] { | ||
resource := input.document[i].command[name] | ||
some doc in input.document | ||
resource := doc.command[name] | ||
dockerLib.check_multi_stage(name, input.document[i].command) | ||
|
||
not contains(resource, "healthcheck") | ||
not healthcheck_exists(resource) | ||
|
||
result := { | ||
"documentId": input.document[i].id, | ||
"documentId": doc.id, | ||
"searchKey": sprintf("FROM={{%s}}", [name]), | ||
"issueType": "MissingAttribute", | ||
"keyExpectedValue": "Dockerfile should contain instruction 'HEALTHCHECK'", | ||
"keyActualValue": "Dockerfile doesn't contain instruction 'HEALTHCHECK'", | ||
} | ||
} | ||
|
||
contains(cmd, elem) { | ||
cmd[_].Cmd = elem | ||
} | ||
healthcheck_exists(resource) { | ||
some cmd in resource | ||
cmd.Cmd == "healthcheck" | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.