Skip to content

Commit 5a8df0d

Browse files
authored
Merge pull request #443 from snyk/feat/proxying
Feat/proxying
2 parents dbc54a3 + 53df443 commit 5a8df0d

21 files changed

+677
-123
lines changed

.circleci/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,28 @@ jobs:
216216
- store_artifacts:
217217
path: /tmp/logs/test/integration/kind-helm
218218

219+
integration_tests_proxy:
220+
<<: *default_machine_config
221+
steps:
222+
- checkout
223+
- setup_node12
224+
- install_python_requests
225+
- run:
226+
name: Create temporary directory for logs
227+
command: mkdir -p /tmp/logs/test/integration/proxy
228+
- run:
229+
name: Integration tests with Helm deployment
230+
command: |
231+
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
232+
npm run test:integration:kind:proxy
233+
- run:
234+
name: Notify Slack on failure
235+
command: |
236+
./scripts/slack/notify_failure_on_branch.py "staging-integration-proxy-tests-${CIRCLE_SHA1}"
237+
when: on_fail
238+
- store_artifacts:
239+
path: /tmp/logs/test/integration/proxy
240+
219241
eks_integration_tests:
220242
<<: *default_machine_config
221243
steps:
@@ -455,6 +477,10 @@ workflows:
455477
requires:
456478
- build_image
457479
<<: *staging_branch_only_filter
480+
- integration_tests_proxy:
481+
requires:
482+
- build_image
483+
<<: *staging_branch_only_filter
458484
- eks_integration_tests:
459485
requires:
460486
- build_image
@@ -477,6 +503,7 @@ workflows:
477503
- system_tests
478504
- integration_tests
479505
- integration_tests_helm
506+
- integration_tests_proxy
480507
<<: *staging_branch_only_filter
481508
- deploy_dev:
482509
requires:

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,37 @@ Finally, to launch the Snyk monitor in your cluster, run the following:
8787
```shell
8888
kubectl apply -f snyk-monitor-deployment.yaml
8989
```
90+
91+
## Setting up proxying ##
92+
93+
Proxying traffic through a forwarding proxy can be achieved by modifying the `snyk-monitor-cluster-permissions.yaml` or `snyk-monitor-namespaced-permissions.yaml` (depending on which one was applied) and setting the following variables in the `ConfigMap`:
94+
95+
* http_proxy
96+
* https_proxy
97+
* no_proxy
98+
99+
For example:
100+
101+
```yaml
102+
apiVersion: v1
103+
kind: ConfigMap
104+
metadata:
105+
...
106+
data:
107+
...
108+
https_proxy: "http://192.168.99.100:8080"
109+
```
110+
111+
The `snyk-monitor` currently works with HTTP proxies only.
112+
113+
Note that `snyk-monitor` does not proxy requests to the Kubernetes API server.
114+
115+
Note that `snyk-monitor` does not support wildcards or CIDR addresses in `no_proxy` -- it will only look for exact matches. For example:
116+
117+
```yaml
118+
# not OK:
119+
no_proxy: *.example.local,*.other.global,192.168.0.0/16
120+
121+
# OK:
122+
no_proxy: long.domain.name.local,example.local
123+
```

0 commit comments

Comments
 (0)