You are here: Integration Guides > Travis CI

Travis CI

Before You Begin

These instructions describe how to push a Docker image from Travis CI to Tenable.io Container Security.

These steps assume you are already comfortable using Travis CI and are already pushing Docker images to a public or private registry. If you are already using Travis CI, but have not built Docker container images, familiarize yourself with the Travis CI documentation Using Docker in Builds.

Steps

  1. Open the travis.yml file.
  2. Add your Tenable.io Container Security credentials.

    $ travis encrypt TENABLE_IO_CONTAINER_SECURITY_EMAIL=email@organization.com

    $ travis encrypt TENABLE_IO_CONTAINER_SECURITY_USER=username

    $ travis encrypt TENABLE_IO_CONTAINER_SECURITY_PASSWORD=password

  3. Add your environment variables.

    env:

    global:

    - secure: "UkF2CHX0lUZ...VI/LE=" # TENABLE_IO_CONTAINER_SECURITY_EMAIL

    - secure: "Z3fdBNPt5hR...VI/LE=" # TENABLE_IO_CONTAINER_SECURITY_USER

    - secure: "F4XbD6WybHC...VI/LE=" # TENABLE_IO_CONTAINER_SECURITY_PASSWORD

    - COMMIT=${TRAVIS_COMMIT::8}

  4. Add your connection information.

    after_success:

    - docker login -u $TENABLE_IO_CONTAINER_SECURITY_USER -p $TENABLE_IO_CONTAINER_SECURITY_PASSWORD registry.tenable.com

    - export REPO=sebestblog/travis-demo

    - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`

    - docker build -f Dockerfile -t $REPO:$COMMIT .

    - docker tag $REPO:$COMMIT $REPO:$TAG

    - docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER

    - docker push $REPO

    Travis CI builds are sent to Tenable.io Container Security for storage, distribution, vulnerability scanning, and malicious code scanning.

Copyright © 2017. Tenable Network Security, Inc. All rights reserved. Tenable Network Security, Nessus, SecurityCenter Continuous View, Passive Vulnerability Scanner, and Log Correlation Engine are registered trademarks of Tenable Network Security, Inc. All other products or services are trademarks of their respective owners.