Skip to content

Commit 689e9b5

Browse files
authored
Merge branch 'keylime:master' into master
2 parents f55e696 + 394bdf0 commit 689e9b5

File tree

1 file changed

+197
-0
lines changed

1 file changed

+197
-0
lines changed

114-agent-multiple-api.md

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# enhancement-114: Add support for multiple API versions to the agent
2+
3+
<!-- toc -->
4+
- [Release Signoff Checklist](#release-signoff-checklist)
5+
- [Summary](#summary)
6+
- [Motivation](#motivation)
7+
- [Goals](#goals)
8+
- [Non-Goals](#non-goals)
9+
- [Proposal](#proposal)
10+
- [User Stories (optional)](#user-stories-optional)
11+
- [Story 1](#story-1)
12+
- [Story 2](#story-2)
13+
- [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional)
14+
- [Risks and Mitigations](#risks-and-mitigations)
15+
- [Design Details](#design-details)
16+
- [Test Plan](#test-plan)
17+
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
18+
- [Drawbacks](#drawbacks)
19+
- [Alternatives](#alternatives)
20+
- [Infrastructure Needed (optional)](#infrastructure-needed-optional)
21+
<!-- /toc -->
22+
23+
## Release Signoff Checklist
24+
25+
- [ ] Enhancement issue in release milestone, which links to pull request in [keylime/enhancements]
26+
- [ ] Core members have approved the issue with the label `implementable`
27+
- [ ] Design details are appropriately documented
28+
- [ ] Test plan is in place
29+
- [ ] User-facing documentation has been created in [keylime/keylime-docs]
30+
31+
## Summary
32+
33+
Add support for multiple API versions in the agent, making it possible for it to
34+
communicate with older versions of the verifier, registrar, and tenant.
35+
36+
## Motivation
37+
38+
Currently, the agent only supports the latest API version, meaning that it will
39+
not accept connections from older versions of the other Keylime components nor
40+
make requests using an older API version to communicate with them.
41+
This means that deployments based on older versions of the Keylime server
42+
components cannot monitor machines running agents that have a newer API version.
43+
44+
Specifically for long-term supported distributions, such as RHEL, the lack of
45+
the ability to monitor systems that have a newer version of the agent with
46+
infrastructure based on older server components means that the agent cannot be
47+
updated without breaking compatibility. This is not acceptable for long-term
48+
supported distributions, resulting in the agent being held in an older version
49+
for a long period to keep compatibility, making maintenance difficult as the
50+
time passes, since the gap between the latest upstream version and the supported
51+
version could grow too big.
52+
53+
The other components already support communicating with older versions of the
54+
agent; adding this support to the agent would make it possible to have
55+
deployments with components on mixed versions.
56+
57+
### Goals
58+
59+
Make the agent backwards compatible, allowing a system running a newer version
60+
of the agent to be monitored by attestation infrastructure based on an older
61+
versions of the server components.
62+
63+
### Non-Goals
64+
65+
Support all existing API versions is a non-goal: only a number of the latest
66+
versions should be supported, given they are compatible.
67+
68+
## Proposal
69+
70+
The proposal is to make the agent capable of communicating with older versions
71+
of the other components. For this, it is required that the agent support
72+
receiving connections using older API versions, as well as making it possible
73+
for the agent to use older API versions when making requests to the other
74+
components.
75+
76+
To make it possible for the agent to receive connections from older versions of
77+
the other components, the agent should provide endpoints under multiple API
78+
versions instead of using only the latest API version.
79+
80+
On the other way around, for the agent to be able to connect to a server that
81+
supports only older versions of the API, the agent should use a compatible API
82+
version when making requests (e.g. when registering itself with the registrar).
83+
84+
To make the agent capable of choosing a compatible API version when making
85+
requests, the other components should implement an endpoint similar to the
86+
`/version` endpoint provided by the agent. This endpoint should provide the
87+
latest supported API version, making it easy for the agent to query for the
88+
supported API version and adjust its requests accordingly.
89+
90+
In the absence of this new endpoint, the agent can try to reach the other
91+
components by trial and error using supported older versions. Although this is
92+
not an efficient method, it is the only way for the agent to communicate with
93+
older versions of the other components without having a way to query the
94+
supported version.
95+
96+
If possible, the user should be able to select a subset of the supported API
97+
versions to enable via configuration options. To keep the current behavior
98+
(only accept the latest API version), the configuration option could support a
99+
special keyword (e.g. "latest") to only support the latest API version.
100+
101+
### User Stories (optional)
102+
103+
#### Story 1
104+
105+
As a system administrator with an existing Keylime deployment in production, I
106+
want to add new machines to be monitored, but using a newer version of the
107+
Keylime agent on those machines. The newer version of the Keylime agent running
108+
on those machines should be able to communicate with my existing deployed
109+
Keylime components (verifier, registrar, and tenant).
110+
111+
#### Story 2
112+
113+
As a system administrator with an existing Keylime deployment in production, I
114+
want to update the version of the Keylime agent used in my monitored machines.
115+
The updated version of the Keylime agent should be able to communicate with my
116+
existing deployed Keylime components (verified, registrar, and tenant).
117+
118+
### Notes/Constraints/Caveats (optional)
119+
120+
No caveats were identified at the moment.
121+
122+
### Risks and Mitigations
123+
124+
No risks were identified at the moment.
125+
126+
## Design Details
127+
128+
The proposed changes to the server components other than the agent are:
129+
- Provide the `/version` endpoint which replies to `GET` requests with the
130+
latest supported API version. The provided endpoint response format should
131+
follow the current response provided by the agent `/version` endpoint:
132+
133+
```json
134+
{
135+
"code": 200,
136+
"status": "Success",
137+
"results": {
138+
"supported_version": "2.0"
139+
}
140+
}
141+
```
142+
143+
The proposed changes to the agent are:
144+
- The agent provides the endpoints to receive connections under multiple API
145+
versions (e.g. `/v2.1/quotes/identity` and `/v2.0/quotes/identity`)
146+
- Ideally the user can configure a subset of the supported API versions to
147+
enable via configuration. The agent should provide the endpoints under the
148+
selected API versions.
149+
- For example: from the set of supported versions `['2.0', '2.1', '2.2]`,
150+
the user could select which versions to enable by setting the
151+
configuration option `api_versions = ['2.1', '2.2']`
152+
- When connecting to a remote server, the agent makes requests using an API
153+
version supported by the remote server it is contacting.
154+
- If the remote server provides the `/version` endpoint, the agent should
155+
first query this endpoint with a `GET` request to obtain the latest
156+
supported version. Then the agent should adjust all the requests it creates
157+
to use the supported version
158+
- In the absence of the `/version` endpoint on the remote server (which will
159+
be the case for the current existing server components), the agent should
160+
try older supported API versions, starting with the newest to contact the
161+
remote server. Once the connection is established, the agent should store
162+
the used API version and reuse in future connections.
163+
164+
### Test Plan
165+
166+
Unit tests should be added to the repository test suite. Functional and
167+
end-to-end tests should be added to the tests repository
168+
(https://github.com/RedHat-SP-Security/keylime-tests) and added to the CI.
169+
170+
The tests should include mixing agents running older API versions with other
171+
components running newer API versions and vice-versa.
172+
173+
### Upgrade / Downgrade Strategy
174+
175+
When upgrading, the agent should be configured with a sane default value. The
176+
suggested is to be configured with all the latest compatible API versions.
177+
178+
### Dependencie requirements
179+
180+
No new dependencies should be required
181+
182+
## Drawbacks
183+
184+
No drawbacks were identified at the moment
185+
186+
## Alternatives
187+
188+
Not implementing this enhancement. In this case, the agent will continue to be
189+
incompatible with components using older API versions.
190+
191+
Users would not be able to monitor agents running with newer API versions with
192+
other components on older API versions. They can still monitor agent running on
193+
older API versions with other components that have a newer API version.
194+
195+
## Infrastructure Needed (optional)
196+
197+
No special infrastructure is needed.

0 commit comments

Comments
 (0)