Giter Site home page Giter Site logo

gophish-docker's Introduction

gophish-docker ๐ŸŽฃ๐Ÿณ

GitHub Build Status CodeQL Known Vulnerabilities

Docker Image

Docker Pulls Docker Image Size (latest by date) Platforms

Creates a Docker container with an installation of the gophish phishing framework.

Running

Running with Docker

To run the cisagov/gophish image via Docker:

docker run cisagov/gophish:0.0.8

Running with Docker Compose

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

    ---
    version: "3.7"
    
    services:
      gophish:
        image: cisagov/gophish:0.0.8
        ports:
          - target: 3333
            published: 3333
            protocol: tcp
            mode: host
          - target: 8080
            published: 3380
            protocol: tcp
            mode: host
  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 file or files containing the values you want set.

  2. Then add the secret or secrets to your docker-compose.yml file:

    ---
    version: "3.7"
    
    secrets:
      config_json:
        file: ./src/secrets/config.json
      admin_fullchain_pem:
        file: ./src/secrets/admin_fullchain.pem
      admin_privkey_pem:
        file: ./src/secrets/admin_privkey.pem
      phish_fullchain_pem:
        file: ./src/secrets/phish_fullchain.pem
      phish_privkey_pem:
        file: ./src/secrets/phish_privkey.pem
    
    services:
      gophish:
        image: cisagov/gophish:0.0.8
        ports:
          - target: 3333
            published: 3333
            protocol: tcp
            mode: host
          - target: 8080
            published: 3380
            protocol: tcp
            mode: host
        secrets:
          - source: config_json
            target: config.json
          - source: admin_fullchain_pem
            target: admin_fullchain.pem
          - source: admin_privkey_pem
            target: admin_privkey.pem
          - source: phish_fullchain_pem
            target: phish_fullchain.pem
          - source: phish_privkey_pem
            target: phish_privkey.pem

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/gophish:0.0.8
  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 gophish project that they containerize. It is recommended that most users use a version tag (e.g. :0.0.8).

Image:tag Description
cisagov/gophish:0.0.8 An exact release version.
cisagov/gophish:0.0 The most recent release matching the major and minor version numbers.
cisagov/gophish:0 The most recent release matching the major version number.
cisagov/gophish:edge The most recent image built from a merge into the develop branch of this repository.
cisagov/gophish:nightly A nightly build of the develop branch of this repository.
cisagov/gophish: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

There are no volumes.

Ports

The following ports are exposed by this container:

Port Purpose
3333 Admin server
8080 Phishing server

The sample Docker composition publishes the exposed ports at 3333 and 3380, respectively.

Environment variables

Required

There are no required environment variables.

Optional

There are no optional environment variables.

Secrets

Filename Purpose
config.json Gophish configuration file
admin_fullchain.pem public key for admin port
admin_privkey.pem private key for admin port
phish_fullchain.pem public key for phishing port
phish_privkey.pem private key for phishing port

Building from source

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

docker build \
  --build-arg VERSION=0.0.8 \
  --tag cisagov/gophish:0.0.8 \
  https://github.com/cisagov/gophish-docker.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/gophish-docker.git
    cd gophish-docker
  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=0.0.8 \
      --output type=docker \
      --tag cisagov/gophish:0.0.8 .

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.

gophish-docker's People

Contributors

arcsector avatar dav3r avatar dependabot[bot] avatar felddy avatar hillaryj avatar jasonodoom avatar jmorrowomni avatar jsf9k avatar mcdonnnj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gophish-docker's Issues

Revert back to using gophish/gophish

๐Ÿ’ก Summary

When it is no longer necessary to use our own fork of gophish/gophish, revert the changes from PR #24.

Motivation and context

After the maintainers of gophish/gophish merge our mission-critical PRs (e.g. gophish/gophish#1486), we should no longer need to maintain our own fork of that repo. When that happens, we can revert this repo back to pulling the release binary from gophish/gophish.

Implementation notes

None

Acceptance criteria

How do we know when this work is done?

  • The Dockerfile for this repo pulls the release archive from gophish/gophish
  • A functional Docker image can be built with this Dockerfile

Upgrade to Debian Bullseye

๐Ÿ’ก Summary

This Docker image should be updated to use a Debian Bullseye base image.

Motivation and context

Builds are currently failing with the current code based on Debian Buster.

Acceptance criteria

  • This Docker image uses a Debian Bullseye base image.
  • The new Docker image functions as expected.

Landing page not being hosted on public IP or domain

๐Ÿ’ก Summary

After carefully following your steps and setting up the infrastructure, i cannot seem to setup a landing pages which hosts on my domain or public ip. I don't know maybe it has to do with the way the setup is done (cloudflare). When i visit my domain or public Ip on port 80 it just show a white background. No cloned pages exist

Make `get-api-key` name and output less ambiguous

๐Ÿ’ก Summary

Currently, the get-api-key script will output one API key for every user in the Gophish database. At minimum, this script should be modified so that its name is changed to get-api-keys and documented appropriately to make it clear that multiple keys may be returned.

Two other solutions have been discussed:

  • Make the script accept an optional username as an input and output the API key of that user if it exists. If no username is supplied, the username of the default Gophish user (e.g. admin) would be used.
  • Have the script simply return the API key of the default Gophish user.

If either of those solutions are implemented, it's important to conspicuously document the fact that this script will not work as intended if the default Gophish user is ever deleted.

Motivation and context

This was originally noted by @mcdonnnj in cisagov/pca-gophish-composition-packer#70 (review). That PR added a band-aid solution in response to the issues noted above.

Implementation notes

See options discussed in "Summary" section above.

Acceptance criteria

  • The name of the get-api-key accurately reflects the full range of potential outputs (i.e. zero or more API keys).
  • The code and README are updated to reflect the changes made.
  • Optional: The script accepts a username as input and outputs the corresponding API key. The username here may be optional and default to a particular Gophish user.

Add ENV variable to specify path of config.json

Please make the config.json in something other than ./config.json or allow me to use an environment variable. I am trying to map it to the docker container but every time I try ./config.json or /config.json, it can't see it. and i can't bash into the container because it says it's restarting

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.