Commit Graph

23 Commits

Author SHA1 Message Date
Ashutosh Narkar 5c183f5ecb Update OPA images to use non-root uid/gid by default
Currently all OPA image variants except "rootless" use
uid/gid 0 (i.e. root). Per container security best
practices it is better to run as non-root. So now OPA
defaults to non-root uid/gid in images. If root user
if needed, it can be explicitly set.

The "rootless" image variant is no longer needed and
will be not published in future releases.

Also currently the debug variant is published
for `linux/amd64` platform. For `linux/arm64` only static
images are generated. The debug variant can be useful
for debugging purposes and hence this change adds that
to the static image which can then be used on amd64 and arm64 arch.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-03-02 08:46:09 -08:00
Anders Eknert 6200ff3d38 docs: update kube tutorial cert install procedure (#4907)
Two unrelated issues would break the Kubernetes tutorial in
recent kube versions. The first one being the SHA1 hash used
by default in at least older versions of OpenSSL, which is no
longer accepted by Kubernetes. Easy fix.

The next one is definitely a head scratcher - for whatever
reason, the subjectAltName previously provided in the config
didn't seem to be picked up in certificate signing requests.
Older versions of Kubernetes - or Go, really - would accept
the common name (CN), but more recent ones require the use of
subjectAltName, so it's possible this never "worked" as intended
but was ignored as the CN was used instead.

The docs on the topic however all suggest that the previous
config _should_ have worked, and after having spent a long time
trying to figure out why it didn't, I've found nothing to
provide any insights here. Best I have is "works on my
machine", so if anyone else would want to try this out to make
sureit works on theirs too, that'd be great.

* Use explicit hashing algorithm
* Specify -extensions as this does not seem to be picked up when
  provided in config only.

Fixes #4902

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-07-20 01:53:29 +02:00
Sugate 8fe80353d0 docs: remove unused assignement in Kubernetes tutorial example (#4783)
Fixes #4778

Signed-off-by: Sugate <51022808+Joffref@users.noreply.github.com>
2022-06-16 15:03:29 +02:00
Torin Sandall 54827f3ef4 docs/content: Update docs to use := at the file-level
This partially addresses #4599.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2022-04-20 09:27:39 -07:00
Anders Eknert 16919a55b2 Whitelist -> Allowlist
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-12-13 15:45:10 +01:00
Omolola Olamide 109018696d docs/content: Update kubernetes tutorial and envoy tutorials (#3931)
Fixes #3910 and #3911

Signed-off-by: Olamide Omolola <omololaolamidex@gmail.com>
2021-10-26 17:10:21 +02:00
Ashutosh Narkar 1a4cea0b1b docs: Update the Kubernetes tutorial to use mgmt APIs
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2021-09-23 08:42:48 -07:00
Rafael Fernández López 581ba9c456 documentation: fix uid and message returned to the Kubernetes apiserver (#3730)
* documentation: always return the `uid` to the Kubernetes apiserver

The Kubernetes API server will reject the answer from any webhook that
does not contain the `uid` present in the request [1]. Failing to do
so will not only result in a warning, but in the answer from the
webhook being ignored, and the request rejected [2].

[1] https://github.com/kubernetes/apiserver/blob/464eee4062a8f21f785e657b32b83f19d693af8d/pkg/admission/plugin/webhook/request/admissionreview.go#L52-L55
[2] https://github.com/kubernetes/apiserver/blob/464eee4062a8f21f785e657b32b83f19d693af8d/pkg/admission/plugin/webhook/validating/dispatcher.go#L236-L239

* documentation: rename `reason` to `message` on certain objects

When the object refers to an `AdmissionReview` from Kubernetes, what
OPA calls the `reason` is the `message` field.

* documentation: create `opa-server` secret in the `opa` namspace

Signed-off-by: Rafael Fernández López <rfernandezlopez@suse.com>
2021-08-20 09:51:19 +02:00
Stephan Renatus 5991888942 website/content/kubernetes-*.md: link GK to GK website (#3745)
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-08-17 18:38:54 +02:00
James Hewitt f4520bbb80 Update tutorial to work running as non-root (#2967)
By default, in an OpenShift cluster, pods will run as a randomly
generated non-root user. That works fine with opa, but this example
attempts to bind to port 443. Moving to bind at 8443 allows the pod to
run as a non-root user successfully (tested).

By doing this, we can also use the rootless image which is a more secure
deployment method for all Kubernetes clusters.

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
2020-12-08 23:56:50 +01:00
Guang Ya Liu 46b1bc99d0 Added some error info for OPA policy fail
Signed-off-by: Guang Ya Liu <gyliu513@gmail.com>
2020-11-16 11:31:20 -08:00
Nikos Silvestros 2daeeccaaa docs: Update Kubernetes tutorial to create SAN certificate
Create SAN certificate for OPA service because Go 1.15 deprecated CN support.

Signed-off-by: Nikos Silvestros <nsilvestros@gmail.com>
2020-10-19 09:52:13 -07:00
Torin Sandall 6c7376ca3d docs: Update kubernetes tutorial to refer to latest kube-mgmt release
The tutorial had not been updated to refer to the latest version which
has an important fixes to improve performance and consistency.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-07-07 15:19:05 -04:00
Gaga Pan 0825b9a59e docs/content: fix kubernetes admission controller tutorial
fixes: #2467

Signed-off-by: Gaga Pan <gaga5lala1013@gmail.com>
2020-06-26 11:37:32 -07:00
Torin Sandall 6e0fb39177 docs: Update tutorial with note about consistency
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-02-10 16:40:06 -05:00
Patrick East c26db82d33 server: Update health check to use plugin status
The health check now supports a `?plugin` option which will make the
response depend on whether or not all configured plugins are in an OK
state.

The `bundle` parameter will now use the bundle *and* discovery plugin
statuses to determine if the bundles are ready. This corrects an issue
where discovery bundles, and bundles defined by the discovery dynamic
config, were not included with `/health?bundle=true` checks.

The URL parameter parsing has also changed to allow for omitting the
value for the `bundle` option. It will default to `true` so that
`/health?bundle=true` can be shortened to `/health?bundle`.

Fixes: #2010
Fixes: #2015
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-02-07 09:49:41 -05:00
Torin Sandall 05211c414a docs: Fix Deployment manifest in ingress-conflict tutorial
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-01-29 14:51:28 -08:00
Dr Nic Williams ca18a956c5 Filename .rego suffix expected
The *bold* strings are consistently the filename to be created in the tutorial, except for the one fixed in this PR.

Signed-off-by: Dr Nic Williams <drnicwilliams@gmail.com>
2020-01-21 10:14:55 -05:00
Lawrence Gripper 54645811f9 Add note for more recent Kubernetes versions
Signed-off-by: Lawrence Gripper <info@grippers.co.uk>
2020-01-13 11:27:29 -08:00
Tim Hinrichs bf255ccf64 docs: Clarify kube-mgmt/Gatekeeper K8s docs
Previously the docs detailing the OPA-k8s integration only distinguished
between v1 (kube-mgmt) and v3 (gatekeeper) in the introduction page.
The debugging, primer, and tutorial pages did not explicitly state
which version they were detailing.

This change clarifies that those pages refer to the kube-mgmt
version and provide a pointer to the Gatekeeper readme.

Signed-off-by: Tim Hinrichs <tim@styra.com>
2019-10-17 07:46:22 -07:00
Tim Hinrichs 6760303a47 docs: Reorganize the docs navigation
The docs have grown organically and it was time for a reorganization, specifically
helping people understand at a single glance the information
that is available in the docs.

The new docs are organized as follows:
- Core docs (policy and data)
- Use-case specific docs
- Operations
- Support

As part of the reorganization, several files were renamed and/or combined.

Also made an editing pass over what was previously the user-attribute docs
and generalized them to focus on data-replication, an issue that is
now promoted to the core docs.  As part of that, updated the images
and removed the old ones; new image sources are in google slides.

Tweaked the navigation bar to give more space on the left-hand column
so that more of the topics are visible without scrolling.

Signed-off-by: Tim Hinrichs <tim@styra.com>
2019-08-29 09:29:08 -07:00
Torin Sandall 74d67c5de1 docs: Update to use live blocks
These changes update most of the docs to use live blocks. The
following pages have not been touched or updated significantly:

* Get Started - this page is based entirely on the REPL. We should
  revisit the "Get Started" page once these changes have
  landed. The existing page can live on as an introduction to the REPL
  while the Get Started page can be tailored to live blocks.

* Ceph Authorization - this page has not been updated aside from
  making the policy example use the live blocks for syntax
  highlighting. We need to revisit the policy example and refactor the
  tutorial a bit to emphasize the policy as opposed to the manifests
  required to install.

* Terraform - this page has not been touched because @vgramer is
  planning to update for Terraform v0.12. We can update this page once
  those changes are in to avoid conflicts.

These changes also remove the use of non-Markdown code examples. All
the examples are inlined into Markdown now.

A few OPA deployment examples have been updated to enable the console
decision logging. This is better than the request/response debug logs.

Fixes #1650

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-23 16:50:32 -04:00
Torin Sandall 7ef72c191b docs: Refactor admission control content into top-level section
The goal is to have the Kubernetes admission control content organized
into one section. This should make it easier to incorporate Gatekeeper
content in the future.

Since the layouts are not versioned the layout logic had to be
enhanced to filter out sections that have no content for the current
version. Doing a semantic version comparison was considered but it was
unclear how to implement that properly within the Hugo template
system. Since it's unlikely that we will want to ever display empty
sections this approach seems fine.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-14 16:38:09 -04:00