You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/openfaas-pro/iam/overview.md
+62-4Lines changed: 62 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,8 +109,8 @@ There must be at least one registered OIDC provider for human users to authentic
109
109
110
110
Wildcards can be used to get multiple actions:
111
111
112
-
* `Function:*` - gives all function permission
113
-
* `*` - gives all permissions for namespaces, functions, secrets etc
112
+
* `Function:*` - gives all available function permissions including `Function:Invoke`
113
+
* `*` - gives all permissions for namespaces, functions, function invocations, secrets etc
114
114
115
115
Resource scope:
116
116
@@ -122,12 +122,70 @@ Actions can be scoped cluster wide, or to a specific namespace or function. The
122
122
123
123
## OpenFaaS IAM language
124
124
125
-
The OpenFaaS IAM language is inspired by AWS IAM, however only a subset of the language is implemented at present:
125
+
The OpenFaaS IAM language is inspired by [AWS IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html), however *only a subset* of the language is implemented at present.
126
126
127
-
* `StringEquals` - match a string exactly this would be used to match an exact email address or issuer
127
+
> Note: you can use `faas-cli pro auth --pretty --print --no-exchange` to print out the JWT token obtained from your IdP in order to design your policies.
128
+
129
+
* `Principal` - this field is optional and can only be used to match the subject of the JWT token i.e. `jwt:sub` exactly. An array can be passed with multiple subjects.
130
+
131
+
Conditions:
132
+
133
+
* `StringEquals` - match a string exactly this can be used to match an exact email address of a user or an issuer
128
134
* `StringLike` - match a string with a wildcard - this could be used to match an email domain for instance
129
135
* `ForAnyValue:StringEqual` - match a value within an array, this can be used to check group membership
130
136
137
+
**Example principal combined with a condition**
138
+
139
+
The principal is used to match the identifier of the user - which could be anything from a string to a number to a UUID, to an email address.
140
+
141
+
```yaml
142
+
spec:
143
+
policy:
144
+
- policy1
145
+
principal:
146
+
jwt:sub:
147
+
- 1234567
148
+
- 7654321
149
+
condition:
150
+
StringEqual:
151
+
jwt:iss: ["https://keycloak.example.com/"]
152
+
```
153
+
154
+
**Multiple conditions**
155
+
156
+
When multiple conditions are given they are combined with a logical AND operation.
157
+
158
+
For example, if you want to match a specific user and anyone with a company email address, you can use:
When multiple context keys are given, they are combined with a logical AND operation. For reference, see the [AWS documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-logic-multiple-context-keys-or-values.html).
174
+
175
+
For example, if you want to match a specific user and a specific group, you can use:
0 commit comments