Skip to content

CI/CD Integration#

This method runs container image scans and dependency library scans within a CI/CD pipeline and uploads the results to FutureVuls.

Target Method Procedure Scan method description
Container images Scan with Trivy and upload Integrating Container Image Scanning into CI/CD Container Image Scan (Trivy)
Application dependency libraries Scan a directory with Trivy and upload Scanning for Library Vulnerabilities on git push Dependency Library Scan
Application dependency libraries Update the Lockfile of a registered server How to Automatically Update a Lockfile on Push with GitHub Actions Dependency Library Scan > Lockfile Paste Scan

The configuration information is updated each time you run the pipeline. The figure below shows the flow of the method that scans with Trivy and uploads the results.

C/C++ libraries whose source code is copied directly into a project are identified with a dedicated command, so the steps differ. See "C/C++ Library Scan (Identification) > CI/CD Integration".

In the CI/CD pipeline, the scan target is prepared, scanned with Trivy, and the results are uploaded, and FutureVuls identifies the server by UUID and registers or updates its configuration information

The samples on this page cover the process up to uploading the configuration information to FutureVuls. You check the detected vulnerabilities in the FutureVuls UI.

With the method that scans with Trivy, you specify the server UUID. FutureVuls treats uploads with the same UUID as updates to the same server.

  1. The first time, generate a UUID only once with a command such as uuidgen and specify that fixed value in the pipeline settings. The first run registers a new server in FutureVuls.
  2. From the second run onward, specify the same UUID. The configuration information of the same server is updated.
  3. To update a server already registered in FutureVuls, specify the UUID of that server, which you check in the UI.

If you configure the pipeline to generate a UUID on each run, a separate server is registered on each run.

Integrating Container Image Scanning into CI/CD#

This section explains how to scan container images and upload the results to FutureVuls within a CI/CD pipeline using GitHub Actions and AWS CodePipeline.

The following environment variables need to be defined:

Variable Description Required
VULS_SAAS_GROUPID The ID of the group to which the scan results will be uploaded. Check it in the URL shown when you open the group settings (https://console.vuls.biz/org/xxx/group/[group ID]/setting/profile). Please store this as an encrypted secret. ✅
VULS_SAAS_TOKEN A FutureVuls token with scanning permissions. Check it from Group Settings → Token (see "Managing Scanner Tokens"). Please store this as an encrypted secret. ✅
DOCKERFILE_PATH The path to the Dockerfile used to build the image. ✅
TARGET_IMAGE The image to be scanned.
Specify in the format <image_name>:<tag>.
✅
VULS_SAAS_UUID The Server UUID in FutureVuls that uniquely identifies the target image.
For new registrations, specify, as a fixed value, a value generated only once by a command like uuidgen.
If you specify the UUID of a server already registered in FutureVuls, the configuration information of that server is updated.
✅

You can check the UUID in Server UUID under "Server Information" on the "Description" tab of the server details.

image-uuid

Environment Variable Configuration

It is recommended to set the following environment variables using encrypted secrets.

  • VULS_SAAS_GROUPID
  • VULS_SAAS_TOKEN

If these values are exposed, anyone could upload arbitrary scan results to the specified group in FutureVuls.

Integrating Container Image Scanning into a CI/CD Pipeline Using GitHub Actions#

This is an example of a GitHub Actions workflow that uses the Trivy integration script to perform a scan within a CI/CD pipeline.

The script (vuls-trivy-light.sh) creates a working directory vuls-trivy-scan directly under the directory in which it runs, and deletes the entire directory when it exits normally. If a directory with the same name exists directly under the repository, its contents are also deleted (see "Installing the Trivy Scanner"). The examples on this page stop with test ! -e vuls-trivy-scan before running the script if a path with the same name exists.

name: FutureVuls Docker Image Scan
on:
  push
defaults:
  run:
      shell: bash
jobs:
  docker-test:
    name: FutureVuls Docker Image Scan
    env:
      VULS_SAAS_GROUPID: ${{ secrets.VULS_SAAS_GROUPID }}
      VULS_SAAS_TOKEN: ${{ secrets.VULS_SAAS_TOKEN }}
      DOCKERFILE_PATH: "docker/anything/Dockerfile"
      TARGET_IMAGE: "imageName:tag"
      VULS_SAAS_UUID: "xxxxxxxx"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: scan and upload
      run: |
        docker build . -f "${DOCKERFILE_PATH}" -t "${TARGET_IMAGE}"
        test ! -e vuls-trivy-scan # stop if a path with the same name exists
        curl -s https://installer.vuls.biz/vuls-trivy-light.sh | \
        VULS_SAAS_GROUPID="${VULS_SAAS_GROUPID}" \
        VULS_SAAS_TOKEN="${VULS_SAAS_TOKEN}" \
        TARGET_IMAGE="${TARGET_IMAGE}" \
        VULS_SAAS_UUID="${VULS_SAAS_UUID}" \
        bash -s inst

Integrating Vulnerability Scanning into a CI/CD Pipeline Using AWS CodePipeline#

This is an example of a buildspec.yml file that uses the Trivy integration script to perform a scan within a CI/CD pipeline.

version: 0.2

#env:
#  variables:
    #VULS_SAAS_GROUPID: "define in secret manager"
    #VULS_SAAS_TOKEN: "define in secret manager"
    #DOCKERFILE_PATH: "./Dockerfile"
    #TARGET_IMAGE: "target_image:tag"
    #VULS_SAAS_UUID: "xxxx-FutureVuls-Server-UUID-xxxxxxxx"
phases:
  install:
    runtime-versions:
      python: latest
  build:
    commands:
      - 'docker build -f "$DOCKERFILE_PATH" -t "$TARGET_IMAGE" .'
  post_build:
    commands:
      - 'test ! -e vuls-trivy-scan' # stop if a path with the same name exists
      - 'curl -s https://installer.vuls.biz/vuls-trivy-light.sh | VULS_SAAS_GROUPID="$VULS_SAAS_GROUPID" VULS_SAAS_TOKEN=$VULS_SAAS_TOKEN TARGET_IMAGE=$TARGET_IMAGE VULS_SAAS_UUID=$VULS_SAAS_UUID bash -s inst'
      - "echo scan results Sent to Fvuls on `date`"

Integrating Application Library Scanning into CI/CD#

This section explains how to register and update the configuration information of application dependency libraries in FutureVuls within a GitHub Actions CI/CD pipeline. The following two methods are available.

Item Method that scans a directory with Trivy Method that uploads a Lockfile
Procedure Scanning for Library Vulnerabilities on git push How to Automatically Update a Lockfile on Push with GitHub Actions
Tool used The scanning script vuls-trivy-light.sh (Trivy) The GitHub Actions action futurevuls/fvuls-lockfile-uploader
Registration destination When you upload the scan results, the scanned directory is registered as one server Registered as a Lockfile in the Application tab of a registered server
Required token A token with scanning permissions (VULS_SAAS_TOKEN) and the group ID (VULS_SAAS_GROUPID) A FutureVuls API token whose API permission includes Update (FVULS_TOKEN)
Meaning of the UUID VULS_SAAS_UUID is the UUID that identifies the server to register or update. For new registrations, you generate it FVULS_SERVER_UUID is the UUID of the registered server to use as the registration destination of the Lockfile
Initial preparation Generate a UUID only once and specify that fixed value in the pipeline settings Register the registration destination server in FutureVuls (if you have no server to use as the registration destination, create a pseudo server)

Scanning for Library Vulnerabilities on git push#

Upload the results of an application library scan to FutureVuls upon a git push. This section provides an example using GitHub Actions.

Environment Variables Used in the Example#

Variable Description Required
VULS_SAAS_GROUPID The ID of the group to which the scan results will be uploaded. Where to check it is the same as in the table in "Integrating Container Image Scanning into CI/CD". ✅
VULS_SAAS_TOKEN A token with scanning permissions. Where to check it is the same as in the table in "Integrating Container Image Scanning into CI/CD". ✅
TARGET_LIBRARY The path of the directory to be scanned.
To scan the entire repository, you can specify ${{ github.workspace }}.
✅
VULS_SAAS_UUID The UUID for management in FutureVuls.
For new registrations, specify, as a fixed value, a value generated only once by a command like uuidgen.
✅

To update the configuration information of a library already managed on FutureVuls, specify the target library's UUID as VULS_SAAS_UUID.

lib-uuid

Environment Variable Configuration

It is recommended to set the following environment variables using encrypted secrets.

  • VULS_SAAS_GROUPID
  • VULS_SAAS_TOKEN

If these values are exposed, anyone could upload arbitrary scan results to the specified group in FutureVuls.

The scan is performed using the scanning script file. The script reads the environment variables defined in env: of the job (VULS_SAAS_GROUPID, VULS_SAAS_TOKEN, TARGET_LIBRARY, and VULS_SAAS_UUID).

name: FutureVuls library Scan 
on: 
  push: 
defaults: 
  run: 
      shell: bash 
jobs: 
  docker-test: 
    name: FutureVuls library Scan 
    env: 
      VULS_SAAS_GROUPID: ${{ secrets.VULS_SAAS_GROUPID }}
      VULS_SAAS_TOKEN: ${{ secrets.VULS_SAAS_TOKEN }}
      TARGET_LIBRARY: "${{ github.workspace }}" 
      VULS_SAAS_UUID: "xxxx" 
    runs-on: ubuntu-latest 
    steps: 
    - uses: actions/checkout@v4 
    - name: scan and upload 
      run: |
        test ! -e vuls-trivy-scan # stop if a path with the same name exists
        curl -s https://installer.vuls.biz/vuls-trivy-light.sh | bash -s inst

How to Automatically Update a Lockfile on Push with GitHub Actions#

This section explains how to use futurevuls/fvuls-lockfile-uploader to update a lockfile registered in FutureVuls through the REST API only when the lockfile changes on git push. This method does not use Trivy. If a lockfile with the same path is already registered on the server, the action updates it; otherwise, it registers a new one. You need to register the registration destination server in FutureVuls in advance.

The example below runs when a push to the release branch modifies go.mod or web/yarn.lock, and then uploads both lockfiles. Write the paths: patterns without a leading ./.

The following environment variables in the sample should be set as Encrypted Secrets. Pass them only in the env: of the steps that run this action so that other actions in the same job cannot read the token.

Environment Variable Name How to Check
FVULS_SERVER_UUID The UUID of the server that is the registration destination of the lockfile. Check from the Server List.
FVULS_TOKEN A FutureVuls API token. Specify a token whose API permission includes Update. Create and check it in Group Settings > Token (see "Creating a FutureVuls API Token"). This is a different token from the scanner token (VULS_SAAS_TOKEN).

In with:, specify the path to the lockfile, relative to the repository root, in path and the string to prepend to the path registered in FutureVuls in repoName. The registered path depends on repoName as follows.

repoName path Registered Path
(not specified) ./go.mod go.mod
owner/repo ./web/yarn.lock owner/repo/web/yarn.lock
on:
  push:
    ## https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths
    paths:
      - 'go.mod'
      - 'web/yarn.lock'
    branches:
      - release

name: Check lockfiles

permissions:
  contents: read

jobs:
  build:
    name: Upload lockfile
    runs-on: ubuntu-26.04
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - name: Upload go.mod
        uses: futurevuls/fvuls-lockfile-uploader@9245e71ad5a5833acf0196650027fc4a6be78921 # v2
        env:
          FVULS_SERVER_UUID: ${{ secrets.FVULS_SERVER_UUID }}
          FVULS_TOKEN: ${{ secrets.FVULS_TOKEN }}
        with:
          repoName: ${{ github.repository }}
          path: './go.mod'
      - name: Upload web/yarn.lock
        uses: futurevuls/fvuls-lockfile-uploader@9245e71ad5a5833acf0196650027fc4a6be78921 # v2
        env:
          FVULS_SERVER_UUID: ${{ secrets.FVULS_SERVER_UUID }}
          FVULS_TOKEN: ${{ secrets.FVULS_TOKEN }}
        with:
          repoName: ${{ github.repository }}
          path: './web/yarn.lock'

Troubleshooting#

Check the common causes and fixes on the following pages.