Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Enhancement request: Support dynamic policy names #51

Closed
sielaq opened this issue Mar 13, 2018 · 1 comment
Closed

Enhancement request: Support dynamic policy names #51

sielaq opened this issue Mar 13, 2018 · 1 comment

Comments

@sielaq
Copy link

sielaq commented Mar 13, 2018

Hi,

First of all, thank you for the project.

Idea is to not to maintain the gatekeeper secret/gatekeeper
whenever new micro-service is being created. And make the defaults like this:

   "*": {
        "multi_fetch": true,
        "num_uses": 0,
        "policies": [
            "{{ name }}",
            "default"
        ],
        "ttl": 3000
    }

So based on above example, the gatekeeper, is going to know that service is allowed to use default policy and {{ name }} policy - which is recognized/translated as real name of the service in the end.

This gonna be a killer feature that makes policy handling much easier and will not require policy reloads.

@nemosupremo
Copy link
Owner

The latest version of Gatekeeper ended up switching to App Roles. The new format of the secret policy is like this:

{
	"mesos:*":{
		"roles":["sample"],
		"num_uses":1
	}
}

Where roles is an AppRole you have defined in vault. Now the {{name}} template does now work, so you could define your policy like this:

{
	"mesos:marathon:*":{
		"roles":["{{name}}"],
		"num_uses":1
	}
}

And Gatekeeper will attempt to use the task name as the role. However, you still need to make sure the role exists in Vault before launching the task. Unlike policies, trying to create a token with an unknown role will result in an error - meaning the operator still has to do some work before a new task is launched.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants