Package: bpq
bpqA suite of helpful tools for interacting with theBad Packets Cyber Threat
Intelligence API.Getting startedEnvironment requirementsIn order to run the code in this repository, you need to have a standard
release of Python version 3.6 or higher installed. No additional libraries are
required.If you prefer running your applications in containers, skip to thecontainer build and run section.Installing$python3-mpipinstallbpqBuildingIf you prefer to installbpqusing a local build, you can do so usingpip.$python3-mpipinstall.Running the CLI tool$bpq-h
usage:bpq[-h]# ... usage information followsPullsBadPacketsCTIdata.Allargumentsgivenatthecommandlinecanbe
specifiedusingenvironmentvariables.Forexample,acommandlineoptionof`--output-formatcsv`isequivalenttosettingtheenvironmentvariable`OUTPUT_FORMAT=csv`.Anyargumentnotspecifiedwillbepopulatedwithan
environmentvariableorthedefaultvalueindicatedin`--help`.# ... argument documentation followsRunning without buildingYou can still run the command line application without building a package if
you like. Just runpython3 -m bpq.cliinstead ofbpq.ExamplesYou can find example scripts (using this CLI tool, the Python API andcurl)
in the project'sexamplesdirectory.Another note on authenticating and using command line argumentsThe shell script will attempt to resolve parameters from environment variables.
The most important environment variables are:Variable nameDescriptionBAD_PACKETS_API_TOKENToken use for API authenticationLOG_LEVELLog verbosity. Can have a value ofERROR,WARNING,DEBUGorINFOIf no environment variable exists or a command line argument is given,
the tool will take the command line argument (i.e. command line arguments
always have priority over environment variables).DevelopingDevelopment help is always welcome! Full documentation on how to get started is
in the project'sCONTRIBUTING.rstfile.
Please be nice and follow ourcode of conductwhenever you participate.Building the application containerThis application is designed to run only in an unprivileged container as a
non-root user. Docker and Podman are supported for building container images,
and we currently support Alpine andRed Hat Universal Base Image (UBI)as base operating systems.
You can control the version of Python defining thePYTHON_VERSIONparameter
at build time.UsingdockerTo build a container with the default base image (Python 3.9 running on the
latest stable version of Alpine), rundocker build --rm --no-cache -t bpq .ThePYTHON_VERSIONbuild argument can be used to control which
version of Python you are using. For example,docker build --rm --no-cache --build-arg PYTHON_VERSION=3.6 -t bpq .will build an application image running Python 3.6.Usingpodmanpodman build --rm --no-cache -t bpq .Note thatpodmanreadsContainerfileby default, which builds from theRed Hat Universal Base Image (UBI)rather than images from Docker Hub. Due to Red Hat's naming conventions, Python
versions should be formatted as${major}${minor}rather than${major}.${minor}. Concretely,--build-arg PYTHON_VERSION=38will build a
container that runs Python 3.8. If you  do not want to use the Python UBI at
all, pass--file Dockerfiletopodman.Running the application containerdocker run -e BAD_PACKETS_API_TOKEN=${BAD_PACKETS_API_TOKEN} bpqif using
Docker.podman run -e BAD_PACKETS_API_TOKEN=${BAD_PACKETS_API_TOKEN} bpqif
using Podman.ContributingContributions are encouraged! Learn how to contribute by readingCONTRIBUTING.md.
Please be nice and follow ourCode of Conduct.LicenseApache License 2.0Author InformationMathew Woodyard@ctidelivery