Skip to content

Commit 36f68c7

Browse files
kilfoylelucabelluccini
authored andcommitted
Add steps to configure a PGP key for agent upgrade (#984)
* Add steps to configure a PGP key for agent upgrade * Rebuild * Add alternative of using fleet-server endpoint * fixup * Update logic based on Michel's input * Add Luca's suggestions * Update docs/en/ingest-management/fleet/air-gapped.asciidoc Co-authored-by: Luca Belluccini <[email protected]> * Update docs/en/ingest-management/fleet/air-gapped.asciidoc * Update docs/en/ingest-management/fleet/air-gapped.asciidoc * Update docs/en/ingest-management/fleet/air-gapped.asciidoc --------- Co-authored-by: Luca Belluccini <[email protected]> (cherry picked from commit 4429a6e)
1 parent 1cd5adc commit 36f68c7

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docs/en/ingest-management/elastic-agent/upgrade-standalone-elastic-agent.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ As an alterative, you can do one of the following:
3434
* <<fleet-agent-proxy-support,Configure a proxy server>> for standalone {agent} to access the {artifact-registry}.
3535
* <<host-artifact-registry,Host your own artifact registry>> for standalone {agent} to access binary downloads.
3636

37+
As well, starting from version 8.9.0, during the upgrade process {agent} needs to download a PGP/GPG key. Refer to <<air-gapped-pgp-fleet>> for the steps to configure the key download location in an air-gapped environment.
38+
3739
Refer to <<air-gapped,Air-gapped environments>> for more details.
3840

3941
[[upgrade-standalone-verify-package]]

docs/en/ingest-management/fleet/air-gapped.asciidoc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,51 @@ Set the following property in {kib} to enable air-gapped mode in {fleet}. This a
3636
xpack.fleet.isAirGapped: true
3737
----
3838

39+
[discrete]
40+
[[air-gapped-pgp-fleet]]
41+
== Configure {agents} to download a PGP/GPG key from {fleet-server}
42+
43+
Starting from version 8.9.0, when {agent} tries to perform an upgrade, it first verifies the binary signature with the key bundled in the agent. This process has a backup mechanism that will use the key coming from `https://artifacts.elastic.co/GPG-KEY-elastic-agent` instead of the one it already has.
44+
45+
In an air-gapped environment, an {agent} which doesn't have access to a PGP/GPG key from `https://artifacts.elastic.co/GPG-KEY-elastic-agent` would fail to be upgraded.
46+
For versions 8.9.0 to 8.10.3, you can resolve this problem following the steps described in the associated link:https://www.elastic.co/guide/en/fleet/8.9/release-notes-8.9.0.html#known-issues-8.9.0[known issue] documentation.
47+
48+
Starting in version 8.10.4, you can resolve this problem by configuring {agents} to download the PGP/GPG key from {fleet-server}.
49+
50+
Starting in version 8.10.4, {agent} will:
51+
52+
. Verify the binary signature with the key bundled in the agent.
53+
. If the verification doesn't pass, the agent will download the PGP/GPG key from `https://artifacts.elastic.co/GPG-KEY-elastic-agent` and verify it.
54+
. If that verification doesn't pass, the agent will download the PGP/GPG key from {fleet-server} and verify it.
55+
. If that verification doesn't pass, the upgrade is blocked.
56+
57+
By default, {fleet-server} serves {agents} with the key located in `FLEETSERVER_BINARY_DIR/elastic-agent-upgrade-keys/default.pgp`.
58+
The key is served through the {fleet-server} endpoint `GET /api/agents/upgrades/{major}.{minor}.{patch}/pgp-public-key`.
59+
60+
If there isn't a `default.pgp` key in the `FLEETSERVER_BINARY_DIR/elastic-agent-upgrade-keys/default.pgp` directory, {fleet-server} instead will attempt to retrieve a PGP/GPG key from the URL that you can specify with the `server.pgp.upstream_url` setting.
61+
62+
You can prevent {fleet} from downloading the PGP/GPG key from `server.pgp.upstream_url` by manually downloading it from `https://artifacts.elastic.co/GPG-KEY-elastic-agent` and storing it at `FLEETSERVER_BINARY_DIR/elastic-agent-upgrade-keys/default.pgp`.
63+
64+
To set a custom URL for {fleet-server} to access a PGP/GPG key and make it available to {agents}:
65+
66+
. In {kib}, go to *Management > {fleet} > Agent policies*.
67+
. Select a policy for the agents that you want to upgrade.
68+
. On the policy page, in the **Actions** menu for the {fleet-server} integration, select **Edit integration**.
69+
. In the {fleet-server} settings section expand **Change defaults** and **Advanced options**.
70+
. In the **Custom fleet-server configurations** field, add the setting `server.pgp.upstream_url` with the full URL where the PGP/GPG key can be accessed. For example:
71+
72+
[source,yaml]
73+
----
74+
server.pgp.upstream_url: <http://my-web-server:8080/default.pgp>
75+
----
76+
77+
The setting `server.pgp.upstream_url` must point to a web server hosting the PGP/GPG key, which must be reachable by the host where {fleet-server} is installed.
78+
79+
Note that:
80+
81+
* `server.pgp.upstream_url` may be specified as an `http` endpoint (instead of `https`).
82+
* For an `https` endpoint, the CA for {fleet-server} to connect to `server.pgp.upstream_url` must be trusted by {fleet-server} using the `--certificate-authorities` setting that is used globally for {agent}.
83+
3984
[discrete]
4085
[[air-gapped-proxy-server]]
4186
== Use a proxy server to access the {package-registry}

0 commit comments

Comments
 (0)