|
| 1 | +# Sparky ACL |
| 2 | + |
| 3 | +Sparky ACL - access contorl lists, role based access to Sparky resources |
| 4 | + |
| 5 | +# Creation of ACL |
| 6 | + |
| 7 | +Create list.yml file located at `SPARKY_ROOT/acl/list.yaml` path, for example: |
| 8 | + |
| 9 | +```yaml |
| 10 | +global: |
| 11 | + allow: |
| 12 | + users: |
| 13 | + - alexey.melezhik |
| 14 | + - john.brown |
| 15 | + |
| 16 | +projects: |
| 17 | + hello-world: |
| 18 | + allow: |
| 19 | + users: |
| 20 | + - "*" |
| 21 | + service-logs: |
| 22 | + allow: |
| 23 | + users: |
| 24 | + - "*" |
| 25 | +``` |
| 26 | +
|
| 27 | +In this example we allow users alexey.melezhik and john.brown to run run any jobs, |
| 28 | +and allow _all_ users run jobs hello-world and service-logs. |
| 29 | +
|
| 30 | +# ACL flow |
| 31 | +
|
| 32 | +ACL flow is stict, if an action is not allowed explicitely it's implecettely deined, for example in this case: |
| 33 | +
|
| 34 | +```yaml |
| 35 | +global: |
| 36 | + allow: |
| 37 | + users: |
| 38 | + - alexey.melezhik |
| 39 | + - john.brown |
| 40 | +``` |
| 41 | +
|
| 42 | +All users besides alexey.melezhik and john.brown are denied to run any project |
| 43 | +
|
| 44 | +# User IDs |
| 45 | +
|
| 46 | +User IDs are supplied by oauth provider during authenctiation phase, |
| 47 | +usually those are user accounts in oauth external server. |
| 48 | +
|
| 49 | +For example, in case of GitLab oauth provider user IDs are gitlab accounts |
| 50 | +
|
| 51 | +# Host specific ACLs |
| 52 | +
|
| 53 | +To _override_ default ACL (located at `SPARKY_ROOT/acl/list.yaml`) one has |
| 54 | +to specify list.yaml file located at `SPARKY_ROOT/acl/hosts/$host/list.yaml`, |
| 55 | +where $host is a hostname (output of `hostname` command) of host where Sparky |
| 56 | +runs, this allows to maintain multiple ACL configurations for many Sparky instances: |
| 57 | + |
| 58 | +``` |
| 59 | +acl/hosts/host-foo/list.yaml |
| 60 | +acl/hosts/host-bar/list.yaml |
| 61 | +acl/hosts/host-baz/list.yaml |
| 62 | +``` |
| 63 | + |
| 64 | +Host specfic ACL overrided default ACL and has the same DSL to describe access rules. |
| 65 | + |
| 66 | +# Explicit deny |
| 67 | + |
| 68 | +To explicitely deny a user from a job execution, use deny directive: |
| 69 | + |
| 70 | +``` |
| 71 | +projects: |
| 72 | + hello-world: |
| 73 | + allow: |
| 74 | + users: |
| 75 | + - "*" |
| 76 | + deny: |
| 77 | + users: |
| 78 | + - bad_guy |
| 79 | +``` |
| 80 | + |
| 81 | +This code code allows all users to execute hello-world sparky project, besides a user with login bad_guy |
0 commit comments