Code Monkey home page Code Monkey logo

grbac's Introduction

gRBAC - Graph Role-Based Access Control

Go Reference

gRBAC logo

A cloud-native graph implementation of the Role-Based Access Control (RBAC) authorization architecture powered by dgraph.

NOTE: This project is developed and maintained by Animeshon where it is running in production.

Build with Golang

go build -o bin/grbac ./cmd

Build with Docker

docker build -t grbac/grbac:latest .

Run examples (gRPC only)

Run gRPC docker-compose:

docker-compose -f examples/grpc/docker-compose.yaml up

Run integration tests:

export INTEGRATION_TEST_DGRAPH_ENDPOINT=127.0.0.1:9060
go test -tag=integration ./...

Visit https://play.dgraph.io/?latest and connect to the endpoint http://127.0.0.1:8060.

Run the following generic DQL query:

{
  query(func:type(Resource)){
    expand(_all_) {
      expand(_all_) {
        expand(_all_) {
          expand(_all_) {
            expand(_all_) {
              expand(_all_)
            }
          }
        }
      }
    }
  }
}

The following image is an example of the expected output:

gRBAC Example Graph

Play with gRBAC

After succesfully running the gRPC docker-compose as described in the previous paragraph, build gRBAC locally and execute a random CLI command:

go build -o bin/grbac ./cmd
./bin/grbac accesscontrol create-permission \
    --address "127.0.0.1:9070" --insecure \
    --permission.name="permissions/grbac.test.permission"

Keep experimenting with other commands or through a gRPC client!

Resources

Known Issues

  • etags are not implemented
  • atomic group changes (AddGroupMember and RemoveGroupMemeber) are not implemented
  • resource parent transfer (TransferResource) is not implemented
  • limits and quotas are not implemented
  • there is no maximum distance set for shortest queries
  • groups can currently include other groups - this behavior should be discussed
  • partial updates will return partial resources - complete resources should be returned instead

Roadmap

  • resolve known issues
  • remove Animeshon internal business logic
  • move protobuf definitions to this organization
  • generate missing grpc clients (e.g. Java, Python, C#, ...)
  • publish docker image to Docker Hub
  • build the project through Bazel instead of the Go toolchain
  • add unit tests on top of integration tests
  • add monitoring and tracing

Off-topic: gRBAC meaning

The name gRBAC comes from g + RBAC where g stands for:

  • graph as it is implemented on top of a graph database and leverages graph's properties
  • gRPC as its implementation is completely gRPC native
  • google as this implementation aims at mirroring the Google Cloud IAM architecture

and RBAC stands for Role-Based Access Control.

grbac's People

Contributors

asuka-langley-soryu avatar christian-roggia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.