Satish Kumar | 427923c | 2021-10-05 07:21:53 +0100 | [diff] [blame] | 1 | ################################## |
| 2 | Authenticated Debug Access Control |
| 3 | ################################## |
| 4 | |
| 5 | ************ |
| 6 | Introduction |
| 7 | ************ |
| 8 | |
| 9 | Introducing security in debug is about making sure that only authorized people |
| 10 | have access to select parts of firmware and hardware. The Trusted Firmware-M |
| 11 | software implementation contained in this project is designed to be a |
| 12 | reference implementation. |
| 13 | |
| 14 | ADAC aims at making sure that debug capabilities do not become attack vectors. |
| 15 | Debug security cannot be an afterthought when designing an SoC and the kind of |
| 16 | debug solution needed is driven by the threat models for the device use case. |
| 17 | |
| 18 | The ADAC architecture is designed to be flexible to meet varying vendor needs, |
| 19 | adaptable to work with many different hardware and software components, and |
| 20 | scalable from small embedded or IoT systems to complex server environments. |
| 21 | At the same time, it strives to be simple and resilient against attack. |
| 22 | |
| 23 | `Authenticated Debug Access Control`_ (ADAC). |
| 24 | |
| 25 | ********** |
| 26 | Components |
| 27 | ********** |
| 28 | |
| 29 | The repository contains software componenets, of the ADAC protocol, towards |
| 30 | the target side. The following components are included in this repo: |
| 31 | |
| 32 | * Secure Debug Authenticator (SDA) |
| 33 | * ADAC protocol core |
| 34 | * Supported target platforms |
| 35 | * trusted-firmware-m: dipdha platform |
| 36 | * Transport layer |
| 37 | * `SDC-600 Secure Debug Channel`_ |
| 38 | |
| 39 | ******************** |
| 40 | Directory structures |
| 41 | ******************** |
| 42 | |
| 43 | - psa-adac |
| 44 | - core |
| 45 | - sda |
| 46 | - target |
| 47 | - target name |
| 48 | - files implementing platform interface of psa-adac/core and psa-adac/sda |
| 49 | - psa_adac_platform.h: place where platform specific incoming and outgoing calls can be declared |
| 50 | - transport |
| 51 | - files implementing transport interface of psa-adac/core and psa-adac/sda |
| 52 | - various implementations of transport layer for communication with the host can be hosted here |
| 53 | - template_hal_files |
| 54 | - template files for hal api definitions |
| 55 | |
| 56 | |
| 57 | ************************ |
| 58 | Integration instructions |
| 59 | ************************ |
| 60 | |
| 61 | Build options |
| 62 | ============= |
| 63 | |
| 64 | Build from the adac repository |
| 65 | ---------------------------------- |
| 66 | |
| 67 | Configure: |
| 68 | |
| 69 | .. code-block:: |
| 70 | |
| 71 | cmake -B <build_dir> -S . -DCMAKE_BUILD_TYPE=Debug -DPSA_ADAC_TARGET=<target_name> -DPSA_ADAC_MBEDTLS_INCLUDE=<path to mbedtls include> |
| 72 | |
| 73 | Build and install: |
| 74 | |
| 75 | .. code-block:: |
| 76 | |
| 77 | cmake --build <build_dir> -- install |
| 78 | |
| 79 | Static library will be installation at: |
| 80 | |
| 81 | .. code-block:: |
| 82 | |
| 83 | <build_dir>/install/lib/lib_<target_name>.a |
| 84 | |
| 85 | Build as cmake target |
| 86 | --------------------- |
| 87 | |
| 88 | .. code-block:: |
| 89 | |
| 90 | add_subdirectory(${PLATFORM_PSA_ADAC_SOURCE_PATH} ${PLATFORM_PSA_ADAC_BUILD_PATH}) |
| 91 | target_link_libraries(<target_name>-psa-adac |
| 92 | PRIVATE |
| 93 | <caller of adac entry point> |
| 94 | ) |
| 95 | |
| 96 | Configuration variables |
| 97 | ======================= |
| 98 | |
| 99 | PSA_ADAC_TOOLCHAIN |
| 100 | ------------------ |
| 101 | When OFF, the build will not include toolchain files from the |
| 102 | adac repository. User can decide to choose the toolchain configuration from the |
| 103 | adac repository or can also provide its own toolchain configuration files. |
| 104 | |
| 105 | PSA_ADAC_TARGET |
| 106 | --------------- |
| 107 | Name of the target. Support for the target should exist inside |
| 108 | the ./target/ directory. |
| 109 | |
| 110 | PSA_ADAC_MBEDTLS_INCLUDE |
| 111 | ------------------------ |
| 112 | Path to mbedtls include directory (`MBEDTLS Repository`_) |
| 113 | |
| 114 | .. code-block:: |
| 115 | |
| 116 | <mbedtls>/include |
| 117 | |
| 118 | |
| 119 | HAL integration |
| 120 | =============== |
| 121 | |
| 122 | psa-adac/sda and psa-adac/core depends on the following inteface: |
| 123 | |
| 124 | platform.h |
| 125 | ---------- |
| 126 | Defines the interface to the platform. A template file for the inteface |
| 127 | can be found inside template directory. |
| 128 | |
| 129 | psa_adac_crypto_api.h |
| 130 | --------------------- |
| 131 | Defines the interface to the cryptographic supported required |
| 132 | by the adac protocol implementation. |
| 133 | |
| 134 | A target should provide the implementation of these HAL APIs. An example for platform.h |
| 135 | api implementation can be find inside corstone1000 target directory. And example for |
| 136 | crypto api implementaion can be find inside `Trusted-Firmware-M`_ repository. Further |
| 137 | such integration of crypto apis, based on software (ex: mbedtls) as well as based on |
| 138 | hardware accelerattion, can also be hosted as part of this repository. |
| 139 | |
| 140 | msg_interface.h |
| 141 | --------------- |
| 142 | Defines the interface to the transport layer. The transport layer supports the communication |
| 143 | between host and the target. The file, msg_interface.h, only contains the interface used |
| 144 | by the target, i.e. psa-adac/core and psa-adac/sda. Various implementation of transport |
| 145 | layer can be hosted inside ./trasport/ directory. For ex: corstone1000 uses transport based |
| 146 | on SDC600 COMPORT. |
| 147 | |
| 148 | Integration to the secure debug workflow |
| 149 | ======================================== |
| 150 | |
| 151 | The entry function definition to start the secure debug flow and any other dependency, |
| 152 | a target is free to declare such apis inside the file: psa_adac_platform.h |
| 153 | |
| 154 | Corstone1000 psa_adac_platform.h is one such example. |
| 155 | |
| 156 | |
| 157 | Target examples |
| 158 | =============== |
| 159 | |
| 160 | Build instructions for Corstone1000 platform inside trusted-firmware-m |
| 161 | ---------------------------------------------------------------------- |
| 162 | |
| 163 | Configure: |
| 164 | |
| 165 | .. code-block:: |
| 166 | |
| 167 | cmake -B <build_dir> -S . -DCMAKE_BUILD_TYPE=Debug -DPSA_ADAC_TARGET=trusted-firmware-m -DTFM_PLATFORM=arm/corstone1000 -DPSA_ADAC_MBEDTLS_INCLUDE=<mbedtls>/include |
| 168 | |
| 169 | Build and install: |
| 170 | |
| 171 | .. code-block:: |
| 172 | |
| 173 | cmake --build <build_dir> -- install |
| 174 | |
| 175 | Build library: |
| 176 | |
| 177 | .. code-block:: |
| 178 | |
| 179 | build/install/lib/libtrusted-firmware-m-psa-adac.a |
| 180 | |
| 181 | The library generated contains secure debug support for Corstone1000 platform |
| 182 | which can be linked to Corstone1000's trusted-firmware-m build. |
| 183 | |
| 184 | .. _Authenticated Debug Access Control: https://developer.arm.com/documentation/den0101/latest |
| 185 | .. _SDC-600 Secure Debug Channel: https://www.arm.com/products/silicon-ip-system/coresight-debug-trace/sdc-600 |
| 186 | .. _MBEDTLS Repository: https://github.com/ARMmbed/mbedtls.git |
| 187 | .. _Trusted-Firmware-M : https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/ |
| 188 | |
| 189 | *Copyright (c) 2021, Arm Limited. All rights reserved.* |