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

Consul TLS Checks for Diagnose [draft] #11467

Merged
merged 4 commits into from
Apr 28, 2021
Merged

Consul TLS Checks for Diagnose [draft] #11467

merged 4 commits into from
Apr 28, 2021

Conversation

HridoyRoy
Copy link
Contributor

@HridoyRoy HridoyRoy commented Apr 26, 2021

This has TLS checks for Storage, HAStorage, and ServiceRegistration.

The tests just ensure that the correct validation function is called in all scenarios by operator_diagnose.go. Detailed tests around TLS verification are in the diagnose package (previously merged PR).

@vercel vercel bot temporarily deployed to Preview – vault-storybook April 26, 2021 14:05 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 26, 2021 14:05 Inactive
Copy link
Contributor

@sgmiller sgmiller left a comment

Choose a reason for hiding this comment

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

Not much to comment on here, this all makes sense barring the recording structure we decide on.


}

// Initialize the Service Discovery, if there is one
Copy link
Contributor

Choose a reason for hiding this comment

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

If storage setup above fails with an error, does it make sense proceed to the tls portion?

Copy link
Contributor Author

@HridoyRoy HridoyRoy Apr 27, 2021

Choose a reason for hiding this comment

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

I guess what we can do is, we can return individual fail errors, so essentially the operator can run diagnose, get a tree of errors, fix those issues, and then run diagnose again to get potentially different errors, as opposed to running diagnose once and getting a whole slew of errors.

@@ -1154,7 +1154,7 @@ func (c *ServerCommand) Run(args []string) int {
}

// Prevent server startup if migration is active
// TODO: how to incorporate this check into Diagnose?
// TODO: Use logs with OpenTelemetry to Integrate this into Diagnose
Copy link
Contributor

Choose a reason for hiding this comment

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

Hopefully logs aren't needed, but just general otel instrumentation

@@ -178,47 +213,33 @@ func NewServiceRegistration(conf map[string]string, logger log.Logger, state sr.
}

if consulConf.Scheme == "https" {

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this operation is quick enough to do no matter what. Then if we like the otel approach you just call diagnose.Error if it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's definitely quick enough, but if the user doesn't specify tls wouldn't they be surprised by the diagnose TLS error?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point, it should definitely be conditional on having a tls setup in the first place.

@vercel vercel bot temporarily deployed to Preview – vault-storybook April 27, 2021 16:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 27, 2021 16:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 27, 2021 18:42 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 27, 2021 18:42 Inactive
@HridoyRoy HridoyRoy marked this pull request as ready for review April 27, 2021 18:43
@HridoyRoy HridoyRoy requested a review from sgmiller April 27, 2021 18:43
@@ -178,47 +213,33 @@ func NewServiceRegistration(conf map[string]string, logger log.Logger, state sr.
}

if consulConf.Scheme == "https" {

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point, it should definitely be conditional on having a tls setup in the first place.

// TODO: Run Diagnose checks on the actual net.Listeners

var warnings []string
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the things that'll be nice with the otel version is you can just emit warnings in real time rather than having to build up a list of them, but I'm reviewing this one independently of that.

@HridoyRoy HridoyRoy merged commit a20b005 into master Apr 28, 2021
@HridoyRoy HridoyRoy deleted the diagnose-consul-2 branch April 28, 2021 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants