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

Add --tls-certificate-secret-name parameter to server command. Fixes #5582 #9423

Merged

Conversation

chtcvl
Copy link
Contributor

@chtcvl chtcvl commented Aug 24, 2022

Signed-off-by: vladimir ivanov [email protected]

Fixes #5582

Add --tls-certificate-secret-name parameter to server command.
Since server runs on localhost:2746, get an error in the UI "certificate is valid for ... not for localhost". Therefore the merge request set InsecureSkipVerify on TLSconfig for grpc client on the gateway.

Tested to to work with secret provided by cert-manager (added to manifests).

@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch 3 times, most recently from d2e0dd4 to 8bae7c5 Compare August 27, 2022 11:19
Copy link
Contributor

@juliev0 juliev0 left a comment

Choose a reason for hiding this comment

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

Interesting. Thanks for the addition. Just wondering if we should support the case in which somebody doesn't want the InsecureSkipVerify? (Don't want to add more unnecessary work but not sure what others think)

issuerRef:
kind: Issuer
name: argo-workflows-issuer
secretName: argo-server-tls
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intend for this to be deployed as part of installing our manifests? I see manifests/base/argo-server/kustomization.yaml calls out the yaml files in this directory. Should we add it to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, added to manifests/base/argo-server/kustomization.yaml.

Yes, intend to install as part manifests, since certificate from Certificate resource is persistent compared to one argo-server generates itself. This way user will only need to set up trust once.

@chtcvl
Copy link
Contributor Author

chtcvl commented Sep 1, 2022

Interesting. Thanks for the addition. Just wondering if we should support the case in which somebody doesn't want the InsecureSkipVerify? (Don't want to add more unnecessary work but not sure what others think)

This InsecureSkipVerify is for communication within the same instance of argo-server application - between grpc client and server goroutines, so don't expect this requirement.

@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch from 8bae7c5 to dbbc822 Compare September 1, 2022 02:22
@juliev0
Copy link
Contributor

juliev0 commented Sep 1, 2022

Interesting. Thanks for the addition. Just wondering if we should support the case in which somebody doesn't want the InsecureSkipVerify? (Don't want to add more unnecessary work but not sure what others think)

This InsecureSkipVerify is for communication within the same instance of argo-server application - between grpc client and server goroutines, so don't expect this requirement.

Oh, I see…

@juliev0
Copy link
Contributor

juliev0 commented Sep 1, 2022

Details

Great. As far as I can tell, that will propagate into all of the various manifests. You'll need to run "make codegen -B STATIC_FILES=false" and "git diff" and check in whatever changed (which you can see here).

@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch from dbbc822 to 2858919 Compare September 1, 2022 09:11
@chtcvl chtcvl requested a review from juliev0 September 2, 2022 01:06
@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch from fe9c125 to c065a95 Compare September 8, 2022 06:00
@juliev0 juliev0 requested a review from sarabala1979 September 8, 2022 22:47
Copy link
Contributor

@juliev0 juliev0 left a comment

Choose a reason for hiding this comment

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

Thanks for updating the manifests. As far as I can tell, the change looks good to me, but unfortunately I'm not too knowledgeable about this area of the code and hoping someone more knowledgeable can review.

@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch 2 times, most recently from 5132b89 to c5b73e1 Compare September 13, 2022 06:18
@juliev0
Copy link
Contributor

juliev0 commented Sep 13, 2022

@sarabala1979 @terrytangyuan Are either of you able to review and merge this PR?

@terrytangyuan
Copy link
Member

I am not familiar with this. Maybe @alexec @sarabala1979?

@@ -334,7 +334,10 @@ func (as *argoServer) newHTTPServer(ctx context.Context, port int, artifactServe
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxGRPCMessageSize)),
}
if as.tlsConfig != nil {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(as.tlsConfig)))
tlsConfig := as.tlsConfig
tlsConfig.InsecureSkipVerify = true
Copy link
Member

Choose a reason for hiding this comment

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

@chtcvl Do you need to make InsecureSkipVerify=true for all cases? Can you make as command line arg and configure in tsConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now gRPC server explicitly runs on localhost (

url = "https://localhost" + address
) meaning https://localhost. For grpc-gateway to access gRPC server it has some options:
1 . set InsecureSkipVerify=true (not really a concern as this is communication between two goroutines in the same app) - let grpc-gateway trust gRPC server running on localhost.
2. have certificate Subject Alternate Name include localhost - this is not supported by publicly trusted certificates.
3. serve on https://realdomain... for which certificate is issued instead of localhost.

This being said, adding new option for InsecureSkipVerify=false can lead to confusion as option will only be usable in pt.3 which is not supported by current code.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for your response. LGTM @alexec Can you quickly take a look? if I am missing anything.

@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch from c5b73e1 to 69f759c Compare September 14, 2022 10:31
@chtcvl chtcvl force-pushed the add-tls-certificate-secret-name-key branch from 69f759c to c642000 Compare September 21, 2022 08:25
@sarabala1979 sarabala1979 merged commit ff6aab3 into argoproj:master Sep 27, 2022
chenyangxueHDU pushed a commit to chenyangxueHDU/argo that referenced this pull request Sep 29, 2022
…rgoproj#5582 (argoproj#9423)

fix: Add --tls-certificate-secret-name parameter to server command

Signed-off-by: vladimir.ivanov <[email protected]>

Signed-off-by: vladimir.ivanov <[email protected]>
Signed-off-by: yangxue.chen <[email protected]>
@Piroddi
Copy link

Piroddi commented Oct 2, 2022

Hi, This PR enforces users of the manifests to have the cert-manger CRD's installed. Is this the intention?

To use the new manifests (while happy with a self signed cert). Had to add the following to kustomize:

patchesStrategicMerge:
  - |-
    apiVersion: cert-manager.io/v1
    kind: Issuer
    metadata:
      name: argo-workflows-issuer
    $patch: delete
  - |-
    apiVersion: cert-manager.io/v1
    kind: Certificate
    metadata:
      name: argo-server-cert
    $patch: delete

@allemp
Copy link

allemp commented Oct 3, 2022

Hi, This PR enforces users of the manifests to have the cert-manger CRD's installed. Is this the intention?

To use the new manifests (while happy with a self signed cert). Had to add the following to kustomize:

This was a huge issue for me as well.

@allemp allemp mentioned this pull request Oct 3, 2022
3 tasks
terrytangyuan added a commit that referenced this pull request Oct 6, 2022
juchaosong pushed a commit to juchaosong/argo-workflows that referenced this pull request Nov 3, 2022
…rgoproj#5582 (argoproj#9423)

fix: Add --tls-certificate-secret-name parameter to server command

Signed-off-by: vladimir.ivanov <[email protected]>

Signed-off-by: vladimir.ivanov <[email protected]>
Signed-off-by: juchao <[email protected]>
@agilgur5 agilgur5 changed the title Add --tls-certificate-secret-name parameter to server command. Fixes #5582 Add --tls-certificate-secret-name parameter to server command. Fixes #5582 Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TLS configuration and/or docs enhancement
7 participants