Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial security hardening doc #65

Merged
merged 7 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .custom_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CLI
CN
config
CORS
cors
ale8k marked this conversation as resolved.
Show resolved Hide resolved
CSRF
Diátaxis
DNS
Expand All @@ -31,6 +32,8 @@ HMAC
https
IAM
IdP
integrator
Integrator
ale8k marked this conversation as resolved.
Show resolved Hide resolved
init
installable
JAAS
Expand Down Expand Up @@ -119,4 +122,4 @@ webhook
Websocket
Xbox
XSRF
YAML
YAML
8 changes: 8 additions & 0 deletions how-to/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ Observability
:maxdepth: 1

Integrate with the Canonical Observability Stack <integrate_with_cos>

Security
--------

.. toctree::
:maxdepth: 1

Harden your JIMM deployment <security_hardening>
ale8k marked this conversation as resolved.
Show resolved Hide resolved
68 changes: 68 additions & 0 deletions how-to/security_hardening.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
JAAS: Security Hardening
========================
JIMM, the service at the centre of JAAS can be hardened in a number of ways. This
ale8k marked this conversation as resolved.
Show resolved Hide resolved
document details how you can harden the security of your JAAS deployment.

CORS
----
Cross-Origin Resource Sharing (`CORS <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS>`__)
is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port)
other than its own from which a browser should permit loading resources. CORS also relies on
a mechanism by which browsers make a "preflight" request to the server hosting the cross-origin
resource, in order to check that the server will permit the actual request. In that preflight,
the browser sends headers that indicate the HTTP method and headers that will be used in the
actual request.

To set CORS on JIMM, use the configuration option "cors-allowed-origins".
ale8k marked this conversation as resolved.
Show resolved Hide resolved
ale8k marked this conversation as resolved.
Show resolved Hide resolved

Ingress TLS
-----------
The NGINX Ingress Integrator is a a charm responsible for creating Kubernetes ingress rules,
ale8k marked this conversation as resolved.
Show resolved Hide resolved
these rules can be hardened via TLS and the charm provides a means to do so. See `here <https://charmhub.io/nginx-ingress-integrator>`__.

Our LEGO charms provide certificates for charms from a desired ACME server and can be integrated
with the integrator to enable TLS at the ingress level. See `here <https://charmhub.io/httprequest-lego-k8s>`__.

You will require a domain that your ACME is aware of and an NGINX ingress controller installed
on your Kubernetes cluster.

With JAAS deployed, you can deploy both LEGO and the integrator, and integrate your LEGO charm deployment
to your ingress integrator, and then the ingress integrator to JIMM to enable TLS ingress for
ale8k marked this conversation as resolved.
Show resolved Hide resolved

Identity Provider
-----------------
JAAS uses the Canonical Identity Platform for authentication. The communication between JAAS
and the identity platform can be secured via TLS.

You will require the identity Platform and the self-signed-certificates charm deployed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm ideally they should have proper cert, perhaps using the httprequest-lego-k8s charm.. you may suggest using the self-signed-certificates charm for local deploy, but definitely not for production

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in-cluster tohugh isnt it??

ale8k marked this conversation as resolved.
Show resolved Hide resolved
See `here <https://charmhub.io/topics/canonical-identity-platform/tutorials/e2e-tutorial>`__ for deploying the identity platform.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this guide seems to suggest the self signed certs.. maybe that's enough and we just add the bits that are needed to relate jimm to self-signed-certs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responded on other comment


Your identity platform will require TLS enabled via the `self signed certificates charm <https://charmhub.io/self-signed-certificates>`__.
ale8k marked this conversation as resolved.
Show resolved Hide resolved

Using JIMM's receive-ca-cert integration, you can now relate to the self-signed-certificates charm
ale8k marked this conversation as resolved.
Show resolved Hide resolved
to enabled TLS between the identity platform and JIMM.

OpenFGA
-------
JIMM uses OpenFGA for authorisation and currently, the OpenFGA charm does not support TLS.
ale8k marked this conversation as resolved.
Show resolved Hide resolved

Vault
-----
TLS is enabled by default when communicating with the Vault charm.
ale8k marked this conversation as resolved.
Show resolved Hide resolved
ale8k marked this conversation as resolved.
Show resolved Hide resolved

JIMM uses Vault for storing cloud credentials, JWKS, and other secrets.

Juju Controllers
----------------
TLS is enabled by default when communicating with controllers.

When adding a Juju controller to JIMM, the self signed certificate of the controller is given to
ale8k marked this conversation as resolved.
Show resolved Hide resolved
ale8k marked this conversation as resolved.
Show resolved Hide resolved
JIMM.


PostgreSQL
----------
JIMM uses PostgreSQL as its persistent storage layer. The communication between PostgreSQL can be encrypted
ale8k marked this conversation as resolved.
Show resolved Hide resolved
via TLS. To enable TLS for charmed PostgreSQL you can follow this `guide <https://charmhub.io/postgresql-k8s/docs/t-enable-tls?channel=14/stable>`__.

As of October 2024, you need to manually restart JIMM if you enable TLS on PostgreSQL after having related the JIMM and PostgreSQL charms.
ale8k marked this conversation as resolved.
Show resolved Hide resolved
Loading