Skip to content

Is it possible to Cerbos serve for two or more apps? #1689

Answered by bbodensieck
NormandoHall asked this question in Q&A
Discussion options

You must be logged in to vote

You could just create resourcePolicies like this.

For the Photo-app

---
apiVersion: api.cerbos.dev/v1
resourcePolicy:
  version: "default"
  scope: "apps.photo-app"
  resource: "photo:object"

  rules:
    - actions: ['list', 'view']
      effect: EFFECT_ALLOW
      roles:
        - app-user

For the financial-app

---
apiVersion: api.cerbos.dev/v1
resourcePolicy:
  version: "default"
  scope: "apps.financial-app"
  resource: "stock:object"

  rules:
    - actions: ['list', 'view']
      effect: EFFECT_ALLOW
      roles:
        - app-user

You could also reuse DerivedRoles in both whenever it makes sense.

The folder structure could be like this

/policies
/policies/resource-policies
/polic…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@NormandoHall
Comment options

@bbodensieck
Comment options

@charithe
Comment options

@NormandoHall
Comment options

Answer selected by NormandoHall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants