1# Redfish resource supplement for Platform Firmware Resilience (PFR)
2
3Author: AppaRao Puli
4
5Primary assignee: AppaRao Puli !apuli
6
7Other contributors: None
8
9Created: 2019-09-12
10
11## Problem description
12
13The platform is a collection of fundamental hardware and firmware components
14needed to boot and operate a system. The Platform Firmware Resiliency(PFR)
15in NIST SP 800-193 provides technical guidelines and recommendations
16supporting resiliency of platform firmware and data against potentially
17destructive attacks.
18
19Currently Redfish schema's defined by DMTF doesn't cover properties or
20resources to represent the PFR provisioned and locked states.
21
22This document covers the new OEM properties under ComputerSystem resource
23to represent the PFR provisioning status such as platform firmware is
24provisioned or not as well as provisioning is locked or not. This also covers
25the Redfish OpenBMC message registry metadata for logging events associated
26with PFR.
27
28## Background and references
29
30Platform Firmware Resilience technology in NIST SP 800-93 provide common
31guidelines to implementers, including Original Equipment Manufacturers (OEMs)
32and component/device suppliers, to build stronger security mechanisms into
33platforms. Server platforms consist of multiple devices which must provide
34resiliency by protecting, detecting and recovering platform assets. Management
35controller running on server platform can be used to indicate the status of
36resiliency and event logs associated with it.
37
38 - [NIST.SP.180-193](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-193.pdf)
39 - [Redfish schema supplement](https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2019.1a.pdf)
40 - [Redfish Logging in bmcweb](https://github.com/openbmc/docs/blob/master/redfish-logging-in-bmcweb.md)
41
42## Requirements
43
44High level requirements:
45
46  - BMC shall provide the way to represent Platform Firmware Resilience
47    provisioning status over Redfish.
48
49  - Event logs should be logged to redfish for Platform Firmware Resilience.
50
51## Proposed design
52
53Different OEM's has there own way of implementing the Platform Firmware
54Resilience by using guidelines provided by NIST SP 800-193. Some of the
55component protected under this includes(not limited) ES/SIO, BMC/ME Flash,
56Host Processors, Trusted Platform Modules(TPM), PSU's, Memory etc...
57For example Intel uses the "Intel PFR" design to resiliency platform
58components.
59
60NOTE: This document doesn't cover design aspects of how OEM's implements
61the Platform Firmware Resilience. It covers only generic redfish ComputerSystem
62OEM properties and Redfish message registry metadata entries which are
63implementation agnostic.
64
65OpenBMC is moving to Redfish as its standard for out of band management.
66The bmcweb implements all the Redfish schema's to represent different
67properties and resources. ComputerSystem schema doesn't cover the properties
68associated with Platform Firmware Resilience but it provides OEM objects for
69manufacturer/provider specific extension moniker.
70
71Below are two OEM properties defined to represent the Platform Firmware
72Resilience provisioning status.
73
74  - Provisioned: The value of this property shall be a boolean indicating
75    provisioned state of platform firmware.
76
77  - Locked: The value of this property shall be a boolean indicating platform
78    firmware provisioning is locked.
79
80PFR enabled platforms can provision or re-provision the platform resilience
81multiple times without Locking. But once the platform is locked by provisioning
82agent after, it can not be re-provisioned.
83
84New OemComputerSystem schema can be found at
85[link](https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/24253/)
86
87PFR in OpenBMC must support logging of resiliency error detection and
88correction. Below are two metadata entries in redfish message registry
89for redfish event logging capability. For more details on how to log redfish
90events can be found at document [Redfish logging in bmcweb
91](https://github.com/openbmc/docs/blob/master/redfish-logging-in-bmcweb.md).
92
93
94```
95MessageEntry{
96        "PlatformFirmwareError",
97        {
98            .description = "Indicates that the specific error occurred in "
99                           "platform firmware.",
100            .message = "Error occurred in platform firmware. ErrorCode=%1",
101            .severity = "Critical",
102            .numberOfArgs = 1,
103            .paramTypes = {"string"},
104            .resolution = "None.",
105        }},
106    MessageEntry{
107        "PlatformFirmwareEvent",
108        {
109            .description = "Indicates that the platform firmware events like "
110                           "panic or recovery occurred for the specified "
111                           "reason.",
112            .message = "Platform firmware %1 event triggered due to %2.",
113            .severity = "Critical",
114            .numberOfArgs = 2,
115            .paramTypes = {"string", "string"},
116            .resolution = "None.",
117        }},
118```
119
120
121## Alternatives considered
122
123None
124
125## Impacts
126
127None
128
129## Testing
130
131Provisiong status:
132
133  - User can provision the PFR in OEM specific way and test using below URI
134    and Method. Intel uses "Intel PFR" design (via BIOS) to provision and
135    lock the PFR provisioning status.
136```
137URI: /redfish/v1/Systems/system
138METHOD: GET
139RESPONSE:
140
141{
142  "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
143  "@odata.id": "/redfish/v1/Systems/system",
144  "@odata.type": "#ComputerSystem.v1_6_0.ComputerSystem",
145  ...................
146  ...................
147  "Description": "Computer System",
148  "Oem": {
149    "OpenBmc": {
150      "FirmwareProvisioning": {
151        "Locked": true,
152        "Provisioned": true
153      }
154    }
155  },
156  ...................
157  ...................
158}
159```
160
161Event logs:
162
163  - User can induce security attack and validate the panic event logs as well as
164    recovery mechanism using below URI.
165
166    Few examples to attack Firmware components and validate PFR:
167
168     1) Corrupt the BMC/BIOS etc... firmware and check Panic events and recovery
169        actions events.
170
171     2) Induce hardware watchdog trigger using known methods and check.
172     etc..
173
174     3) Corrupt the security key's by directly mocking hardware and validate.
175
176```
177URI: /redfish/v1/Systems/system/LogServices/EventLog/Entries
178METHOD: GET
179```
180