Skip to content

Commit

Permalink
Certificates entity page (#182)
Browse files Browse the repository at this point in the history
* First draft of Certificates entity page

Signed-off-by: Diana <[email protected]>

* Add better key and cert examples, add missing cert UI instructions

Signed-off-by: Diana <[email protected]>

* Fix example cert and key formatting

Signed-off-by: Diana <[email protected]>

* Remove related resources and fix entity type

* Rename certificate entity file and card

Signed-off-by: Diana <[email protected]>

* Add schema to frontmatter

Signed-off-by: Diana <[email protected]>

* Add missing id to examples

Signed-off-by: Diana <[email protected]>

* Add placeholder SSL certificate how to

Signed-off-by: Diana <[email protected]>

* Add how to answer for tldr

* Add stub pages for CA certs entity and TLS passthrough

Signed-off-by: Diana <[email protected]>

* add config

* remove sources.yml

---------

Signed-off-by: Diana <[email protected]>
Co-authored-by: Angel <[email protected]>
  • Loading branch information
cloudjumpercat and Guaris authored Jan 10, 2025
1 parent 1e4dc0c commit 727d2fa
Show file tree
Hide file tree
Showing 8 changed files with 278 additions and 0 deletions.
53 changes: 53 additions & 0 deletions app/_data/entity_examples/certificates/example-certificate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
cert: |
-----BEGIN CERTIFICATE-----
MIID0DCCArigAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJGUjET
MBEGA1UECAwKU29tZS1TdGF0ZTEOMAwGA1UEBwwFUGFyaXMxDTALBgNVBAoMBERp
bWkxDTALBgNVBAsMBE5TQlUxEDAOBgNVBAMMB0RpbWkgQ0ExGzAZBgkqhkiG9w0B
CQEWDGRpbWlAZGltaS5mcjAeFw0xNDAxMjgyMDM2NTVaFw0yNDAxMjYyMDM2NTVa
MFsxCzAJBgNVBAYTAkZSMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJ
bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFDASBgNVBAMMC3d3dy5kaW1pLmZyMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvpnaPKLIKdvx98KW68lz8pGa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SLQDRA7CJQ+Jn3Nb50qg6hFnFPafN+J7
7juWln08wFYV4Atpdd+9XQECgYBxizkZFL+9IqkfOcONvWAzGo+Dq1N0L3J4iTIk
w56CKWXyj88d4qB4eUU3yJ4uB4S9miaW/eLEwKZIbWpUPFAn0db7i6h3ZmP5ZL8Q
qS3nQCb9DULmU2/tU641eRUKAmIoka1g9sndKAZuWo+o6fdkIb1RgObk9XNn8R4r
psv+aQKBgB+CIcExR30vycv5bnZN9EFlIXNKaeMJUrYCXcRQNvrnUIUBvAO8+jAe
CdLygS5RtgOLZib0IVErqWsP3EI1ACGuLts0vQ9GFLQGaN1SaMS40C9kvns1mlDu
LhIhYpJ8UsCVt5snWo2N+M+6ANh5tpWdQnEK6zILh4tRbuzaiHgb
-----END RSA PRIVATE KEY-----
1 change: 1 addition & 0 deletions app/_data/entity_examples/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ formats:
target: '/upstreams/{upstream}/targets/'
upstream: '/upstreams/'
workspace: '/workspaces/'
certificate: '/certificates/'
plugin_endpoints:
consumer: '/consumers/{consumer}/plugins/'
consumer_group: '/consumer_groups/{consumer_group}/plugins/'
Expand Down
34 changes: 34 additions & 0 deletions app/_gateway_entities/ca-certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: CA Certificates
content_type: reference
entities:
- ca-certificate

description: A CA certificate object represents a trusted certificate authority. These objects are used by {{site.base_gateway}} to verify the validity of a client or server certificate.

related_resources:
- text: Certificate entity
url: /gateway/entities/certificate
- text: Mutual TLS Authentication plugin
url: /plugins/mtls-auth

tools:
- admin-api
- konnect-api
- kic
- deck
- terraform


api_specs:
- gateway/admin-oss
- gateway/admin-ee
- konnect/control-planes-config

schema:
api: gateway/admin-ee
path: /schemas/CA-Certificate

---

<!--This is being worked on in https://github.com/Kong/developer.konghq.com/pull/220-->
109 changes: 109 additions & 0 deletions app/_gateway_entities/certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Certificates
content_type: reference
entities:
- certificate

description: A certificate object represents a public certificate, and can be optionally paired with the corresponding private key.

related_resources:
- text: Set up {{site.base_gateway}} to serve an SSL certificate for API requests
url: /how-to/setup-gateway-to-serve-SSL-certificates
- text: CA Certificate entity
url: /gateway/entities/ca-certificate/

tools:
- admin-api
- konnect-api
- kic
- deck
- terraform

api_specs:
- gateway/admin-ee
- konnect/control-planes-config
- gateway/admin-oss

schema:
api: gateway/admin-ee
path: /schemas/Certificate

faqs:
- q: What's the difference between the Certificate entity and the CA Certificate entity?
a: Certificates handle [SSL/TLS termination](/kic/tls-termination-passthrough) for encrypted requests and [CA Certificates](/gateway/entities/ca-certificate/) validate client or server certificates.
- q: Is the Certificate entity used in {{site.konnect_short_name}} for data plane nodes as well?
a: No, the data plane nodes use a [different certificate](/api/konnect/control-planes-config/).
---

## What is a Certificate?

A Certificate object represents a public certificate, which is used to validate the sender's authorization and name. It can optionally be paired with the corresponding private key to initiate secure connections and encrypt sensitive data.

{{site.base_gateway}} can use Certificates in the following ways:
* Handle [SSL/TLS termination](/kic/tls-termination-passthrough) for encrypted requests
* Use as a trusted CA store when validating peer certificate of client or Service
* Tie a certificate and key pair to one or more hostnames using the associated SNI object

## Schema

{% entity_schema %}

## Set up a Certificate

{% entity_example %}
type: certificate
data:
cert: |
-----BEGIN CERTIFICATE-----
MIID0DCCArigAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJGUjET
MBEGA1UECAwKU29tZS1TdGF0ZTEOMAwGA1UEBwwFUGFyaXMxDTALBgNVBAoMBERp
bWkxDTALBgNVBAsMBE5TQlUxEDAOBgNVBAMMB0RpbWkgQ0ExGzAZBgkqhkiG9w0B
CQEWDGRpbWlAZGltaS5mcjAeFw0xNDAxMjgyMDM2NTVaFw0yNDAxMjYyMDM2NTVa
MFsxCzAJBgNVBAYTAkZSMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJ
bnRlcm5ldCBXaWRnaX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RN4PXDpHvK9I
pA1jXAJHEifeHnaW1d3vWkbSkvJmgVf+9U5VeV+OwRHN1qzPZV4suRI6M/8lK8rA
Gr4UnM4aqK4K/qkY4G05LKrik9Ev2CgqSLQDRA7CJQ+Jn3Nb50qg6hFnFPafN+J7
7juWln08wFYV4Atpdd+9XQECgYBxizkZFL+9IqkfOcONvWAzGo+Dq1N0L3J4iTIk
w56CKWXyj88d4qB4eUU3yJ4uB4S9miaW/eLEwKZIbWpUPFAn0db7i6h3ZmP5ZL8Q
qS3nQCb9DULmU2/tU641eRUKAmIoka1g9sndKAZuWo+o6fdkIb1RgObk9XNn8R4r
psv+aQKBgB+CIcExR30vycv5bnZN9EFlIXNKaeMJUrYCXcRQNvrnUIUBvAO8+jAe
CdLygS5RtgOLZib0IVErqWsP3EI1ACGuLts0vQ9GFLQGaN1SaMS40C9kvns1mlDu
LhIhYpJ8UsCVt5snWo2N+M+6ANh5tpWdQnEK6zILh4tRbuzaiHgb
-----END RSA PRIVATE KEY-----
{% endentity_example %}
43 changes: 43 additions & 0 deletions app/_how-tos/setup-gateway-to-serve-SSL-certificates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Set up {{site.base_gateway}} to serve an SSL certificate for API requests
content_type: how_to
related_resources:
- text: Certificate entity
url: /gateway/entities/certificate

products:
- gateway

works_on:
- on-prem
- konnect

entities:
- certificate
- sni

tags:
- networking

tldr:
q: How do I set up {{site.base_gateway}} to serve an SSL certificate for API requests?
a: Generate a custom certificate/key pair using a Certificate Authority (CA) you create. Create a key for your desired host (`kong.lan`) and a CSR, setting the common name to match the hostname. Create a `kong.lan.ext` file and use the file to create a certificate signed with our CA. Then, upload the certificate and key to {{site.base_gateway}} and create an `kong.lan` SNI entity.

tools:
- deck

cleanup:
inline:
- title: Clean up Konnect environment
include_content: cleanup/platform/konnect
icon_url: /assets/icons/gateway.svg
- title: Destroy the {{site.base_gateway}} container
include_content: cleanup/products/gateway
icon_url: /assets/icons/gateway.svg
---

@todo

<!--content notes:
- Use content from this KB: https://support.konghq.com/support/s/article/How-to-setup-Kong-to-serve-an-SSL-certificate-for-API-requests
-->
14 changes: 14 additions & 0 deletions app/_includes/components/entity_example/format/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ The following creates a new Upstream with basic configuration:
3. Enter a unique name for the Upstream. For example: `{{ include.presenter.data['name'] }}`.
4. Click **Save**.
{% when workspace %}
{% when 'certificate' %}
The following creates a new Certificate with basic configuration:

1. In Kong Manager or Gateway Manager, go to **Certificates**.
2. On the Certificates tab, click **New Certificate**.
3. In the **Cert** field, enter the PEM-encoded public certificate:
```
{{ include.presenter.data['cert'] }}
```
4. In the **Key** field, enter the PEM-encoded private key:
```
{{ include.presenter.data['key'] }}
```
5. Click **Save**.
{% else %}
{% endcase %}
{% endif %}
5 changes: 5 additions & 0 deletions app/_landing_pages/gateway/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ rows:
- type: entity_card
config:
entity: workspace
- columns:
- blocks:
- type: entity_card
config:
entity: event-hook
- blocks:
- type: entity_card
config:
entity: certificate
19 changes: 19 additions & 0 deletions app/kic/tls-termination-passthrough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: TLS Termination / Passthrough

description: "The Gateway API supports both TLS termination and TLS passthrough."

content_type: reference
layout: reference

products:
- gateway

related_resources:
- text: Certificate entity
url: /gateway/entities/certificate/
---

@TODO

Contains content from https://docs.konghq.com/kubernetes-ingress-controller/latest/guides/services/tls/

0 comments on commit 727d2fa

Please sign in to comment.