Skip to content

Latest commit

 

History

History
261 lines (186 loc) · 7.57 KB

README.md

File metadata and controls

261 lines (186 loc) · 7.57 KB

pshtt, trustymail, and sslyze Saver

GitHub Build Status CodeQL Known Vulnerabilities

Docker Image

Docker Pulls Docker Image Size (latest by date) Platforms

This is a Docker container for saving to a Mongo database pshtt, trustymail, and sslyze results collected via domain-scan.

This Docker container is intended to be run via orchestrator.

N.B.: The secrets in the src/secrets directory are only used when testing via the docker-compose.yml composition. Normally this Docker container is run via the Docker composition in cisagov/orchestrator, which expects the secrets in a different location.

Running

Running with Docker

To run the cisagov/saver image via Docker:

docker run cisagov/saver:1.3.7

Running with Docker Compose

  1. Create a docker-compose.yml file similar to the one below to use Docker Compose.

    ---
    version: "3.7"
    
    services:
      saver:
        image: cisagov/saver:1.3.7
        volumes:
          - type: bind
            source: <your_log_dir>
            target: /home/cisa/shared
  2. Start the container and detach:

    docker compose up --detach

Using secrets with your container

This container also supports passing sensitive values via Docker secrets. Passing sensitive values like your credentials can be more secure using secrets than using environment variables. See the secrets section below for a table of all supported secret files.

  1. To use secrets, create a database_creds.yml file in this format:

    ---
    version: '1'
    
    database:
      name: cyhy
      uri: mongodb://user:the_password@cyhy.example.com:27017/cyhy
    
  2. Then add the secrets to your docker-compose.yml file:

    ---
    version: "3.7"
    
    secrets:
      database_creds:
        file: database_creds.yml
    
    services:
      trustymail_reporter:
        image: cisagov/saver:1.3.7
        volumes:
          - type: bind
            source: <your_log_dir>
            target: /home/cisa/shared
        secrets:
          - source: database_creds
            target: database_creds.yml

Updating your container

Docker Compose

  1. Pull the new image from Docker Hub:

    docker compose pull
  2. Recreate the running container by following the previous instructions:

    docker compose up --detach

Docker

  1. Stop the running container:

    docker stop <container_id>
  2. Pull the new image:

    docker pull cisagov/saver:1.3.7
  3. Recreate and run the container by following the previous instructions.

Image tags

The images of this container are tagged with semantic versions of the underlying saver project that they containerize. It is recommended that most users use a version tag (e.g. :1.3.7).

Image:tag Description
cisagov/saver:1.3.7 An exact release version.
cisagov/saver:1.3 The most recent release matching the major and minor version numbers.
cisagov/saver:1 The most recent release matching the major version number.
cisagov/saver:edge The most recent image built from a merge into the develop branch of this repository.
cisagov/saver:nightly A nightly build of the develop branch of this repository.
cisagov/saver:latest The most recent release image pushed to a container registry. Pulling an image using the :latest tag should be avoided.

See the tags tab on Docker Hub for a list of all the supported tags.

Volumes

Mount point Purpose
/home/cisa/shared Output

Ports

There are no ports exposed by this container.

Environment variables

Required

There are no required environment variables.

Optional

There are no optional environment variables.

Secrets

Filename Purpose
database_creds.yml Cyber Hygiene read-only database credentials in this format.

Building from source

Build the image locally using this git repository as the build context:

docker build \
  --build-arg VERSION=1.3.7 \
  --tag cisagov/saver:1.3.7 \
  https://github.com/cisagov/saver.git#develop

Cross-platform builds

To create images that are compatible with other platforms, you can use the buildx feature of Docker:

  1. Copy the project to your machine using the Code button above or the command line:

    git clone https://github.com/cisagov/saver.git
    cd saver
  2. Create the Dockerfile-x file with buildx platform support:

    ./buildx-dockerfile.sh
  3. Build the image using buildx:

    docker buildx build \
      --file Dockerfile-x \
      --platform linux/amd64 \
      --build-arg VERSION=1.3.7 \
      --output type=docker \
      --tag cisagov/saver:1.3.7 .

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

This project is in the worldwide public domain.

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.