-
Notifications
You must be signed in to change notification settings - Fork 8
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
GitLab-specific instructions not working #30
Comments
Was trying to integrate a self-hosted SSC with self-hosted GitLab instance and had been running into the aforementioned
Failure-exits. Is there a recommended workaround for this, given the nature of my testing-environment? |
I don't think there's an easy way to have the Docker image use a custom trust store, but you could consider one of the following work-arounds:
|
Ultimately, I ended up doing:
In my case, since the SSC server's certificate was signed by an intermediate-CA, I had to import both the root-CA and the intermediate CAs in order for the exporter to be happy with things. For anyone running into a similar scenario to mine and Googled their way to this issue-thread, this entailed:
|
Thanks for sharing the instructions! I'll look at adding some information on using custom certificates in the documentation for a future version of FortifyVulnerabilityExporter; for now users can refer to the information you shared. |
Note: still getting issues when trying to use anything newer than the 1.4.1 version. It's more of a problem, now, because the customer I'm doing work for doesn't feel comfortable using images off of DockerHub and wants me to repackage things onto UBI8. Tried gleaning useful information from this project's GitHub Actions content. However, unless I use
So, I think I'm missing something in my Dockerfile. Is there a reference Dockerfile, or is this project's GitHub Actions content the closest I'm going to get? |
The standard Docker images are built directly by Gradle; if you want to build a custom image from scratch, following is a snippet that I use in another Dockerfile:
I think GitLab expects a container with no entrypoint, but rather a container where it can start a shell to run the script steps; this is the main cause of this particular issue. So, for your custom Docker image, it's probably best to not have an As for the particular error that you are seeing, this is because the plugin jar files cannot be found in one of the default locations (notice the first INFO message in your output, stating that 0 plugin configuration files have been loaded). As of version 1.5.0, plugin jars are bundled with the main application jar so you should no longer have that issue. |
Thank you for the response. Yeah, working with containerized tools in GitLab has been fun. Previously, I'd written a Python-based utility that I'd intended to use as both a standalone tool (hand-executable with commandline switches and flags) as well as a containerized application. Unfortunately, the GitLab runners always pass in that My first stab at trying to get a container that meets their starting-point desire was to pull a copy of the (v1.4.1) DockerHub image to use as a base-stage, and then copy off the relevant bits (a really icky kludge):
And, while it produces a functional container, it doesn't solve my eventual security problem with getting an allowance for bringing in the Dockerhub-hosted container into the production environment. So, started down the path of trying to build a container from source using the recommended, gradle-based method:
Unfortunately, that method didn't produce a functional image (gives me the previously-posted error). |
Ok, so, for what it's worth… In order for the 1.5.x content to function with GitLab, setting:
After having used:
In my build container and having set the |
Interesting, that makes me wonder what happens with the |
I'm doing a multi-step pipeline. I have it "stageless", with the export step (
The group that requested my automation-assistance wanted the exported content not only made available in the GitLab security dashboards, but also as downloadable artifacts …even though I have an earlier step ‐ which runs concurrent to the Note: being in a private VPC, the environment's services leverage a private CA which further necessitates the use of the |
I know this is an old issue, but I thought I would leave a solution that worked for me in case others are still having this issue with the newer versions like I did.
Hopefully this helps |
A docker-in-docker runner will also work: ---
fortify_scanning:
tags:
- dockerindocker
script:
- export name="$(date +%s)"
- docker run --name "${name}" fortifydocker/fortify-vulnerability-exporter SSCToGitLab --ssc.baseUrl=https://example.com/ssc --ssc.authToken=${SSC_CI_TOKEN_DECODED} --ssc.version.name=${SSC_APP_ID}
- docker cp "${name}:/export" ./
allow_failure: true
artifacts:
reports:
sast: ./export/gl-fortify-sast.json
dast: ./export/gl-fortify-dast.json
dependency_scanning: ./export/gl-fortify-depscan.json |
Thanks everyone for listing some work-arounds. At some point, I hope to find some time to come up with / document a proper solution. |
I somewhat forgot about this issue until someone ran into this problem again; I've now updated the documentation to list the work-around mentioned in #30 (comment). As similar functionality is now available in fcli and FortifyVulnerabilityExporter will eventually be deprecated, we'll just stick to this work-around for now. |
Due to a change in configuration file handling, the GitLab-specific instructions in the README.md file are no longer functional. GitLab seems to be passing
sh
to the Docker container, which was ignored by older versions of the image but FortifyVulnerabilityExporter version 1.5.0 tries to interpret this as a configuration file specification. As there is no configuration file namedsh
, FortifyVulnerabilityExporter will fail.As a quick work-around, please try using the older version of the Docker image using the following image instruction in your
.gitlab-ci.yml
:Alternatively, you can use FortifyToolsInstaller to install and run FortifyVulnerabilityExporter in any arbitrary container; see https://gitlab.com/Fortify/example-eightball/-/blob/master/.gitlab-ci.yml#L58 for an example.
The text was updated successfully, but these errors were encountered: