summaryrefslogtreecommitdiffstats
path: root/authz.conf
blob: f9dfba90b14fbc91a29522fcb95bd9c3e5428ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# git-host access policy.
#
# One file, read by the receive hook on every push and by nothing that serves
# reads.  The deployed copy is mounted read-only - a ConfigMap - on purpose: the
# hook must not be able to change who can push, and neither must whatever else
# runs as the git account.  Edit the copy in git and roll the ConfigMap that
# provides it.
#
#   <user> <repo> <write|force|admin> [ <ref pattern> ... ]
#
# Levels stack: admin implies force implies write, and every rule for a user
# counts, so the strongest match wins.  There is no 'deny': access is taken away
# by deleting the rule that gave it, which means the file always says the whole
# of what it grants.
#
# A rule with no ref patterns covers the whole repository, refs included.  With
# patterns, it covers exactly those refs and nothing else - so the answer to
# "who can move main" is the lines that name main, and there is no second list
# somewhere else in the file that can raise the price of a ref behind your back.
#
# A ref pattern is a glob in which '*' crosses '/'.  "main", "heads/main" and
# "refs/heads/main" name the same branch; a bare name is always a branch, so a
# tag has to be written "refs/tags/v1" or "tags/v1".
#
# '@all' means everyone this policy already names somewhere.  It is not a wildcard
# for anonymous users: a name that appears nowhere in the file reaches nothing,
# so adding a rule for a person is the whole of onboarding.
#
# Whatever a rule says about them, refs outside refs/heads and refs/tags need
# admin: refs/notes, refs/merge-requests, whatever a tool invents next are not
# part of the namespace a policy was written with in mind.

# The account for break-glass and for the refs nobody else should touch.
alice * admin

# Default for everyone the policy knows: their own working branches, anywhere.
# Reads are open, so this is only about writing - and it deliberately does not
# reach main, which is named below, person by person.
@all  * write refs/heads/feature/* refs/heads/bugfix/*

# Contributor on team: feature branches only.
bob   team write refs/heads/feature/*

# Senior on team: may rewrite his feature branches and delete them.
carol team force refs/heads/feature/*

# Maintainer of team: everything, including main, tags and deletions.
dave  team admin

# Frank does releases: main and the release tags, and nothing else.
frank team write refs/heads/main refs/tags/release/*

# Team A's repository, with an unrelated ACL.
erin  secrets admin