Skip to content

Conversation

@ywkaras
Copy link
Contributor

@ywkaras ywkaras commented Aug 4, 2021

No description provided.

@ywkaras ywkaras requested a review from bryancall as a code owner August 4, 2021 00:44
@ywkaras ywkaras self-assigned this Aug 4, 2021
@ywkaras ywkaras added this to the 10.0.0 milestone Aug 4, 2021
@ywkaras ywkaras linked an issue Aug 4, 2021 that may be closed by this pull request
@ywkaras ywkaras marked this pull request as draft August 4, 2021 01:18
brbzull0
brbzull0 previously approved these changes Aug 4, 2021
@ywkaras ywkaras marked this pull request as ready for review August 4, 2021 15:33
std::stringstream errMsg;
errMsg << zret;
Error("%s failed to load: %s", sni_filename, errMsg.str().c_str());
Emergency("%s failed to load: %s", sni_filename, errMsg.str().c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just the initial load(on startup) of the the sni.yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like reloading the sni.yaml comes here for me...what I'm missing?

SNIConfig::reconfigure()
{
Debug("ssl", "Reload SNI file");
SNIConfigParams *params = new SNIConfigParams;
params->Initialize();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rob05c did you want it to die hard on a reload as well?

Copy link
Member

@rob05c rob05c Aug 6, 2021

Choose a reason for hiding this comment

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

Yeah, I guess I think not crashing on reload is fine. On startup, you're not breaking any running traffic. Reload is a harder decision: do we kill the app and break running traffic in the face of a potential security/access concern?

I guess not breaking running traffic is an acceptable choice here. @alficles ^

I tried to see what other configs like ip_allow.yaml do. It throws an exception and crashes ATS. But I'm not sure if that's intentional or desirable.

I also feel like a running config changing to be malformed is at least a little less likely. It seems highly likely to me that a user might create a file wrong and never notice the log error; it seems slightly less likely that a user would create a correct file, and later malform it.

@ywkaras ywkaras removed the request for review from bryancall August 4, 2021 22:31
@ywkaras ywkaras marked this pull request as draft August 9, 2021 23:10
@ywkaras ywkaras marked this pull request as ready for review August 18, 2021 01:21
Emergency("%s failed to load: %s", sni_filename, errMsg.str().c_str());
} else {
Error("%s failed to load: %s", sni_filename, errMsg.str().c_str());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic may be common enough that we should add a new diag output call, perhaps InitEmergency(), that blocks startup if initializing, but simply logs an error otherwise.

}
return 1;
}
Y_sni = std::move(Y_sni_tmp);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this logic to make sure the static data remained the coherent, old version if an invalid sni.yaml was reloaded.

@bryancall
Copy link
Contributor

[approve ci]

@ywkaras
Copy link
Contributor Author

ywkaras commented Oct 21, 2021

[approve ci]

@ywkaras ywkaras merged commit a0c5ac3 into apache:master Oct 21, 2021
zwoop pushed a commit that referenced this pull request Nov 8, 2021
@zwoop
Copy link
Contributor

zwoop commented Nov 8, 2021

Cherry-picked to v9.2.x

@zwoop zwoop modified the milestones: 10.0.0, 9.2.0 Nov 8, 2021
moonchen pushed a commit to moonchen/trafficserver that referenced this pull request Mar 17, 2022
* asf/9.2.x: (50 commits)
  Updated ChangeLog
  Reject Transfer-Encoding in pre-HTTP/1.1 requests (apache#8451)
  Better TLS Secrets Truncation. (apache#8489)
  ssl_secret debug printing: print only the first 50 bytes (apache#8483)
  Define TS_HTTP_VALUE_BROTLI and TS_HTTP_LEN_BROTLI (apache#8477)
  Fix case of brotli (apache#8476)
  TSSslSecretSet: Update SSL_CTX TLS Secrets (apache#8368)
  Adding doc/README.md (apache#8420)
  Doc: fix typos in Strategy documentation (apache#8408)
  Refactors and promotes the Txn Control mechanism with Get() and Set() (apache#8428)
  tests: Add shbang to python scripts with a main (apache#8430)
  Remove empty tests/unit_tests directoy+makefile (apache#8429)
  Adds new API: TSVConnSslSniGet (apache#8313)
  rate_limit: convert to using TSVConnSslSniGet (apache#8414)
  Update the Multiplexer Docs for Multplexed HTTPS Connections (apache#8440)
  bigobj: use automake to build test utilities (apache#8441)
  Make sni.yaml errors cause an unrecoverable TS crash at startup. (apache#8208)
  Fix timeout checks of NetHandler::manage_active_queue() (apache#8287)
  Fix Multiplexer POST/PUT Body Handling (apache#8439)
  Document proxy.config.memory.max_usage (apache#8450)
  ...
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.

ATS Should Fail to Start if sni.yaml Fails to Load

7 participants