Panther is a collection of serverless applications deployed within your AWS account. The frontend is a React application which runs in a Docker container (via ECS), and the backend is a collection of compute (Lambda), storage (DynamoDB / S3), and other supporting services.
The sections below provide guidance on how to extend Panther to meet your individual needs.
You can use the Docker environment from the quick start instructions for development. However, it's faster to compile and test the code locally.
For MacOS w/ homebrew:
brew install go node python3
Add go tools to your environment:
export GOPATH=$HOME/go PATH=$PATH:$GOPATH/bin
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"unzip awscli-bundle.zipsudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Install Docker and make sure the daemon is running in the background.
go get github.com/magefile/mage
Finally, install the remaining development libraries:
Panther uses mage, a Go tool similar to
make , to manage the development lifecycle.
mage from the repo root to see the list of available commands:
Targets:build:api Generate Go client/models from Swagger specs in api/build:lambda Compile Go Lambda function sourceclean Remove auto-generated build artifactsdeploy Deploy application infrastructuredoc:cfn Cfn will generate user documentation from deployment CloudFormationfmt Format source filesglue:sync Sync glue table partitions after schema changesetup:all Install all development dependenciessetup:go Install goimports, go-swagger, and golangci-lintsetup:python Install the Python virtual envsetup:web Npm installteardown Destroy all Panther infrastructuretest:cfn Lint CloudFormation templatestest:ci Run all required checkstest:cover Run Go unit tests and view test coverage in HTMLtest:go Test Go sourcetest:integration Run integration tests (integration_test.go,integration.py)test:python Test Python sourcetest:web Test web source
You can easily chain
mage commands together, for example:
mage fmt test:ci deploy
Run our test suite:
Run integration tests against a live deployment:
WARNING: integration tests will erase all Panther data stores
To run tests for only one package:
PKG=./internal/compliance/compliance-api/main mage test:integration
To update your deployment of Panther, follow the steps below:
Checkout the latest release:
git fetch origin master
git checkout tags/v1.0.0
Clean the existing build artifacts:
Deploy the latest application changes:
Since the majority of Panther is written in Go, the repo follows the standard Go project layout:
Input/output models for communicating with Panther's backend APIs
CloudFormation templates for deploying Panther itself or integrating the accounts you want to scan
Documentation, license headers, README, images, code of conduct, etc
Source code for all of Panther's Lambda functions
Standalone Go libraries that could be directly imported by other projects. This folder is licensed under Apache v2
Magefile source and other build infrastructure
Source for the Panther web application