Skip to content
Snippets Groups Projects
Commit bb43e750 authored by Jose Raul Barreras's avatar Jose Raul Barreras
Browse files

add Tenable support

parent 612f856f
No related branches found
No related tags found
4 merge requests!5Develop,!4Working copy,!3Static code analysis on xls branch,!1WIP: Static code analysis on xls branch
......@@ -2,22 +2,23 @@ stages:
- verify
- build
- test
- security
Check Makefile:
.Check Makefile:
stage: verify
tags:
- linux, dockerd
script:
- docker run --rm -v "${PWD}:/work" -w /work mandrean/checkmake ./Makefile
Lint and Validate dockerfiles:
.Lint and Validate dockerfiles:
stage: verify
tags:
- linux, dockerd
script:
- make test
Make All Images:
.Make All Images:
stage: build
image: projectatomic/dockerfile-lint
tags:
......@@ -25,9 +26,17 @@ Make All Images:
script:
- make
test:
.test:
stage: test
tags:
- dockerd
script:
- docker run --rm unl-its/static-code-analysis sonar-scanner -v
Push to Tenable:
stage: security
tags:
- linux, dockerd
script:
- make security
......@@ -19,7 +19,7 @@ GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD))
####################
BUILD_ARGS := --build-arg VCS_REF=$(GIT_COMMIT)
.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis delete_dangling_images
.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis delete_dangling_images security
all: \
php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_latest \
......@@ -74,6 +74,16 @@ $(IMAGES_TO_CLEAN):
@echo "Uninstalling $@"
@docker rmi $(shell docker images --format '{{.Repository}}:{{.Tag}}' --filter reference=$@)
IMAGES_TO_SCAN = $(shell docker images --format '{{.Repository}}:{{.Tag}}' | grep unl-its )
security:
docker login -u ${TENABLE_IO_ACCESS_KEY} -p ${TENABLE_IO_SECRET_KEY} registry.cloud.tenable.com
@for image in $(IMAGES_TO_SCAN); do \
tenable_name=`echo $$image | cut -d "/" -f 2`; \
echo "$$image ---> $$tenable_name"; \
docker tag $$image registry.cloud.tenable.com/$$tenable_name; \
docker push registry.cloud.tenable.com/$$tenable_name; \
done
delete_dangling_images:
@echo "Removing dangling images"
@docker image prune -f
......@@ -85,3 +95,4 @@ help:
debug:
@echo -e "DOCKERFILES: \t $(DOCKERFILES)"
@echo -e "IMAGES_TO_CLEAN:\t $(IMAGES_TO_CLEAN)"
@echo -e "IMAGES_TO_SCAN:\t $(IMAGES_TO_SCAN)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment