/k8s-rbac-testing

Shell scripts for help automating rbac setup

Primary LanguageShellApache License 2.0Apache-2.0

Kubernetes RBAC Testing

Shell scripts for help automating RBAC setup on test Kubernetes clusters

The primary purpose is to create:

  • a service account
  • a namespace
  • RBAC rules that restrict the service account to only read/write to that namespace
  • RBAC rules that let the service account read Node information
  • a kubeconfig for the service account

Usage:

$ ./create-restricted-namespace.sh [namespace]

Creates a kubeconfig with a token for authentication. Instructions on how to use the kubeconfig will be printed to stdout.

Real, production auth systems use short-lived tokens that need to be refreshed periodically (e.g., aws-iam-authenticator). If you'd like to simulate that flow, use the -e option to create a fake auth script with rotate-able tokens.

$ ./create-restricted-namespace.sh -e [namespace]

Instructions on how to rotate the token will be printed to stdout.

QA

Verified working on

Won't work with:

Credits

Thanks to:

License

Copyright 2019 Windmill Engineering

Licensed under the Apache License, Version 2.0