Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Support custom public certificates #824

Merged
merged 1 commit into from
Sep 1, 2020
Merged

Support custom public certificates #824

merged 1 commit into from
Sep 1, 2020

Conversation

vzhukovs
Copy link
Contributor

@vzhukovs vzhukovs commented Aug 4, 2020

What does this PR do?

This changes proposal adds an ability to provide custom certificates.
Custom certificates should be located in /public-certs/*.crt

Signed-off-by: Vladyslav Zhukovskyi vzhukovs@redhat.com

What issues does this PR fix or reference?

eclipse-che/che#17440

Hapy Path Channel

HAPPY_PATH_CHANNEL=stable

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 4, 2020

PR's build can be failed due to separate PR in workspace client library: eclipse-che/che-workspace-client#34

I'll fork workspace-client library with changes and provide custom image for che-theia with changes from current PR and PR from workspace-client repository.

@tolusha
Copy link
Contributor

tolusha commented Aug 4, 2020

If I understand correctly theia will use '/tmp/che/secret/ca.crt' plus certificates located in /public-certs folder.
It is ok for me.

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 4, 2020

If I understand correctly theia will use '/tmp/che/secret/ca.crt' plus certificates located in /public-certs folder.

That's correct, /tmp/che/secret/ca.crt is using in conjunction with public certificates.

@eclipse-che eclipse-che deleted a comment from che-bot Aug 4, 2020
Copy link
Member

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

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

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 4, 2020

I see that /tmp/che/secret/ca.crt is used here

https://github.com/eclipse/che-theia/blob/5155d757a7228f55975f53609d8b8a43668787f0/plugins/workspace-plugin/src/theia-commands.ts#L21

Should we have some changes here?

Nice catch! I'll add parameters to the curl call. Thanks!

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 5, 2020

I see that /tmp/che/secret/ca.crt is used here

https://github.com/eclipse/che-theia/blob/5155d757a7228f55975f53609d8b8a43668787f0/plugins/workspace-plugin/src/theia-commands.ts#L21

Should we have some changes here?

According to curl documentation it is enough to pass only parameter -k if any certificate is found:

-k, --insecure

(TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure.

The server connection is verified by making sure the server's certificate contains the right name and verifies successfully using the cert store.

See this online resource for further details:  https://curl.haxx.se/docs/sslcerts.html

See also --proxy-insecure and --cacert.

not sure we should pass every certificate as parameters in this case, so, leave this code as is.

@RomanNikitenko
Copy link
Member

According to curl documentation it is enough to pass only parameter -k if any certificate is found
not sure we should pass every certificate as parameters in this case, so, leave this code as is.

is it possible that /tmp/che/secret/ca.crt is NOT found,
but
/public-certs is found?

If it's possible, should we pass parameter -k for such case?
https://github.com/eclipse/che-theia/blob/5155d757a7228f55975f53609d8b8a43668787f0/plugins/workspace-plugin/src/theia-commands.ts#L209

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 5, 2020

is it possible that /tmp/che/secret/ca.crt is NOT found

I suppose no, it's impossible. @tolusha is it possible to run che on http environment?

@RomanNikitenko RomanNikitenko self-requested a review August 5, 2020 09:06
Copy link
Member

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

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

I suppose no, it's impossible.

OK

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 5, 2020

Here is an image for testing purposes: vzhukovs/che-theia:17440. It was built based on eclipse-che/che-workspace-client#34 and #824 changes.

@azatsarynnyy
Copy link
Member

I believe we can merge this part and the whole flow will be checked once all the other parts are finished within the downstream issue.
@tolusha WDYT?

@tolusha
Copy link
Contributor

tolusha commented Aug 6, 2020

@azatsarynnyy
Pls merge. If we find any issues we will let you know.

@che-bot
Copy link
Contributor

che-bot commented Aug 6, 2020

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:824
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:824

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 6, 2020

[ci-build]

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Aug 6, 2020

crw-ci-test

@che-bot
Copy link
Contributor

che-bot commented Aug 27, 2020

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:824
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:824

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

Copy link
Contributor

@mmorhun mmorhun left a comment

Choose a reason for hiding this comment

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

I tested this changes on Openshift 4 with institutional (self-signed) certificate and cluster wide proxy which is configured to intercept TLS. Everything works as expected.

@azatsarynnyy
Copy link
Member

Thank you very much @mmorhun for testing it!

@vzhukovskii now we can proceed with getting it merged:

  • get the HappyPath tests passed
  • create a corresponding PR for workspace-client

@azatsarynnyy azatsarynnyy added this to the 7.19 milestone Aug 27, 2020
@tolusha
Copy link
Contributor

tolusha commented Aug 28, 2020

@azatsarynnyy
Could you merge changes in 7.18.x branch as well ?
In this case the fix will be available in CRW 2.4

@azatsarynnyy
Copy link
Member

@azatsarynnyy
Could you merge changes in 7.18.x branch as well ?
In this case the fix will be available in CRW 2.4

Sure. That's the plan.
@tolusha thanks for reminding.

@vzhukovs
Copy link
Contributor Author

crw-ci-test

@che-bot
Copy link
Contributor

che-bot commented Aug 28, 2020

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:824
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:824

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

@davidfestal
Copy link
Contributor

is it possible that /tmp/che/secret/ca.crt is NOT found, but /public-certs is found?

@tolusha According to our today discussion, I would say it is possible, no ?

If the router CA extracted by the Che operator through a dummy route is not seen as self-signed, then the self-signed-certificate secret will not be created, and no /tmp/che/secret/ca.crt will be found, right ?
But I assume this should not prevent an administrator to add custom public certificates to the ca-certs config map and expect to have them propagated up to che-theia, so that the /public-certs would be found ?

@@ -127,11 +128,11 @@ export class ChePluginServiceImpl implements ChePluginService {
const httpOverHttpsAgent = tunnel.httpOverHttps({ proxy: httpsProxyOptions });
Copy link
Contributor

@davidfestal davidfestal Aug 28, 2020

Choose a reason for hiding this comment

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

It seems to me that the httpsProxyOptions might need to have the public-certs as well, since this is the bundle that contains the intercepting proxy CA (coming from the cluster-wide-proxy).

Does it make sense @tolusha ?

The same change would have to be done on the corresponding code in the che-workspace-client library.

@tolusha
Copy link
Contributor

tolusha commented Aug 31, 2020

@davidfestal

is it possible that /tmp/che/secret/ca.crt is NOT found, but /public-certs is found?

Yes, it is possible accordingly to our discussion.

@tolusha
Copy link
Contributor

tolusha commented Aug 31, 2020

@davidfestal

It seems to me that the httpsProxyOptions might need to have the public-certs as well, since this is the bundle that contains the > > intercepting proxy CA (coming from the cluster-wide-proxy).
Does it make sense @tolusha ?

It is hard to answer, I am not familiar with that how it works in theia.

@che-bot
Copy link
Contributor

che-bot commented Sep 1, 2020

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:824
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:824

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
@vzhukovs vzhukovs marked this pull request as ready for review September 1, 2020 09:46
@vzhukovs
Copy link
Contributor Author

vzhukovs commented Sep 1, 2020

@davidfestal

is it possible that /tmp/che/secret/ca.crt is NOT found, but /public-certs is found?

Yes, it is possible accordingly to our discussion.

I suppose, it would be better to implement this in separate issue/pr. This is out of scope of current issue. @davidfestal, @tolusha wdyt?

@azatsarynnyy
Copy link
Member

I suppose, it would be better to implement this in separate issue/pr. This is out of scope of current issue

I'm +1 for making a separate issue for that case.

@che-bot
Copy link
Contributor

che-bot commented Sep 1, 2020

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:824
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:824

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

@tolusha
Copy link
Contributor

tolusha commented Sep 1, 2020

@azatsarynnyy

is it possible that /tmp/che/secret/ca.crt is NOT found, but /public-certs is found?

Accordingly to private getCertificateAuthority(): you already handle the this case. Am I right?

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Sep 1, 2020

@azatsarynnyy

is it possible that /tmp/che/secret/ca.crt is NOT found, but /public-certs is found?

Accordingly to private getCertificateAuthority(): you already handle the this case. Am I right?

You're right. This logic is in master branch now and in current PR.

@vzhukovs
Copy link
Contributor Author

vzhukovs commented Sep 1, 2020

Are there any objections, which prevent merging this PR to master? @tolusha @davidfestal @azatsarynnyy

@tolusha
Copy link
Contributor

tolusha commented Sep 1, 2020

I don't have any.

@azatsarynnyy
Copy link
Member

Are there any objections, which prevent merging this PR to master?

I've already approved it.

@vzhukovs vzhukovs merged commit 11c02f7 into master Sep 1, 2020
@vzhukovs vzhukovs deleted the che#17440 branch September 1, 2020 13:00
vinokurig pushed a commit that referenced this pull request Apr 6, 2021
…issions (#824)

If a sidecar adds any .sh files, check that they are executable to prevent entrypoint errors.

Fixes eclipse-che/che#18737

Signed-off-by: Eric Williams <ericwill@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants