Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 45918b4

Browse files
authored
Merge pull request #1736 from 18F/egress-proxy-config
add egress_proxy configuration files
2 parents 66c3465 + 54b61cb commit 45918b4

3 files changed

Lines changed: 36 additions & 33 deletions

File tree

docs/egress.md

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@ As part of Tock's compliance process, egress filtering is set up for cloud.gov d
66

77
> Connect to external networks or systems only through managed interfaces consisting of boundary protection devices arranged in accordance with an organizational security and privacy architecture.
88
9-
Accordingly, we have configured [a Caddy proxy](https://github.com/GSA-TTS/cg-egress-proxy) with the following rules:
10-
11-
```
12-
proxydeny:
13-
proxyallow: |
14-
uaa.fr.cloud.gov
15-
google-analytics.com
16-
```
17-
18-
That is, this proxy rejects all external connections to all sites save for these two exceptions:
9+
Accordingly, we have configured [a Caddy proxy](https://github.com/GSA-TTS/cg-egress-proxy) with an [allow list and deny list](../egress_proxy/tock.vars.yml). This proxy configuration rejects all external connections to all sites save for these exceptions:
1910

2011
- `uaa.fr.cloud.gov`: The [cloud.gov UAA server](https://cloud.gov/docs/management/leveraging-authentication/) which in turn uses GSA SecureAuth for authentication.
2112
- `google-analytics.com`: [DAP](https://digital.gov/guides/dap/), for web app analytics
13+
- `api.newrelic.com`: [New Relic endpoints](https://docs.newrelic.com/docs/apis/rest-api-v2/get-started/introduction-new-relic-rest-api-v2/) which is used for the `newrelic-admin` tool
2214

2315
## A note about cloud.gov egress and spaces
2416

@@ -28,7 +20,7 @@ cloud.gov allows configuration of [egress traffic controls](https://cloud.gov/do
2820

2921
### Create the egress proxy
3022

31-
To create a new proxy, follow the [cf-egress-proxy README](https://github.com/GSA-TTS/cg-egress-proxy).
23+
To create a new proxy, we largely follow the [cf-egress-proxy README](https://github.com/GSA-TTS/cg-egress-proxy).
3224

3325
As an example, to set up egress for Tock staging:
3426

@@ -43,31 +35,11 @@ Clone the egress proxy from [GSA-TTS/cf-egress-proxy](https://github.com/GSA-TTS
4335
git clone [email protected]:GSA-TTS/cg-egress-proxy.git
4436
```
4537

46-
Rename `vars.yml-example` to `vars.tock.yml` and configure it for your application. Use `uuidgen` for the username and password.
47-
48-
```
49-
proxyname: staging-egress
50-
hostname: tock-staging-egress
51-
username: (generated)
52-
password: (generated)
53-
54-
# See [the docs]() for more about what can appear below
55-
proxydeny:
56-
proxyallow: |
57-
uaa.fr.cloud.gov
58-
google-analytics.com
59-
```
60-
61-
Open `manifest.yml` and change the instances to 1:
62-
63-
```bash
64-
instances: 1
65-
```
38+
Copy over [vars.tock.yml](../egress_proxy/tock.vars.yml) and configure it for your application. Use `uuidgen` for the username and password. Also copy over the [manifest.yml](../egress_proxy/manifest.yml). Finally, push the egress application to your space.
6639

67-
Push the egress application to your space
6840
```bash
6941
cf target -s staging-egress
70-
cf push --vars-file vars.tock.yml
42+
cf push --vars-file tock.vars.yml
7143
```
7244

7345
SSH into the proxy to make sure that it is running and restricting URLs as advertised.

egress_proxy/manifest.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
version: 1
3+
applications:
4+
- name: ((proxyname))
5+
path: proxy
6+
stack: cflinuxfs4
7+
buildpacks:
8+
- binary_buildpack
9+
routes:
10+
- route: ((hostname)).apps.internal
11+
health-check-type: process
12+
instances: 1
13+
memory: 64M
14+
command: ./caddy run --config Caddyfile
15+
env:
16+
PROXY_USERNAME: ((username))
17+
PROXY_PASSWORD: ((password))
18+
PROXY_DENY: ((proxydeny))
19+
PROXY_ALLOW: ((proxyallow))
20+
PROXY_PORTS: "443 61443"

egress_proxy/tock.vars.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
proxyname: staging-egress # (or production-egress) The name of the proxy
2+
hostname: tock-staging-egress # (or tock-production-egress) hostname for the internal route
3+
username: (generated) # eg output of uuidgen
4+
password: (generated) # eg output of uuidgen
5+
6+
proxydeny:
7+
proxyallow: |
8+
uaa.fr.cloud.gov
9+
google-analytics.com
10+
api.newrelic.com
11+
*.apps.internal

0 commit comments

Comments
 (0)