Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The security documentation still contains platform-inappropriate verification commands: macOS needs otool -hv rather than readelf, and stripped Linux releases need nm -D rather than plain nm, with matching corrections in the Chinese documentation.
2 open issues
What changed in this PR
This documentation-only PR explains Lunet’s release-build hardening flags and how consumers can verify them, addressing the documentation gap described in issue #208.
Changes:
- Documents platform-specific hardening flags and their release-only scope.
- Adds macOS and Linux binary-verification commands.
- Adds matching English and Simplified Chinese sections.
| File | Description |
|---|---|
docs/SECURITY_ARCHITECTURE.md |
Adds release-hardening details and verification instructions. |
docs/SECURITY_ARCHITECTURE-CN.md |
Adds the corresponding Simplified Chinese documentation. |
Review effort: Balanced
|
|
||
| - Linux / macOS: `-fstack-protector-strong`, `_FORTIFY_SOURCE=2`, and `-fPIE`/`-pie` | ||
| on the executable targets (shared objects stay PIC). Verify with | ||
| `readelf -h <binary>` (type `ET_DYN`, PIE) and `nm <binary> | grep stack_chk`. |
|
|
||
| # Linux | ||
| readelf -h /path/to/lunet-run | grep 'Type:.*DYN' | ||
| nm /path/to/lunet-run | grep stack_chk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #208.
What
Adds a "Release-build hardening flags" subsection to
docs/SECURITY_ARCHITECTURE.mdand its CN twin, stating the flagsxmake build-releaseactually applies (Linux/macOS:-fstack-protector-strong,_FORTIFY_SOURCE=2,-fPIE/-pie;Windows:
/GS), how to verify them on a shipped binary (otool/readelfnm | grep stack_chk), and that debug/trace builds are intentionallyunhardened. The docs previously described the policy ("harden the runtime")
but not the real flags; this closes that gap.
Evidence (verified on this host)
xmake build-releaseprints:release hardening flags: -fstack-protector-strong -fPIE -pie _FORTIFY_SOURCE=2otool -hv build/macosx/arm64/release/lunet-run→ flags includePIEnm build/macosx/arm64/release/lunet-run | grep stack_chk→___stack_chk_fail,___stack_chk_guardRefs ticket 217.
Need help on this PR? Tag
@codesmith-botwith what you need.