Skip to content

Repository files navigation

Peirates

Release gosec

Logo

What is Peirates?

Peirates, a Kubernetes penetration tool, enables an attacker to escalate privilege and pivot through a Kubernetes cluster. It automates known techniques to steal and collect service account tokens, secrets, obtain further code execution, and gain control of the cluster.

Where do I run Peirates?

You run Peirates from a container running on Kubernetes or from a Kubernetes node, outside the container.

Does Peirates attack a Kubernetes cluster?

Yes, it absolutely does. Talk to your lawyer and the cluster owners before using this tool in a Kubernetes cluster.

Who creates Peirates?

InGuardians' CTO Jay Beale first conceived of Peirates and put together a group of InGuardians developers to create it with him, including Faith Alderson, Adam Crompton and Dave Mayer. Faith convinced us to all learn Golang, so she could implement the tool's use of the kubectl library from the Kubernetes project. Adam persuaded the group to use a highly-interactive user interface. Dave brought contagious enthusiasm. Together, these four developers implemented attacks and began releasing this tool that we use on our penetration tests.

Other contributors have helped as well - see GitHub to see more, but please also review credits.md.

Do you welcome contributions?

Yes, we absolutely do. Submit a pull request and/or reach out to peirates-dev@inguardians.com.

What license is this released under?

Peirates is released under the GPLv2 license.

Running Peirates

If you just want the peirates binary to start attacking things, grab the latest release from the releases page.

For command behavior, prerequisites, side effects, cleanup, and troubleshooting, see the main menu command reference.

Peirates as a Container Image

You can find a useful alpine-peirates container image on Docker Hub, with a version number tag that tracks the Peirates version.

For example, for alpine-peirates:v1.1.27d, which contains peirates version v1.1.27d, run:

docker pull bustakube/alpine-peirates:v1.1.27d

Building Peirates

However, if you want to build from source, read on!

Get peirates

go get -v "github.com/inguardians/peirates"

Get libary sources if you haven't already (Warning: this will take almost a gig of space because it needs the whole kubernetes repository)

go get -v "k8s.io/kubectl/pkg/cmd" "github.com/aws/aws-sdk-go"

Build the executable

cd $GOPATH/github.com/inguardians/peirates
make

The default build target generates a statically linked Linux AMD64 executable named peirates in the repository root. You can also invoke it explicitly with make build.

Build compressed Linux distributions for AMD64, ARM, ARM64, and 386:

make dist

Distribution archives contain statically linked binaries and are written to scripts/. Set DIST_COMPRESS=no to keep unpacked binaries or DIST_ARCHES=amd64 to build a subset of architectures. Individual targets such as make dist-arm64 are also available.

About

Peirates - Kubernetes Penetration Testing tool

Resources

Security policy

Stars

1.5k stars

Watchers

29 watching

Forks

Releases

Packages

Used by

Contributors

Languages