8000 Support for mutual TLS connection between the manager and connectors by revit13 · Pull Request #1587 · fybrik/fybrik · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for mutual TLS connection between the manager and connectors #1587

8000
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

Merged
merged 36 commits into from
Jul 14, 2022

Conversation

revit13
Copy link
Collaborator
@revit13 revit13 commented Jun 30, 2022

Closes #1556

This PR adds support for mutual TLS connection between the manager and connectors.

the certificates are provided in Kubernetes secrets as described in values.yaml.

The PR contains a notebook test for tls connection.

revit13 added 2 commits June 30, 2022 10:23
Signed-off-by: Revital Sur <eres@il.ibm.com>
@revit13 revit13 requested a review from roytman June 30, 2022 11:29
@revit13 revit13 marked this pull request as draft June 30, 2022 11:29
revit13 added 3 commits June 30, 2022 14:33
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
@@ -16,4 +17,10 @@ rules:
- apiGroups: ["katalog.fybrik.io"]
resources: ["assets"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
{{- if .Values.global.tls.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be specific to katalog-connector and not according to the global default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used global settings to simplify configuration. if needed we can change that...

revit13 added 4 commits July 3, 2022 13:11
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
- name: CACERT_SECRET_NAME
value: {{ .Values.manager.tls.certs.cacertSecretName }}
- name: CACERT_SECRET_NAMESPACE
value: {{ .Values.manager.tls.certs.cacertSecretNamespace }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are these env vars used in the manager code?

Copy link
Collaborator Author
@revit13 revit13 Jul 4, 2022

Choose a reason for hiding this comment

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

in the auto-generated code pkg/connectors/datacatalog/openapiclient/client.go and pkg/connectors/policymanager/openapiclient/client.go. The latest version of openapi generator tool supports OpenAPI Spec 3.0 and it does not contain TLS support so I had to insert the tls support in the generated code. (The tls support is introduced in OpenAPI Spec 3.1.x)

revit13 added 7 commits July 4, 2022 11:24
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
@@ -50,6 +50,23 @@ spec:
value: {{ .Values.global.prettyLogging | quote }}
- name: LOGGING_VERBOSITY
value: {{ .Values.global.loggingVerbosity | quote }}
- name: CATALOG_CONNECTOR_USE_TLS
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This value is now deduced from the service port.

revit13 added 3 commits July 9, 2022 23:21
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
@revit13 revit13 force-pushed the tls1 branch 4 times, most recently from cd15ad6 to 9163214 Compare July 12, 2022 06:35
Signed-off-by: Revital Sur <eres@il.ibm.com>
Copy link
Collaborator
@roytman roytman left a comment

Choose a reason for hiding this comment

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

We forgot to configure the OPA server to use TLS.
see https://www.openpolicyagent.org/docs/latest/security/

Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
roytman
roytman previously approved these changes Jul 12, 2022
@revit13 revit13 marked this pull request as draft July 12, 2022 15:57
@revit13 revit13 marked this pull request as ready for review July 12, 2022 15:59
roytman
roytman previously approved these changes Jul 14, 2022
@@ -12,7 +12,83 @@ The `NetworkPolicy` is always created. However, your Kubernetes cluster must hav

## Mutual TLS

If Istio is installed in the cluster then you can use [automatic mutual TLS](https://istio.io/latest/docs/tasks/security/authentication/authn-policy/#auto-mutual-tls) to encrypt the traffic to the connectors.
### Using Fybrik
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe the first paragraph, should be rephrased to something like:

Kubernetes NetworkPolicies TLS/mTLS and optionally Istio can be used to protect components of the control plane. Specifically, traffic to connectors that run as part of the control plane must be secured. Follow this page to enable control plane security.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Line 13 should be # TLS.
Line 15 -> ## Configure Fybrik to use TLS

If Istio is installed in the cluster then you can use [automatic mutual TLS](https://istio.io/latest/docs/tasks/security/authentication/authn-policy/#auto-mutual-tls) to encrypt the traffic to the connectors.
### Using Fybrik

Fybrik can be configured to have the traffic between the manager and the connectors encrypted by using TLS. In addition, mutual TLS authentication is possible too.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fybrik can be configured to protect trafffic between the manager and connectors by using TLS.


Fybrik can be configured to have the traffic between the manager and the connectors encrypted by using TLS. In addition, mutual TLS authentication is possible too.

In the TLS mode, the connectors (aka the servers) should have their certificates available to provide them to the manager (aka client) in the TLS protocol handshake process. In mutual TLS mode, both the manager and connector should have their certificates available.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Certificate Authorities (CA) credentials should be installed too.

In the TLS mode, the connectors (aka the servers) should have their certificates available to provide them to the manager (aka client) in the TLS protocol handshake process. In mutual TLS mode, both the manager and connector should have their certificates available.


#### Adding TLS Secrets
Copy link
Collaborator

Choose a reason for hiding this comment

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

Additing TLS Certificate as Kubernetes secrets

name: ca-issuer
secretName: tls-manager-certs
```

Copy link
Collaborator

Choose a reason for hiding this comment

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

The advantahe of using certificate manager that it automaticalliy tries to renew certificates.

secretName: tls-manager-certs
```

#### Using a Private CA Signed Certificate
Copy link
Collaborator

Choose a reason for hiding this comment

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

using a Private ...

--from-file=cacerts.pem=./cacerts.pem
```

#### Update Values.yaml file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update ....

cacertSecretNamespace: "fybrik-system"
```

### Using Istio
Copy link
Collaborator

Choose a reason for hiding this comment

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

using Istio

# Name of kubernetes secret namespace that holds the certificate authority (CA)
# certificates which are used by the manager to validate the connection to the connectors.
cacertSecretNamespace: "fybrik-system"
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

FEC5

where is the useTLS and useMTLS flags ?
maybe better to provide a server (one of teh conectors ) as an example

Signed-off-by: Revital Sur <eres@il.ibm.com>
revit13 and others added 4 commits July 14, 2022 14:32
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
@roytman roytman merged commit 089b402 into fybrik:master Jul 14, 2022
@revit13 revit13 deleted the tls1 branch July 14, 2022 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add capabilities to communicate with catalog and policy engine connectors over mutual TLS
3 participants
0