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
@@ -14,19 +14,21 @@ The OpenStack Watcher is a WSGI middleware capable of analyzing OpenStack traffi
14
14
15
15
## Principles
16
16
17
-
The watcher distinguishes between `initiator` and `target` of an action.
18
-
`Initiator` describes the resource or the user that starts the request, ` Target` refers to the resource against which the action was performed.
17
+
The watcher middleware classifies OpenStack requests based on the Cloud Auditing Data Federation (CADF) specification.
18
+
It distinguishes between `initiator` and `target` of an action.
19
+
`Initiator` describes the resource or the user who sent the request, `Target` refers to the resource against which the action was performed.
19
20
20
21
### CADF Specification
21
22
22
-
Requests are classified according to the CADF specification.
23
-
A comprehensive list of of OpenStack requests and their CADF representation can be found here: [Cloud Audit Data Federation - OpenStack Profile (CADF-OpenStack)](https://www.dmtf.org/sites/default/files/standards/documents/DSP2038_1.1.0.pdf).
24
-
This middleware follows DMTF specification DSP2038, version 1.1.0 as of 27 April 2015.
23
+
The Cloud Audit Data Federation (CADF) specification defines a model for events within the OpenStack platform.
24
+
This data model is used by the watcher middleware to classify requests.
25
+
More information is provided in the [documentation](./doc/cadf.md).
25
26
26
27
#### Classification
27
28
28
-
The watcher classifies requests and records the following attributes.
29
-
These are emitted as Prometheus metrics and passed in the GCI environment with the `WATCHER` prefix and in capital letters.
29
+
The following attributes are recorded and passed via the WSGI environment through the pipeline.
30
+
Moreover, this meta data is emitted as Prometheus metrics.
31
+
Note: The attributes in the environment are capitalized.
30
32
For example: `WATCHER.ACTION`, `WATCHER.INITIATOR_PROJECT_ID`, `WATCHER.TARGET_PROJECT_ID`, etc. .
31
33
32
34
-`action`: the CADF action
@@ -48,141 +50,15 @@ For example: `WATCHER.ACTION`, `WATCHER.INITIATOR_PROJECT_ID`, `WATCHER.TARGET_P
48
50
49
51
- Swift (object-store):
50
52
-`target.container_id`: the name/id of the swift container. `None` if not relevant. `Unknown` if it could not be determined.
51
-
52
-
53
-
#### Determine target project
54
-
55
-
Determining the target of an operation can be hard. The watcher offers 3 mutually exclusive approaches to that:
56
-
1. Extract target project id from token.
57
-
Assumptions: Initiator is authenticated. Initiator and target are in the same project.
58
-
In which case the initiator.project_id as seen in the keystone token will be equal to the target.project_id.
59
-
While this may be correct in most cases, if the services policy allows cross-project operations, one of the following approaches is suggested.
60
-
61
-
2. Extract target project id from request path.
62
-
Assumptions: Initiator may be anonymous (not authenticated). The request path contains the project id.
63
-
For example swift (object-store) requests might contain the uid of the target project id in the format `../<version>/AUTH_<target_project_id>/..`
64
-
This does not allow conclusions on the initiator, but on the target.
65
-
66
-
3. Extract target project id from service catalog.
67
-
Assumption: Initiator is authenticated. The token is scoped to the target project and its service catalog contains endpoint(s) for the relevant service
68
-
that include the project id in the format `http(s)://<service>:<port>/<version>/<target_project_id>`.
69
-
This requires `include_service_catalog = true` in the keystone.auth_token middleware and does not work when unauthenticated requests are allowed.
70
-
See section [keystone auth_token middleware](#keystone-auth_token-middleware).
71
-
72
-
#### CADF actions
73
-
74
-
Actions characterize the operation performed by the initiator of a request against a target.
75
-
A comprehensive definition of these actions is provided by the CADF specification mentioned above.
76
-
The watcher is capable of classifying request actions based on the HTTP method and path as follows:
The watcher determines the initiator of an action via its keystone token,
217
-
thus the middleware needs to be added *after* the [keystone.auth_token middleware](https://docs.openstack.org/keystone/queens/admin/identity-auth-token-middleware.html).
218
-
Setting `include_service_catalog = true` includes the service catalog on token validation,
219
-
which enables the watcher to determine the target project id for a service based on the endpoint(s) found in this scoped catalog.
220
-
221
-
**Note**:
222
-
Setting`delay_auth_decision = true`, configures the auth_token middleware to delegate the authorization decision to downstream WSGI components.
223
-
This enables unauthenticated requests, hence the initators project, domain and user uid *cannot* be determined via the keystone token and are `Unknown`.
224
-
In which case the initiator can only be characterized by its client address.
225
-
Furthermore, the *target.project_id* cannot be extracted from the token nor the service catalog.
226
-
If the request path does not include the target.project_id, it will be `Unknown`.
227
-
228
91
### Pipeline
229
92
230
-
The watcher should be added after the auth_token middleware.
93
+
The watcher should be added after the keystone auth_token middleware to be able to obtain information on the scope (project/domain) of the action.
231
94
```
232
95
pipeline = .. auth_token watcher ..
233
96
```
234
97
235
-
### Watcher configuration
236
-
and configure by adding the following snippet to the paste.ini:
98
+
### WSGI configuration
99
+
100
+
Configuration options in the paste.ini as shown below
0 commit comments