Skip to content

docs(security): state release-build hardening flags and verification (closes #208) - #246

Open
simbo1905 wants to merge 2 commits into
mainfrom
217-release-hardening
Open

simbo1905 wants to merge 2 commits into
mainfrom
217-release-hardening

Conversation

@simbo1905

@simbo1905 simbo1905 commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #208.

What

Adds a "Release-build hardening flags" subsection to
docs/SECURITY_ARCHITECTURE.md and its CN twin, stating the flags
xmake build-release actually applies (Linux/macOS:
-fstack-protector-strong, _FORTIFY_SOURCE=2, -fPIE/-pie;
Windows: /GS), how to verify them on a shipped binary (otool/readelf

  • nm | grep stack_chk), and that debug/trace builds are intentionally
    unhardened. 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-release prints: release hardening flags: -fstack-protector-strong -fPIE -pie _FORTIFY_SOURCE=2
  • otool -hv build/macosx/arm64/release/lunet-run → flags include PIE
  • nm build/macosx/arm64/release/lunet-run | grep stack_chk →
    ___stack_chk_fail, ___stack_chk_guard
  • EN/CN twins both carry the new subsection with matching content.

Refs ticket 217.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 10:52
@simbo1905
simbo1905 enabled auto-merge November 1, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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
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.

release builds: runtime hardening flags + non-root/seccomp deployment guidance

2 participants