Enable supported release hardening options#7895
Conversation
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/86ec6a3f-e863-4120-80d2-0053630dd7cb Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/86ec6a3f-e863-4120-80d2-0053630dd7cb Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
|
@copilot please enable this CMake flag in the release pipeline, and where the option is defined in CMake, add a comment paragraph describing the various options, a summary of their effect, and a link to their documentation page, wherever it lives. |
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/037f8d1d-810e-4bf8-b065-39391094a066 Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Addressed in 66512af: the release and RPM reproduction CMake invocations now explicitly set |
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-in (default ON) CMake toggle to apply supported compiler/linker hardening flags to optimized “release” configurations, and ensures the release/repro pipelines explicitly enable it for reproducible packaging.
Changes:
- Adds
CCF_ENABLE_RELEASE_HARDENING(defaultON) and conditionally enables supported hardening compile/link options forRelease,RelWithDebInfo, andMinSizeRel. - Updates the release GitHub Actions workflow and RPM reproduction script to explicitly set
-DCCF_ENABLE_RELEASE_HARDENING=ONforReleasebuilds. - Improves RPM reproduction script robustness by enabling
pipefail.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
reproduce/reproduce_rpm.sh |
Enables pipefail and explicitly turns on release hardening during RPM reproduction builds. |
CMakeLists.txt |
Adds CCF_ENABLE_RELEASE_HARDENING and applies supported hardening flags via CMake feature checks for release configurations. |
.github/workflows/release.yml |
Explicitly enables release hardening in the release build and RPM packaging workflow. |
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/781667e0-a79e-4c73-bfbe-ad212dcc3d1b Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
|
@copilot the hardening must be done by target, using target_compile_options etc, see how it's done for SAN/TSAN for an example. Have a function that does this, called add_hardening(), containing the switch, and apply it to all the relevant targets (i.e. anything that goes in the release package). |
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/811f0736-c785-47e0-86eb-5bfd6a7e5565 Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/811f0736-c785-47e0-86eb-5bfd6a7e5565 Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Implemented in c928faa: hardening now uses a per-target |
|
@copilot make a table of all targets, and for each list whether they are included in the release package, whether you enabled hardening or not, and your justification for your choice. |
Audited the top-level CMake targets from a RelWithDebInfo configure with release hardening enabled. “Hardened” means
Conditional/standalone targets not in that default top-level target list: |
Uh oh!
There was an error while loading. Please reload this page.