Redfish Aggregation: Router to satellite resources

Adds ability to route requests to either native resources or
resources that belong to a satellite BMC as part of Redfish
Aggregation.  A prefix in the URI denotes if the resource is actually
from a satellite BMC.  Prefixes are only used to denote satellite
resources.  The URI of resources on the local/aggregating BMC will
remain unchanged.

Prefixes are separated from the resource ID by an underscore.  This
means that underscores cannot be used in the prefix name itself.
The prefixes used by satellite BMCs are revealed via D-Bus as well as
the config information needed to connect to that BMC.

Requests for satellite resources will not be handled locally.

Care should be taken to not name any local resources in a way that
could cause a collision (e.g. having a Chassis object named
"aggregated0_1U" on the aggregating BMC).

The patch only covers routing requests.  Requests to collection URIs
like /redfish/v1/Chassis will only return resources on the local BMC.
A future patch will cover adding satellite resources to collections.

Also note that URIs returned in the responses will not have the proper
prefix included.  Fixing these URIs will be addressed in future
patches.

A number of TODO comments are included in the code to indicate that
this functionality (collections and URI fixup) still needs to be
implemented.

Example URIs w/o Redfish Aggregation:
/redfish/v1/Chassis/1U/
/redfish/v1/Systems/system/
/redfish/v1/Managers/bmc/

Example URIs after enabling Redfish Aggregation if the associated
resources are located on the local/aggregating BMC:
/redfish/v1/Chassis/1U/
/redfish/v1/Systems/system/
/redfish/v1/Managers/bmc/

Example URIs if resources are instead located on a satellite BMC
named "aggregated0":
/redfish/v1/Chassis/aggregated0_1U/
/redfish/v1/Systems/aggregated0_system/
/redfish/v1/Managers/aggregated0_bmc/

Tested:
I was able to query supported resources located on the local BMC
as well as on a satellite BMC.  Requests with unknown prefixes return
a 404.  Requests to resource collections only return the resources
that are located on the aggregating BMC.

Signed-off-by: Carson Labrado <clabrado@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I87a3deb730bda95e72ecd3144ea40b0e5ee7d491
3 files changed
tree: 7103d9e940ec1ade36f5c89dcc314579fae64302
  1. .github/
  2. http/
  3. include/
  4. redfish-core/
  5. scripts/
  6. src/
  7. static/
  8. subprojects/
  9. .clang-format
  10. .clang-ignore
  11. .clang-tidy
  12. .dockerignore
  13. .gitignore
  14. .shellcheck
  15. bmcweb.service.in
  16. bmcweb.socket.in
  17. bmcweb_config.h.in
  18. build_x86.sh
  19. build_x86_docker.sh
  20. CLIENTS.md
  21. COMMON_ERRORS.md
  22. DEVELOPING.md
  23. Dockerfile
  24. Dockerfile.base
  25. HEADERS.md
  26. LICENSE
  27. meson.build
  28. meson_options.txt
  29. OEM_SCHEMAS.md
  30. OWNERS
  31. pam-webserver
  32. README.md
  33. Redfish.md
  34. run-ci
  35. setup.cfg
  36. TESTING.md
README.md

OpenBMC webserver

This component attempts to be a "do everything" embedded webserver for OpenBMC.

Features

The webserver implements a few distinct interfaces:

  • DBus event websocket. Allows registering on changes to specific dbus paths, properties, and will send an event from the websocket if those filters match.
  • OpenBMC DBus REST api. Allows direct, low interference, high fidelity access to dbus and the objects it represents.
  • Serial: A serial websocket for interacting with the host serial console through websockets.
  • Redfish: A protocol compliant, (Redfish.md)[DBus to Redfish translator].
  • KVM: A websocket based implementation of the RFB (VNC) frame buffer protocol intended to mate to webui-vue to provide a complete KVM implementation.

Protocols

bmcweb at a protocol level supports http and https. TLS is supported through OpenSSL.

AuthX

Authentication

Bmcweb supports multiple authentication protocols:

  • Basic authentication per RFC7617
  • Cookie based authentication for authenticating against webui-vue
  • Mutual TLS authentication based on OpenSSL
  • Session authentication through webui-vue
  • XToken based authentication conformant to Redfish DSP0266

Each of these types of authentication is able to be enabled or disabled both via runtime policy changes (through the relevant Redfish APIs) or via configure time options. All authentication mechanisms supporting username/password are routed to libpam, to allow for customization in authentication implementations.

Authorization

All authorization in bmcweb is determined at routing time, and per route, and conform to the Redfish PrivilegeRegistry.

*Note: Non-Redfish functions are mapped to the closest equivalent Redfish privilege level.

Configuration

bmcweb is configured per the meson build files. Available options are documented in meson_options.txt

Compile bmcweb with default options:

meson builddir
ninja -C builddir

If any of the dependencies are not found on the host system during configuration, meson will automatically download them via its wrap dependencies mentioned in bmcweb/subprojects.

Debug logging

bmcweb by default is compiled with runtime logging disabled, as a performance consideration. To enable it in a standalone build, add the

-Dlogging='enabled'

option to your configure flags. If building within Yocto, add the following to your local.conf.

EXTRA_OEMESON:pn-bmcweb:append = "-Dbmcweb-logging='enabled'"

Use of persistent data

bmcweb relies on some on-system data for storage of persistent data that is internal to the process. Details on the exact data stored and when it is read/written can seen from the persistent_data namespace.

TLS certificate generation

When SSL support is enabled and a usable certificate is not found, bmcweb will generate a self-signed a certificate before launching the server. Please see the bmcweb source code for details on the parameters this certificate is built with.