Skip to content

Commit

Permalink
make appsec requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cxMiguelSilva committed Sep 26, 2022
1 parent bd52af4 commit ffc68a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@ package Cx

import data.generic.common as common_lib

shell_possibilities := {
"/bin/bash",
"/bin/tcsh",
"/bin/ksh",
"/bin/csh",
"/bin/dash",
"etc/shells",
"/bin/zsh",
"/bin/fish",
"/bin/tmux",
"/bin/rbash",
"/bin/sh",
"/usr/bin/zsh",
}

CxPolicy[result] {
resource := input.document[i].command[name][_]
resource.Cmd == "run"
value := resource.Value
shell_possibilities := {"/bin/bash", "/bin/tcsh", " /bin/ksh", "/bin/csh", "/bin/dash" , "etc/shells", "/zsh", "/bin/fish", "/bin/tmux", "/bin/rbash"}

contains(value[v], shell_possibilities[p])
run_values := split(value[v], " ")
command := run_values[0]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "68a51e22-ae5a-4d48-8e87-b01a323605c9",
"queryName": "Using Unnamed Build Stages",
"severity": "MEDIUM",
"severity": "LOW",
"category": "Build Process",
"descriptionText": " This query is used to ensure that build stages are named. This way even if the Dockerfile is re-ordered, the COPY instruction doesn’t break.",
"descriptionUrl": "https://docs.docker.com/develop/develop-images/multistage-build/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"queryName": "Using Unnamed Build Stages",
"severity": "MEDIUM",
"severity": "LOW",
"line": 10,
"filename": "positive1.dockerfile"
}
Expand Down

0 comments on commit ffc68a7

Please sign in to comment.