You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A reference architecture and **<ins>proof of concept implementation</ins>** of a supply chain security gateway with the goal of enforcing sane security policies to an organization's consumption of 3rd party software (dependencies) in its own products.
Security gateway can be used to establish policy control over consumption of 3rd party software components. [https://safedep.io](https://safedep.io) to get started with usage.
4
+
5
+
> This README is for Gateway developers. Refer to [https://safedep.io](https://safedep.io) for usage instructions for various environments and use-cases.
21
6
22
7
## TL;DR
23
8
@@ -54,7 +39,7 @@ Verify all the services are active
54
39
docker-compose ps
55
40
```
56
41
57
-
Use the gateway using a `demo-client`
42
+
Use the gateway using a [demo-client](https://github.com/safedep/demo-client-java)
58
43
59
44
```bash
60
45
cd demo-clients/java-gradle && ./gradlew assemble --refresh-dependencies
@@ -69,7 +54,7 @@ docker-compose logs pdp
69
54
70
55
The `gradle` build should fail with an error message indicating a dependency was blocked by the gateway.
71
56
72
-
```
57
+
```bash
73
58
> Could not resolve all files for configuration ':app:compileClasspath'.
74
59
> Could not resolve org.apache.logging.log4j:log4j:2.16.0.
75
60
Required by:
@@ -81,7 +66,7 @@ The `gradle` build should fail with an error message indicating a dependency was
81
66
82
67
> Refer to `policies/example.rego` for the policy that blocked this artefact
83
68
84
-
Edit `config/global.yml` and set `pdp.monitor_mode=true` to enable only monitoring and disable policy enforcement. Restart the containers for the changes to take effect.
69
+
Edit `config/gateway.json` and set `pdp.monitor_mode=true` to enable only monitoring and disable policy enforcement. Restart the containers for the changes to take effect.
85
70
86
71
```bash
87
72
docker-compose up --force-recreate --remove-orphans --build -d
@@ -109,114 +94,10 @@ If you are developing on any of the service and want to force re-create the cont
109
94
docker-compose up --force-recreate --remove-orphans --build -d
110
95
```
111
96
112
-
### Configuring Upstream and Routes
113
-
114
-
The configuration plane is currently half baked. It needs a tool and a single source of truth to generate configuration for Envoy and Gateway. For now, look at:
115
-
116
-
1.`config/global.yml`
117
-
2.`config/envoy.yml`
118
-
119
-
> The route definitions in `envoy.yml` must match the path patterns in `global.yml`
120
-
121
-
### Configuring Environments
122
-
123
-
To use the gateway in a CI or developer local environment, package managers need to be configured to use the gateway URL and credentials as repository.
124
-
125
-
[PacMan](pacman/README.md) makes it easy to automatically configure an environment to use the gateway for downloading 3rd party dependencies.
126
-
127
-
### Authentication
128
-
129
-
There are two authentication points:
130
-
131
-
1. Ingress
132
-
2. Egress
133
-
134
-
Ingress authentication is for incoming requests to the gateway and can be used to identify who is accessing the gateway.
135
-
136
-
Egress authentication is for upstream repositories, especially the ones that need authentication e.g. CodeArtifact, JFrog, Nexus etc.
PDP listens on `0.0.0.0:9000`. To use the host instance of PDP, edit `config/envoy.yml` and set the address of the `ExtAuthZ` plugin to your host network address.
164
-
165
-
### Policy Development
166
-
167
-
Policies are written in [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/) and evaluated with [Open Policy Agent](https://www.openpolicyagent.org/docs/latest/integration/#integrating-with-the-go-api)
168
-
169
-
To run policy test cases:
170
-
171
-
```bash
172
-
cd policies && make test
173
-
```
174
-
175
-
* Refer to `policies/example.rego` for policy example
176
-
* Policies are load from `./policies` directory
177
-
178
-
### Tap Development
179
-
180
-
The *Tap Service* is integrated as a Envoy [ExtProc](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_proc_filter) filter. This means, it has greater control over Envoy's request processing life-cycle and can make changes if required.
181
-
182
-
Currently, it is used for publishing events for data collection only but in future may be extended to support other use-cases. Tap service internally implements a handler chain to delegate an Envoy event to its internal handlers. Example:
0 commit comments