Skip to content
Snippets Groups Projects
Commit c31d38c9 authored by Aaron Weaver's avatar Aaron Weaver
Browse files

Docker updates and luanch webhook.

parent a7ec9189
Branches
No related tags found
No related merge requests found
...@@ -183,7 +183,7 @@ checkmarx: ...@@ -183,7 +183,7 @@ checkmarx:
description: "Checkmarx is a source code analysis product that allows organization to scan uncompiled code and identify vulnerabilities." description: "Checkmarx is a source code analysis product that allows organization to scan uncompiled code and identify vulnerabilities."
url: https://www.checkmarx.com/technology/static-code-analysis-sca/ url: https://www.checkmarx.com/technology/static-code-analysis-sca/
documentation: https://checkmarx.atlassian.net/wiki/spaces/KC/overview documentation: https://checkmarx.atlassian.net/wiki/spaces/KC/overview
docker: appsecpipeline/base:1.0 docker: "appsecpipeline/base-tools:1.0"
parameters: parameters:
LOC: LOC:
type: runtime type: runtime
......
...@@ -63,6 +63,9 @@ ARG SSLLAB=1.4.0 ...@@ -63,6 +63,9 @@ ARG SSLLAB=1.4.0
RUN wget -qO- https://github.com/ssllabs/ssllabs-scan/releases/download/v${SSLLAB}/ssllabs-scan_${SSLLAB}-linux64.tgz | tar xvz -C /usr/bin --strip-components=1 RUN wget -qO- https://github.com/ssllabs/ssllabs-scan/releases/download/v${SSLLAB}/ssllabs-scan_${SSLLAB}-linux64.tgz | tar xvz -C /usr/bin --strip-components=1
########## Checkmarx Install ##########
RUN pip install -r /usr/bin/appsecpipeline/tools/checkmarx/requirements.txt
########## Change to appsecpipeline user ########## ########## Change to appsecpipeline user ##########
USER appsecpipeline USER appsecpipeline
......
...@@ -2,6 +2,8 @@ FROM node:9.4.0 ...@@ -2,6 +2,8 @@ FROM node:9.4.0
# ASPTAG = appsecpipeline/node:1.0 # ASPTAG = appsecpipeline/node:1.0
USER root
RUN apt-get update \ RUN apt-get update \
&& apt-get upgrade -y \ && apt-get upgrade -y \
&& apt-get install -y \ && apt-get install -y \
...@@ -11,6 +13,8 @@ RUN apt-get update \ ...@@ -11,6 +13,8 @@ RUN apt-get update \
python-pip \ python-pip \
python2.7 \ python2.7 \
python2.7-dev \ python2.7-dev \
&& apt-get remove python-pip -y \
&& easy_install pip \
&& usermod -u 2000 node \ && usermod -u 2000 node \
&& groupmod -g 2000 node \ && groupmod -g 2000 node \
&& find / /proc -prune -group 1000 -exec chgrp -h node {} \; \ && find / /proc -prune -group 1000 -exec chgrp -h node {} \; \
...@@ -29,6 +33,9 @@ RUN npm install -g retire ...@@ -29,6 +33,9 @@ RUN npm install -g retire
########## Install Synk Install ########## ########## Install Synk Install ##########
RUN npm install -g snyk RUN npm install -g snyk
########## Change to appsecpipeline user ##########
USER appsecpipeline
ENTRYPOINT ["launch.py"] ENTRYPOINT ["launch.py"]
HEALTHCHECK --interval=1m --retries=2 --timeout=5s CMD python /usr/bin/appsecpipeline/tools/health.py HEALTHCHECK --interval=1m --retries=2 --timeout=5s CMD python /usr/bin/appsecpipeline/tools/health.py
...@@ -31,6 +31,9 @@ RUN gem install wpscan ...@@ -31,6 +31,9 @@ RUN gem install wpscan
#Update WPScanner DB #Update WPScanner DB
RUN wpscan --update RUN wpscan --update
########## Change to appsecpipeline user ##########
USER appsecpipeline
ENTRYPOINT ["launch.py"] ENTRYPOINT ["launch.py"]
HEALTHCHECK --interval=1m --retries=2 --timeout=5s CMD python /usr/bin/appsecpipeline/tools/health.py HEALTHCHECK --interval=1m --retries=2 --timeout=5s CMD python /usr/bin/appsecpipeline/tools/health.py
...@@ -9,7 +9,7 @@ checkmarx: ...@@ -9,7 +9,7 @@ checkmarx:
description: "Checkmarx is a source code analysis product that allows organization to scan uncompiled code and identify vulnerabilities." description: "Checkmarx is a source code analysis product that allows organization to scan uncompiled code and identify vulnerabilities."
url: https://www.checkmarx.com/technology/static-code-analysis-sca/ url: https://www.checkmarx.com/technology/static-code-analysis-sca/
documentation: https://checkmarx.atlassian.net/wiki/spaces/KC/overview documentation: https://checkmarx.atlassian.net/wiki/spaces/KC/overview
docker: "appsecpipeline/base:1.0" docker: "appsecpipeline/base-tools:1.0"
parameters: parameters:
LOC: LOC:
type: runtime type: runtime
......
...@@ -4,7 +4,7 @@ git: ...@@ -4,7 +4,7 @@ git:
- "Utility" - "Utility"
type: "utility" type: "utility"
description: "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency." description: "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency."
docker: "appsecpipeline/base:1.0" docker: "appsecpipeline/base:1.1"
url: https://git-scm.com/ url: https://git-scm.com/
documentation: https://git-scm.com/docs/git documentation: https://git-scm.com/docs/git
parameters: parameters:
......
...@@ -35,6 +35,7 @@ def getYamlConfig(toolName): ...@@ -35,6 +35,7 @@ def getYamlConfig(toolName):
return yamlLoc return yamlLoc
def getParameterAttribs(toolName, command, authFile, key): def getParameterAttribs(toolName, command, authFile, key):
toolYaml = None
with open(authFile, 'r') as stream: with open(authFile, 'r') as stream:
try: try:
#Tool configuration #Tool configuration
...@@ -45,16 +46,16 @@ def getParameterAttribs(toolName, command, authFile, key): ...@@ -45,16 +46,16 @@ def getParameterAttribs(toolName, command, authFile, key):
if toolName in config: if toolName in config:
#Set the object to the tool yaml section #Set the object to the tool yaml section
tool = config[toolName] toolYaml = config[toolName]
toolParms = tool["parameters"] #toolParms = tool["parameters"]
for parameter in toolParms: #for parameter in toolParms:
if parameter in command: # if parameter in command:
command = command.replace("$" + parameter, f.decrypt(toolParms[parameter]["value"])) # command = command.replace("$" + parameter, f.decrypt(toolParms[parameter]["value"]))
except yaml.YAMLError as exc: except yaml.YAMLError as exc:
logging.warning(exc) logging.warning(exc)
return command return toolYaml
#Allow for dynamic arguments to support a wide variety of tools #Allow for dynamic arguments to support a wide variety of tools
#Format URL=Value, YAML Definition for substitution $URL #Format URL=Value, YAML Definition for substitution $URL
...@@ -267,20 +268,26 @@ def executeTool(toolName, profile_run, credentialedScan, test_mode, auth=None, k ...@@ -267,20 +268,26 @@ def executeTool(toolName, profile_run, credentialedScan, test_mode, auth=None, k
return toolStatus return toolStatus
def webhook(url, tool, toolStatus, runeveryTool, runeveryToolStatus): def webhook(url, tool, toolStatus, runeveryTool, runeveryToolStatus):
logging.info("Launching webhook for URL: " + url) logging.info("Launching Webhook for URL: " + url)
logging.info("Tool" + tool)
logging.info("toolStatus" + str(toolStatus))
method = "POST" method = "POST"
params = {} params = {}
if toolStatus == None:
toolStatus = 99 #Unknown error occured
params['tool'] = tool params['tool'] = tool
params['toolStatus'] = toolStatus params['toolStatus'] = toolStatus
if runeveryTool: if runeveryTool:
params['runeveryTool'] = runeveryTool params['runeveryTool'] = runeveryTool
if runeveryToolStatus == None:
runeveryToolStatus = 99
params['runeveryToolStatus'] = runeveryToolStatus params['runeveryToolStatus'] = runeveryToolStatus
logging.info("Tool" + tool)
logging.info("toolStatus" + str(toolStatus))
headers = { headers = {
'User-Agent': 'AppSecPipeline_Container_Tool', 'User-Agent': 'AppSecPipeline_Container_Tool',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment