# Configuring Elastic Agent to access artifacts repository via proxy

**URL:** https://discuss.elastic.co/t/configuring-elastic-agent-to-access-artifacts-repository-via-proxy/317415
**Category:** Elastic Agent
**Tags:** fleet
**Created:** [October 25, 2022, 12:58pm UTC](https://discuss.elastic.co/t/configuring-elastic-agent-to-access-artifacts-repository-via-proxy/317415 "2022-10-25T12:58:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![username11](https://avatars.discourse-cdn.com/v4/letter/u/e5b9ba/32.png) [@username11](https://discuss.elastic.co/u/username11)
#### Post date: [October 25, 2022, 12:58pm UTC](https://discuss.elastic.co/t/configuring-elastic-agent-to-access-artifacts-repository-via-proxy/317415/1 "2022-10-25T12:58:14Z")

</div>

Hi there. I am currently working on deploying Elastic Agent in our environment, where Elastic Agent hosts and Elastic Stack servers can be assumed to be directly accessible from each other, but internet access requires a proxy. Therefore, my proxy settings need to be as follows:

- Agent-to-Artifacts repo: Internet gateway proxy
- Agent-to-Elasticsearch: No proxy
- Agent-to-Fleet server: No proxy
- Kibana to Elastic Package Registry: Internet gateway proxy
- Fleet server-to-Elasticsearch: No proxy

I am currently trying to figure out how to configure this setup, if it is at all possible. Simply specifying the xpack.fleet.registryProxyUrl setting does not account for the agents, who still try to download packages directly from the internet.

My current understanding is that [per-policy proxy setting is not yet available](https://github.com/elastic/kibana/issues/140533), and the settings for different proxy types are set up as follows:

- Agent-to-Artifacts repo: Global proxy settings only ([HTTP\_PROXY environment variable or proxy\_url/proxy\_disable in standalone agent policy](https://www.elastic.co/guide/en/fleet/current/fleet-agent-proxy-support.html#host-proxy-env-vars))
- Agent-to-Elasticsearch: [Agent policy](https://www.elastic.co/guide/en/fleet/current/fleet-agent-proxy-support.html#_set_the_proxy_for_communicating_with_elasticsearch) -\> [proxy\_url / proxy\_disable](https://www.elastic.co/guide/en/fleet/current/elasticsearch-output.html#output-elasticsearch-commonly-used-settings)
- Agent-to-Fleet server: [Agent enroll/install options](https://www.elastic.co/guide/en/fleet/current/fleet-agent-proxy-support.html#_set_the_proxy_for_communicating_with_elasticsearch) -\> [--proxy-url / --proxy-disabled](https://www.elastic.co/guide/en/fleet/current/elasticsearch-output.html#output-elasticsearch-commonly-used-settings)
- Kibana to Elastic Package Registry: [kibana.yml -\> xpack.fleet.registryProxyUrl](https://www.elastic.co/guide/en/fleet/current/fleet-agent-proxy-support.html#epr-proxy-setting)
- Fleet server-to-Elasticsearch: presumably same as agent-to-elasticsearch

I am a bit confused about which proxy settings, if any, supersede which. I was thinking that maybe I could set up the proxy for artifacts access in `HTTP_PROXY`, EPR proxy in `xpack.fleet.registryProxyUrl`, and explicitly disable it in all other places, but the wording for `--proxy-disabled` and `proxy_disable` suggests that it disables `HTTP_PROXY` as well - in this case my intended setup does not seem to be possible.

What do you think? Am I perhaps better off [setting up an internal artifacts registry](https://www.elastic.co/guide/en/fleet/master/air-gapped.html#host-artifact-registry)? I would like to avoid that if possible, as that would give us an extra endpoint to manage, compared to using a proxy server that we already have.

---

<div class="post-metadata">

### Author: ![MichelLaterman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michellaterman/32/110221_2.png) [@MichelLaterman](https://discuss.elastic.co/u/MichelLaterman)
#### Post date: [October 31, 2022, 7:15pm UTC](https://discuss.elastic.co/t/configuring-elastic-agent-to-access-artifacts-repository-via-proxy/317415/2 "2022-10-31T19:15:08Z")

</div>

Hi,

It may be easiest to set up an internal artifacts registry.  
We have an open issue in our documentation to clear this up: [[Request] Fix and enhance several issues with the Fleet/Agent proxy doc · Issue #2160 · elastic/observability-docs · GitHub](https://github.com/elastic/observability-docs/issues/2160)

---

<div class="post-metadata">

### Author: ![Nima\_Rezainia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nima_rezainia/32/88626_2.png) [@Nima\_Rezainia](https://discuss.elastic.co/u/Nima_Rezainia)
#### Post date: [November 1, 2022, 4:09am UTC](https://discuss.elastic.co/t/configuring-elastic-agent-to-access-artifacts-repository-via-proxy/317415/3 "2022-11-01T04:09:55Z")

</div>

We are working to develop a way to setup proxies on a per-policy basis. That would give you control over your data plane (agent-\>elasticsearch) & control plane (agent-\>fleet server) traffic to go over a proxy. This however is not what you want.

We recently introduced a way for the user to define an alternate http server to host the artifacts. that is what Michel is referring to. The easiest solution would be to setup a artifacts repo locally. or set the proxy to be a forward proxy and use this facility to point to that proxy. Requests from the agent should then be forwarded to the artifactory via the proxy you configure.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 29, 2022, 4:10am UTC](https://discuss.elastic.co/t/configuring-elastic-agent-to-access-artifacts-repository-via-proxy/317415/4 "2022-11-29T04:10:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
