All Projects → FairwindsOps → Rbac Manager

FairwindsOps / Rbac Manager

Licence: apache-2.0
A Kubernetes operator that simplifies the management of Role Bindings and Service Accounts.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Rbac Manager

rbac-tool
Rapid7 | insightCloudSec | Kubernetes RBAC Power Toys - Visualize, Analyze, Generate & Query
Stars: ✭ 546 (-25.92%)
Mutual labels:  cluster, authorization, rbac
sequelize-adapter
Sequelize adapter for Casbin
Stars: ✭ 51 (-93.08%)
Mutual labels:  authorization, rbac
Casbin4D
An authorization library that supports access control models like ACL, RBAC, ABAC in Delphi
Stars: ✭ 25 (-96.61%)
Mutual labels:  authorization, rbac
Casbin Rs
An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
Stars: ✭ 375 (-49.12%)
Mutual labels:  authorization, rbac
Audit2rbac
Autogenerate RBAC policies based on Kubernetes audit logs
Stars: ✭ 702 (-4.75%)
Mutual labels:  authorization, rbac
speedle-plus
Speedle+ is an open source project for access management. It is based on Speedle open source project and maintained by previous Speedle maintainers.
Stars: ✭ 45 (-93.89%)
Mutual labels:  authorization, rbac
Gorm Adapter
Gorm adapter for Casbin
Stars: ✭ 373 (-49.39%)
Mutual labels:  authorization, rbac
dart-casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Dart/Flutter
Stars: ✭ 30 (-95.93%)
Mutual labels:  authorization, rbac
Casbin.net
An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
Stars: ✭ 535 (-27.41%)
Mutual labels:  authorization, rbac
Athenz
Open source platform for X.509 certificate based service authentication and fine grained access control in dynamic infrastructures. Athenz supports provisioning and configuration (centralized authorization) use cases as well as serving/runtime (decentralized authorization) use cases.
Stars: ✭ 570 (-22.66%)
Mutual labels:  authorization, rbac
Kubiscan
A tool to scan Kubernetes cluster for risky permissions
Stars: ✭ 659 (-10.58%)
Mutual labels:  authorization, rbac
casbin-ex
An authorization library that supports access control models like ACL, RBAC, ABAC in Elixir
Stars: ✭ 37 (-94.98%)
Mutual labels:  authorization, rbac
react-rbac-ui-manager
react-rbac-ui-manager is a simple RBAC (Role Based Access Control) user interface library based on the material design system using the Material-UI lib.
Stars: ✭ 73 (-90.09%)
Mutual labels:  authorization, rbac
rbac-react-redux-aspnetcore
A starter template for creating JWT token from ASP.NET Core API project and applying that JWT token authentication on React application
Stars: ✭ 54 (-92.67%)
Mutual labels:  authorization, rbac
objection-authorize
isomorphic, "magical" authorization integration with Objection.js 🎉
Stars: ✭ 71 (-90.37%)
Mutual labels:  authorization, rbac
caddy-authorize
Authorization Plugin for Caddy v2 (JWT/PASETO)
Stars: ✭ 235 (-68.11%)
Mutual labels:  authorization, rbac
Yosai
A Security Framework for Python applications featuring Authorization (rbac permissions and roles), Authentication (2fa totp), Session Management and an extensive Audit Trail
Stars: ✭ 582 (-21.03%)
Mutual labels:  authorization, rbac
deflek
index and API RBAC for Elasticsearch and Kibana via reverse proxy. DEPRECATED
Stars: ✭ 13 (-98.24%)
Mutual labels:  authorization, rbac
lua-casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Lua (OpenResty)
Stars: ✭ 43 (-94.17%)
Mutual labels:  authorization, rbac
Rbac Lookup
Easily find roles and cluster roles attached to any user, service account, or group name in your Kubernetes cluster
Stars: ✭ 477 (-35.28%)
Mutual labels:  authorization, rbac
RBAC Manager

Go Report Card CircleCI codecov Fairwinds Insights

RBAC Manager was designed to simplify authorization in Kubernetes. This is an operator that supports declarative configuration for RBAC with new custom resources. Instead of managing role bindings or service accounts directly, you can specify a desired state and RBAC Manager will make the necessary changes to achieve that state.

This project has three main goals:

  1. Provide a declarative approach to RBAC that is more approachable and scalable.
  2. Reduce the amount of configuration required for great auth.
  3. Enable automation of RBAC configuration updates with CI/CD.

Want to learn more? Reach out on the Slack channel (request invite), send an email to [email protected], or join us for office hours on Zoom

An Example

To fully understand how RBAC Manager works, it's helpful to walk through a simple example. In this example we'll have a single user, Joe, that needs edit access to the web namespace and view access to api namespace.

With RBAC, that requires creating 2 role bindings, the first grants edit access to the web namespace.

Take careful note of the use of golang capitalization rather than the Kubernetes naming for roleBinding and clusterRole in some places.

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: joe-web
  namespace: web
subjects:
- kind: User
  name: [email protected]
roleRef:
  kind: ClusterRole
  name: edit
  apiGroup: rbac.authorization.k8s.io

The second grants view access to the api namespace.

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: joe-api
  namespace: api
subjects:
- kind: User
  name: [email protected]
roleRef:
  kind: ClusterRole
  name: view
  apiGroup: rbac.authorization.k8s.io

It's easy to see just how repetitive this becomes. With RBAC Manager, we can use a custom resource to achieve the same result.

apiVersion: rbacmanager.reactiveops.io/v1beta1
kind: RBACDefinition
metadata:
  name: joe-access
rbacBindings:
  - name: joe
    subjects:
      - kind: User
        name: [email protected]
    roleBindings:
      - namespace: api
        clusterRole: view
      - namespace: web
        clusterRole: edit

The Benefits

With an RBAC Definition custom resource, we can cut the amount of configuration in half (or often significantly more). RBAC Manager is deployed as an operator and listens for new and updated RBAC Definitions, making the necessary changes to achieve the desired state.

This approach is incredibly helpful for 2 specific cases:

1. Updating a Role Binding

Unfortunately there's no way to change the role an existing Kubernetes Role Binding refers to. That means that changing a role granted to a user involves deleting and recreating a Kubernetes Role Binding. With RBAC Manager, that process happens automatically when an RBAC Definition is updated.

2. Detecting Role Binding Removal

When it comes to potential CI automation of changes to RBAC configuration, tracking the removal of a role binding can get quite tricky. If you were using a traditional workflow where desired Kubernetes objects are represent in a repo as yaml files, the creates and updates are reasonably straightforward, but revoking access on the basis of a Role Binding being removed is quite tricky.

With RBAC Manager, each RBAC Definition "owns" any resources it creates, and will always compare the desired state in the current RBAC Definition with the list of resources currently owned by it. If a Role Binding is no longer included in a RBAC Definition, RBAC Manager will automatically remove it.

Getting Started

RBAC Manager is simple to install with either the Helm chart or Kubernetes deployment YAML included in this repo:

helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install rbac-manager fairwinds-stable/rbac-manager --namespace rbac-manager --create-namespace

If utilizing the below deploy directory to release or test, be aware that it now requires kubernetes 1.16+ because of apiVersion changes.

kubectl apply -f deploy/

Once RBAC Manager is installed in your cluster, you'll be able to deploy RBAC Definitions to your cluster. There are examples of these custom resources above as well as in the examples directory of this repository.

Dynamic Namespaces and Labels

RBAC Definitions can now include namespaceSelectors in place of namespace attributes when specifying Role Binding configuration. This can be incredibly helpful when working with dynamically provisioned namespaces.

apiVersion: rbacmanager.reactiveops.io/v1beta1
kind: RBACDefinition
metadata:
  name: dev-access
rbacBindings:
  - name: dev-team
    subjects:
      - kind: Group
        name: dev-team
    roleBindings:
      - clusterRole: edit
        namespaceSelector:
          matchLabels:
            team: dev

In the example above, Role Bindings would automatically get created for each Namespace with a team=dev label. This supports the same functionality as other Kubernetes label selectors, read the official docs for more information.

ServiceAccounts

If an RBACDefinition defines a ServiceAccount as a subject, rbac-manager will attempt to create the ServiceAccount for you. WARNING: When an RBACDefinition owns a ServiceAccount in this fashion, it will be deleted when the RBACDefinition is deleted. If the ServiceAccount already exists, rbac-manager will log an error when it attempts to create it but that ServiceAccount will still be granted the access described in your RBACDefinition. In this case, the ServiceAccount will not be deleted when the RBACDefinition is deleted.

ImagePullSecrets and ServiceAccounts

Service accounts support adding ImagePullSecrets to their definition. What happens is that when a Pod (via Deployment or otherwise) is launched specifying a ServiceAccount that includes ImagePullSecrets, the pull secrets will be injected into the Pod spec automatically. An example of this using rbac-manager can be found in the examples directory.

Please note: rbac-manager will not manage secrets, and assumes they are already present in the same namespace that the ServiceAccount is in. Also, ImagePullSecrets only apply when the Subject is a ServiceAccount.

Contributing

Further Reading

RBAC Definitions

RBAC Definitions can manage Cluster Role Bindings, Role Bindings, and Service Accounts. To better understand how these work, read our RBAC Definition documentation.

Cloud Specific Authentication Tips

To properly configure authorization with RBAC in Kubernetes, you first need to have good authentication. We've provided some helpful documentation for working with authentication on AWS, Google Cloud, and Azure.

Better Visibility With RBAC Lookup

We have a related open source tool that allows you to easily find roles and cluster roles attached to any user, service account, or group name in your Kubernetes cluster. If that sounds interesting, take a look at rbac-lookup on GitHub.

License

Apache License 2.0

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].