-
Notifications
You must be signed in to change notification settings - Fork 215
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
Permit Trace+Debug logging in all non-SGX builds #5375
Conversation
verbose_runtime_option@72660 aka 20230707.5 vs main ewma over 20 builds from 72383 to 72651 Click to see tablemain
verbose_runtime_option
|
@eddyashton I am worried about bundling this in with items of configuration such as directories, IPs, domain names and ports, which may be node-specific. Even if the security policy correctly captures the configuration (which isn't a given, since existing implementations typically do not allow measuring mounts, except for the empty special case), it will differ by node, and effectively require that each node addition be preceded by governance to add the corresponding measurement. It seems to me that the requirements for this bit of configuration are that:
A generic solution would be to create an attested configuration, which must come from somewhere that's measured (ie. the container right now, I don't believe there are other practical options). That's still relatively easy to get wrong. A less generic, but low impact solution, is to make this a CLI argument (either directly, or add a CLI enclave log-level cap). CLI arguments are well captured by the security policy, it is difficult to get that wrong. |
@achamayou I've updated this PR, and the option is now passed on the CLI rather than in the JSON configuration file. Please re-review. |
We should also take the opportunity to |
@achamayou I've renamed to separate the CMake option and the preprocessor definition. CMake's |
…to verbose_runtime_option
@eddyashton a changelog entry is probably worthwhile for this change. |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
(cherry picked from commit cd33041)
We previously (#2404, and related follow-ups) made it so that logging verbosity was controlled at compile time. This is necessary for SGX, but not for other platforms. This PR loosens that behaviour, restoring a run-time
logging.enclave_level
configuration option that allows the enclave's verbosity to be controlled at launch. We still restrict the options which are available (and which are compiled into the binary), but only on SGX. On other platforms, we think it is safe to have a single build, which contains debug logging, and reliably disable that at launch (in an attested config).This gives a few big wins for Virtual and SNP:
--enclave-log-level
tosandbox.sh
to get verbose enclave logging (previously only available in thesgx_unsafe
artifact).VERBOSE_LOGGING
on these platforms doesn't change the compile definitions, only the args passed to e2e tests. So you can quickly enable verbose logging to get more debug information, without a slow rebuild.To avoid too many annoying changes/duplicated checks, I've retained the original definition names. This means there's potential confusion - there's aVERBOSE_LOGGING
CMake option and aVERBOSE_LOGGING
C++ preprocessor definition, but the latter is always-present unless we're on SGX. It may be worth renaming the latter toUNSAFE_LOGGING
or something to avoid that confusion.VERBOSE_LOGGING
is the CMake option, which also affects the runtime arg used by the e2e tests. If we're building for SGX and don't haveVERBOSE_LOGGING
, we add the compile definitionCCF_DISABLE_VERBOSE_LOGGING
, which is the inverse of the previously preproc defVERBOSE_LOGGING
ETA - This option is now passed as a CLI arg to
cchost
, where it should be covered by attestation, rather than in a potentially-unattested config file