security/hardening-tool.html · security/hardening-tool.rst 공식 원문 ↗

Zephyr 3.7.0 · Security

Zephyr Hardening Tool

위험한 option은 끄고 stack protection 같은 방어 기능은 켜도록 권고합니다.

Official pathsecurity/hardening-tool.html
Source filesecurity/hardening-tool.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Security Working Group 기준과 hardenconfig 결과 해석을 설명합니다.

Input

Build Kconfig

Target

hardenconfig

Output

Current · Recommended · Result

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 492A94E2AF5992C373ABFDCE2151F88911B23D8F902F66DA5456A41E8C6CD25B
.. _hardening:

Hardening Tool
##############

Before launching a product, it's crucial to ensure that your software is as secure as possible. This
process, known as "hardening", involves strengthening the security of a system to protect it from
potential threats and vulnerabilities.

At a high-level, hardening a Zephyr application can be seen as a two-fold process:

#. Disabling features and compilation flags that might lead to security vulnerabilities (ex. making
   sure that no "experimental" features are being used, disabling features typically used for
   debugging purposes such as assertions, shell, etc.).
#. Enabling optional features that can lead to improve security (ex. stack sentinel, hardware stack
   protection, etc.). Some of these features might be hardware-dependent.

To simplify this process, Zephyr offers a **hardening tool** designed to analyze an application's
configuration against a set of hardening preferences defined by the **Security Working Group**. The
tool looks at the KConfig options in the build target and provides tailored suggestions and
recommendations to adjust security-related options.

Usage
*****

.. zephyr-app-commands::
    :tool: all
    :app: samples/hello_world
    :board: reel_board
    :goals: hardenconfig

The output should be similar to the table below. For each configuration option set to a value that
could lead to a security vulnerability, the table will propose a recommended value that should be
used instead.

.. code-block:: console

                  name                       |   current   |  recommended   ||    check result
   ================================================================================================
   CONFIG_BOOT_BANNER                        |      y      |       n        ||       FAIL
   CONFIG_BUILD_OUTPUT_STRIPPED              |      n      |       y        ||       FAIL
   CONFIG_FAULT_DUMP                         |      2      |       0        ||       FAIL
   CONFIG_HW_STACK_PROTECTION                |      n      |       y        ||       FAIL
   CONFIG_MPU_STACK_GUARD                    |      n      |       y        ||       FAIL
   CONFIG_OVERRIDE_FRAME_POINTER_DEFAULT     |      n      |       y        ||       FAIL
   CONFIG_STACK_SENTINEL                     |      n      |       y        ||       FAIL
   CONFIG_EARLY_CONSOLE                      |      y      |       n        ||       FAIL
   CONFIG_PRINTK                             |      y      |       n        ||       FAIL

Part 3

한국어 전문 번역

Product를 출시하기 전에는 software를 가능한 한 안전하게 만드는 일이 중요합니다. Hardening은 잠재적인 threat와 vulnerability로부터 system을 보호하도록 security를 강화하는 과정입니다.

높은 수준에서 Zephyr application hardening은 두 부분으로 볼 수 있습니다.

  1. Security vulnerability를 만들 수 있는 feature와 compilation flag를 비활성화합니다. Experimental feature를 사용하지 않는지 확인하고 assertion, shell처럼 주로 debugging에 쓰는 feature를 끄는 것이 예입니다.
  2. Security 향상에 도움이 되는 optional feature를 활성화합니다. Stack sentinel과 hardware stack protection이 예이며 일부는 hardware 지원에 의존합니다.

Zephyr는 이 과정을 단순화하기 위해 Security Working Group이 정의한 hardening preference를 기준으로 application configuration을 분석하는 hardening tool을 제공합니다. Tool은 build target의 Kconfig option을 조사하고 security 관련 option을 조정하도록 상황에 맞는 제안과 권고를 제공합니다.

사용법

reel_board용 Hello World sample을 build하고 hardenconfig target을 실행하는 west command는 다음과 같습니다.

west build -b reel_board samples/hello_world
west build -t hardenconfig

CMake로 Ninja buildsystem을 구성한 뒤 같은 target을 실행하는 방법은 다음과 같습니다.

# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild -GNinja -DBOARD=reel_board samples/hello_world

# Now run the build tool on the generated build system:
ninja -Cbuild hardenconfig

출력은 아래 표와 비슷합니다. Security vulnerability로 이어질 수 있는 값으로 설정된 각 configuration option에 대해 대신 사용할 권장값을 제시합니다.

name                       |   current   |  recommended   ||    check result
================================================================================================
CONFIG_BOOT_BANNER                        |      y      |       n        ||       FAIL
CONFIG_BUILD_OUTPUT_STRIPPED              |      n      |       y        ||       FAIL
CONFIG_FAULT_DUMP                         |      2      |       0        ||       FAIL
CONFIG_HW_STACK_PROTECTION                |      n      |       y        ||       FAIL
CONFIG_MPU_STACK_GUARD                    |      n      |       y        ||       FAIL
CONFIG_OVERRIDE_FRAME_POINTER_DEFAULT     |      n      |       y        ||       FAIL
CONFIG_STACK_SENTINEL                     |      n      |       y        ||       FAIL
CONFIG_EARLY_CONSOLE                      |      y      |       n        ||       FAIL
CONFIG_PRINTK                             |      y      |       n        ||       FAIL

Example에서는 boot banner·fault dump·early console·printk를 줄이거나 끄고, stripped output·hardware stack protection·MPU stack guard·frame pointer·stack sentinel을 활성화하라고 권고합니다. 현재값이 권장값과 다르면 check result가 FAIL로 표시됩니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.