All Projects → ash2k → iam4kube

ash2k / iam4kube

Licence: Apache-2.0 License
AWS IAM support for Kubernetes

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to iam4kube

Cloudsplaining
Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.
Stars: ✭ 1,057 (+4704.55%)
Mutual labels:  aws-iam
Aws Csa Notes 2018
My AWS Certified Solutions Architect Associate Study Notes!
Stars: ✭ 167 (+659.09%)
Mutual labels:  aws-iam
react-relay-appsync
AppSync for Relay
Stars: ✭ 19 (-13.64%)
Mutual labels:  aws-iam
Keynuker
🔐💥 KeyNuker - nuke AWS keys accidentally leaked to Github
Stars: ✭ 82 (+272.73%)
Mutual labels:  aws-iam
Consoleme
A Central Control Plane for AWS Permissions and Access
Stars: ✭ 2,631 (+11859.09%)
Mutual labels:  aws-iam
assume-role-arn
🤖🎩assume-role-arn allows you to easily assume an AWS IAM role in your CI/CD pipelines, without worrying about external dependencies.
Stars: ✭ 54 (+145.45%)
Mutual labels:  aws-iam
Aws Extend Switch Roles
Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
Stars: ✭ 862 (+3818.18%)
Mutual labels:  aws-iam
masl
Assume an AWS Role using Onelogin
Stars: ✭ 24 (+9.09%)
Mutual labels:  aws-iam
Cloudrig
Stream your applications with Parsec and AWS on the cheap.
Stars: ✭ 151 (+586.36%)
Mutual labels:  aws-iam
terraform-aws-enforce-mfa
A terraform module to enforce MFA for AWS groups and users
Stars: ✭ 24 (+9.09%)
Mutual labels:  aws-iam
Smart Security Camera
A Pi Zero and Motion based webcamera that forwards images to Amazon Web Services for Image Processing
Stars: ✭ 103 (+368.18%)
Mutual labels:  aws-iam
Startup Aws Iam Roles
A list of typical positions in a startup and their policies for IAM AWS.
Stars: ✭ 118 (+436.36%)
Mutual labels:  aws-iam
AWSXenos
AWSXenos will list all the trust relationships in all the IAM roles and S3 buckets
Stars: ✭ 57 (+159.09%)
Mutual labels:  aws-iam
Rbiam
A unified IAM+Kubernetes RBAC access control exploration tool
Stars: ✭ 59 (+168.18%)
Mutual labels:  aws-iam
holochrome
Use your IAM role (from instance metadata) to open the AWS console
Stars: ✭ 102 (+363.64%)
Mutual labels:  aws-iam
Kiam
Integrate AWS IAM with Kubernetes
Stars: ✭ 969 (+4304.55%)
Mutual labels:  aws-iam
Aws Iam Generator
Generate Multi-Account IAM users/groups/roles/policies from a simple YAML configuration file and Jinja2 templates.
Stars: ✭ 191 (+768.18%)
Mutual labels:  aws-iam
desktop
A native GUI application that makes it easy to explore and test Serverless Framework applications built on AWS Lambda.
Stars: ✭ 42 (+90.91%)
Mutual labels:  aws-iam
grpc-vpn
🍄 VPN supporting authentication such as Google OpenID Connect or AWS IAM ..., over GRPC.
Stars: ✭ 49 (+122.73%)
Mutual labels:  aws-iam
aws-missing-tools
Random tools I've written to make life easier using AWS, namely aws-choose-profile and aws-mfa-login
Stars: ✭ 46 (+109.09%)
Mutual labels:  aws-iam

iam4kube

iam4kube allows containers running on Kubernetes to transparently use credentials for an IAM role as if the code is being executed on an AWS EC2 instance. This is achieved by emulating a subset of the AWS Metadata API.

4 September 2019: AWS announced availability of support for IAM in Kubernetes clusters. If you are using anything else, you should start thinking about migrating to the official solution as it's better in many ways.

Features / implementation decisions

Core features

  • IAM roles from other AWS accounts are fully supported. Specifying full ARN of the role is always required;
  • IAM role ARN is attached as iam.amazonaws.com/roleArn annotation on ServiceAccount and all Pods that use it share the same credentials;
  • Credentials are eagerly prefetched and refreshed to ensure really fast (<10ms) response times. This ensures AWS SDKs which typically have very aggressive timeouts do not... time out;
  • Prometheus metrics - de-facto standard in Kubernetes ecosystem;
  • Emits Kubernetes events on Pods to surface succeeded and failed credentials requests;
  • Supports metadata endpoint for fetching availability zone / region where container is running;
  • Supports External ID. It can be specified using iam.amazonaws.com/roleExternalId annotation on ServiceAccount.
  • Configurable rate limiting. Defaults to 10 AWS STS requests / second with bursts up to 20 / second;
  • Smart readiness check to avoid empty cache hits. Only reports ready once cache has been fully populated with credentials;
  • STS session name is supported and is set to "namespace@name" of the ServiceAccount for traceability via AWS CloudTrail;
  • Structured JSON logging.

Race-proof implementation

Kubernetes is a distributed system by itself. The following situations are possible:

  1. A container can start and try to fetch credentials before iam4kube (or anything else really) observes that there is such Pod;
  2. Same with ServiceAccount. A Pod that uses it may be created really quickly and in a busy cluster information about the ServiceAccount may not be instantaneously available to iam4kube;
  3. Credentials may not be available yet (still being fetched) when a request for them comes in;
  4. Annotation with IAM role ARN on an existing ServiceAccount may be set, then a Pod that uses it starts up quickly but iam4kube may have not seen the annotation update yet (still has ServiceAccount without the annotation in the cache).

These kinds of situations are handled gracefully by not responding to a request for credentials and waiting for missing pieces of information to become available. Request may either time out (15 seconds currently) or be aborted by the client. The waiting is implemented as efficiently as possible, without any internal (within the program) or external polling to ensure lowest response latency and no overhead.

Security

iam4kube should be run on a set of nodes where no other workloads are scheduled. This set of nodes should have extended IAM permissions to assume various IAM roles to fetch required credentials. All other nodes (worker nodes) that need AWS IAM credentials should not have such permissions so that if container boundaries are breached malicious code does not have access to the powerful IAM permissions.

Because of this design decision it is out of scope of iam4kube to configure ip tables / IPVS to correctly route traffic from worker nodes to it. See ip2service section below.

iam4kube should be deployed using a Deployment behind a Service. This, combined with smart readiness check, allows to easily perform zero downtime upgrades unlike if it is run as a DeamonSet on each node.

Only a subset of metadata api is implemented, no requests are proxied directly to the actual metadata service. This is by design. Consider the issue of the opposite approach: tomorrow AWS might add a new endpoint to the metadata service that exposes some sensitive information - that would create a security hole. So "closed by default" is the right approach here. Also there is plenty of information that would most likely be incorrect for the container because it might be running on a different host.

Comparison with other implementations

See this comparison table to learn more about iam4kube and other implementations for IAM support in Kubernetes.

ip2service

This utility program does what a Kubernetes service does (routes traffic for a virtual ip to Pods) but for any ip address. This can be used to intercept traffic to AWS metadata service and route it to Pods running iam4kube.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].