File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,18 @@ We can run OPA as a server using Docker:
41
41
42
42
``` bash
43
43
docker run -p 8181:8181 openpolicyagent/opa \
44
- run --server --log-level debug
44
+ run --server --log-level debug --addr=0.0.0.0:8181
45
45
```
46
46
47
+ {{< info >}}
48
+ We have to use ` --addr ` here to bind to all interfaces to ensure OPA is
49
+ accessible from outside the container. This is not necessary when running OPA
50
+ in other environments.
51
+
52
+ More information can be found in the
53
+ [ security documentation] ( ../security/#interface-binding ) .
54
+ {{< /info >}}
55
+
47
56
Test that OPA is available:
48
57
49
58
```
Original file line number Diff line number Diff line change @@ -470,6 +470,30 @@ OPA binary of version 1.0 or later.
470
470
If you run into any issues while upgrading a Rego project, please drop a message
471
471
in the #help channel on the [ OPA Slack] ( https://slack.openpolicyagent.org/ ) .
472
472
473
+ ## Upgrading OPA Instances
474
+
475
+ Prior to OPA 1.0, when running in server mode (` opa run --server/-s ` ), OPA would
476
+ bind to all interfaces by default. In OPA 1.0,
477
+ [ OPA will bind to ` localhost ` ] ( https://github.com/open-policy-agent/opa/issues/6286 )
478
+ by default instead. Though not inherently insecure in a trusted environment,
479
+ it's good practice to bind OPA to localhost by default if OPA is not intended to
480
+ be exposed to remote services.
481
+
482
+ If you need to replicate the v0.x behaviour, you can use the ` --addr ` flag to
483
+ bind to all interfaces. For example:
484
+
485
+ ``` sh
486
+ opa run --server --addr 0.0.0.0:8181
487
+ ```
488
+
489
+ {{< info >}}
490
+ When running OPA in a container, binding to all interfaces is required
491
+ when the instance needs to be accessed by the host or another container.
492
+ {{< /info >}}
493
+
494
+ More information can be found in the
495
+ [ security documentation] ( ../security/#interface-binding ) .
496
+
473
497
## Upgrading for Go Integrations
474
498
475
499
Both users of the
You can’t perform that action at this time.
0 commit comments