KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
saver
★ 12
Open GitHub ↗
Save scan results to a database
Download README (.md)
Explore Similar Repositories
jump1jump
:
No description available.
dumplog
:
Android log utility
brew-autoremove
:
A script to remove Homebrew packages which are not used by other packages.
RLArithmetic
:
封装NSDecimalNumber, 可以链式调用
zHevo
:
My Hypercube Evolution 300x300x300 build
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
saver
?
Download (.md)
# pshtt, trustymail, and sslyze Saver # [](https://github.com/cisagov/saver/actions/workflows/build.yml) [](https://spdx.org/licenses/) [](https://github.com/cisagov/saver/actions/workflows/codeql-analysis.yml) ## Docker Image ## [](https://hub.docker.com/r/cisagov/saver) [](https://hub.docker.com/r/cisagov/saver) [](https://hub.docker.com/r/cisagov/saver/tags) This is a Docker container for saving to a [Mongo database](https://www.mongodb.com/) [pshtt](https://github.com/cisagov/pshtt), [trustymail](https://github.com/cisagov/trustymail), and [sslyze](https://github.com/nabla-c0d3/sslyze) results collected via [domain-scan](https://github.com/18F/domain-scan). To keep the database size manageable, it also deletes any results that are older than a year. This Docker container is intended to be run via [orchestrator](https://github.com/cisagov/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](https://github.com/cisagov/orchestrator), which expects the secrets in a different location. ## Running ## ### Running with Docker ### To run the `cisagov/saver` image via Docker: ```console docker run cisagov/saver:1.6.3 ``` ### Running with Docker Compose ### 1. Create a `compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/). ```yaml --- name: saver services: saver: image: cisagov/saver:1.6.3 volumes: - source: <your_log_dir> target: /home/cisa/shared type: bind ``` 1. Start the container and detach: ```console docker compose up --detach ``` ## Using secrets with your container ## This container also supports passing sensitive values via [Docker secrets](https://docs.docker.com/engine/swarm/secrets/). Passing sensitive values like your credentials can be more secure using secrets than using environment variables. See the [secrets](#secrets) section below for a table of all supported secret files. 1. To use secrets, create a `database_creds.yml` file in [this format](https://github.com/cisagov/mongo-db-from-config#usage): ```yaml --- version: '1' database: name: cyhy uri: mongodb://user:the_password@cyhy.example.com:27017/cyhy ``` 1. Then add the secrets to your `compose.yml` file: ```yaml --- name: saver secrets: database_creds: file: database_creds.yml services: trustymail_reporter: image: cisagov/saver:1.6.3 volumes: - source: <your_log_dir> target: /home/cisa/shared type: bind secrets: - source: database_creds target: database_creds.yml ``` ## Updating your container ## ### Docker Compose ### 1. Pull the new image from Docker Hub: ```console docker compose pull ``` 1. Recreate the running container by following the [previous instructions](#running-with-docker-compose): ```console docker compose up --detach ``` ### Docker ### 1. Stop the running container: ```console docker stop <container_id> ``` 1. Pull the new image: ```console docker pull cisagov/saver:1.6.3 ``` 1. Recreate and run the container by following the [previous instructions](#running-with-docker). ## Updating Python dependencies ## This image uses [Pipenv] to manage Python dependencies using a [Pipfile](https://github.com/pypa/pipfile). Both updating dependencies and changing the [Pipenv] configuration in `src/Pipfile` will result in a modified `src/Pipfile.lock` file that should be committed to the repository. ### Updating dependencies ### If you want to update existing dependencies you would run the following command in the `src/` subdirectory: ```console pipenv lock ``` ### Modifying dependencies ### If you want to add or remove dependencies you would update the `src/Pipfile` file and then update dependencies as you would above. > [!NOTE] > You should only specify packages that are direct requirements of > your Docker configuration. Allow [Pipenv] to manage the dependencies > of the specified packages. ## Image tags ## The images of this container are tagged with [semantic versions](https://semver.org) of the underlying saver project that they containerize. It is recommended that most users use a version tag (e.g. `:1.6.3`). | Image:tag | Description | | --------- | ----------- | | `cisagov/saver:1.6.3` | An exact release version. | | `cisagov/saver:1.6` | 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.](https://vsupalov.com/docker-latest-tag/) | See the [tags tab](https://hub.docker.com/r/cisagov/saver/tags) 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. <!-- The following ports are exposed by this container: --> <!-- | Port | Purpose | --> <!-- | ---- | ------- | --> <!-- | 8080 | Example only; nothing is actually listening on the port | --> <!-- The sample [Docker composition](docker-compose.yml) publishes the --> <!-- exposed port at 8080. --> ## Environment variables ## ### Required ### There are no required environment variables. <!-- | Name | Purpose | Default | | ---- | ------- | ------- | | `REQUIRED_VARIABLE` | Describe its purpose. | `null` | --> ### Optional ### | Name | Purpose | Default | | ---- | ------- | ------- | | `AWS_CONFIG_FILE` | The location of the config file containing AWS credentials. | `null` | | `AWS_SDK_LOAD_CONFIG` | If set to a truthy value (such as 1), ensures that the config file (and not just any credentials file that is present) is loaded. | `null` | ## Secrets ## | Filename | Purpose | | -------- | ------- | | aws_config | AWS CLI configuration in [this format](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html#cli-configure-files-format). | | scan_write_creds.yml | Cyber Hygiene read-write database credentials in [this format](https://github.com/cisagov/mongo-db-from-config#usage). | ## Building from source ## Build the image locally using this git repository as the [build context](https://docs.docker.com/engine/reference/commandline/build/#git-repositories): ```console docker build \ --tag cisagov/saver:1.6.3 \ https://github.com/cisagov/saver.git#develop ``` ## Cross-platform builds ## To create images that are compatible with other platforms, you can use the [`buildx`](https://docs.docker.com/buildx/working-with-buildx/) feature of Docker: 1. Copy the project to your machine using the `Code` button above or the command line: ```console git clone https://github.com/cisagov/saver.git cd saver ``` 1. Create the `Dockerfile-x` file with `buildx` platform support: ```console ./buildx-dockerfile.sh ``` 1. Build the image using `buildx`: ```console docker buildx build \ --file Dockerfile-x \ --platform linux/amd64 \ --output type=docker \ --tag cisagov/saver:1.6.3 . ``` ## Contributing ## We welcome contributions! Please see [`CONTRIBUTING.md`](CONTRIBUTING.md) for details. ## License ## This project is in the worldwide [public domain](LICENSE). 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](https://creativecommons.org/publicdomain/zero/1.0/). 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. [Pipenv]: https://pypi.org/project/pipenv/