Git Product home page Git Product logo

saver's Introduction

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.2

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.2
        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:[email protected]: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.2
        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.2
  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.2).

Image:tag Description
cisagov/saver:1.3.2 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.2 \
  --tag cisagov/saver:1.3.2 \
  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.2 \
      --output type=docker \
      --tag cisagov/saver:1.3.2 .

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.

saver's People

Contributors

cfx47 avatar climber-girl avatar dav3r avatar dependabot[bot] avatar felddy avatar hillaryj avatar jmorrowomni avatar jsf9k avatar kyleevers avatar mcdonnnj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

saver's Issues

Leverage CISA_HOME environment variable in Python code

๐Ÿ’ก Summary

We should leverage the CISA_HOME environment variable in the Python code instead of hardcoding /home/cisa.

Motivation and context

If the user overrides the CISA_HOME variable when building the Docker image then the code as it currently stands will fail.

Implementation notes

The modification would take place here, for example.

Make container tests functional

๐Ÿ’ก Summary

In #61 I commented out most of the tests because the container as it stands does not support them. The container should be altered to support these tests, at which point they should be uncommented again.

Motivation and context

Containers should undergo some testing as a part of the CI process.

Acceptance criteria

  • All possible tests are supported by the container, and passing in GitHub Actions.

Coordination with CISA Chief Data Officer to implement data standards for this list (and systems that use it).

๐Ÿ’ก Summary

The CISA Chief Data Officer (CDO) is working on data standards, and I think some of them should apply here!

Motivation and context

Implementing data standards helps facilitate common understanding, data sharing, and system interoperability across CISA and DHS.

Implementation notes

Requesting contributors reach out to your data steward at CISA or the CDO Office to discuss further. There is a form to submit proposed changes to the data standards on CISA's intranet.

Acceptance criteria

When all the values on this list correspond with the data standard and are implemented in systems that rely on this list. Ideally, automate the process for updating this list to correspond with the appropriate data standard.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.