Copyright © 2023-2025 The Johns Hopkins University Applied Physics Laboratory LLC
License
This document is part of the Bundle Protocol Security Library (BSL).
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This work was performed for the Jet Propulsion Laboratory, California Institute of Technology, sponsored by the United States Government under the prime contract 80NM0018D0004 between the Caltech and NASA under subcontract 1700763.
Revision History | |
---|---|
Revision Initial | 21 August 2025 |
Initial issue of document for BSL v1.0.0 |
This User Guide provides an overview of the application programming interface (API) and high-level workflows of the Bundle Protocol Security Library (BSL), which is part of the NASA Advanced Multi-Mission Operations System (AMMOS) suite of tools.
Property | Value |
---|---|
Configuration ID (CI) | 681.4 |
Element | Mission Control System (MCS) |
Program Set | Bundle Protocol Security Library (BSL) |
Version | 1.0 |
This document describes and explains the API and workflows of the BSL. For technical details about the BSL architecture, installation, upgrade, monitoring, and maintenance see the BSL Product Guide. Details about specific API structures and cross-relationships is provided in the online BSL API Docs.
The following are Generic terms:
The following are BP- and BPSec-related terms:
This determines the action of a security operation, as one of:
The following are BSL-specific terms:
Title | Document Number |
---|---|
Software Development | 57653 rev 10 |
Title | Document Number |
---|---|
MGSS Implementation and Maintenance Task Requirements (MIMTaR) | DOC-001455 rev G |
BSL Software Requirements Document (SRD) | |
BSL Software Interface Specification (SIS) | |
BSL Product Guide |
Title | Reference |
---|---|
BSL Source | |
BSL Documentation Source | |
BSL API Documentation — Main Branch | |
Programming Languages — C | ISO/IEC 9899:1999 |
IEEE Standard for Information Technology - Portable Operating System Interface (POSIX®) | |
M*LIB: Generic type-safe Container Library for C language | |
QCBOR Library | |
OpenSSL Library | |
Jansson Library | |
Unity Test Library | |
NASA Interplanetary Overlay Networking (ION) software | |
Wireshark Project | |
The JavaScript Object Notation (JSON) Data Interchange Format | |
Concise Binary Object Representation (CBOR) | |
Bundle Protocol Version 7 | |
Bundle Protocol Security (BPSec) | |
Default Security Contexts for Bundle Protocol Security (BPSec) |
The BSL is a set of software libraries and plugin modules which together perform the functions required by RFC 9172 [RFC9172] and RFC 9173 [RFC9173] in a way which can be instantiated from and used by a BP Agent operating according to RFC 9171 [RFC9171].
The BSL is made to interact with its environment through C99 <<C99> Application Programming Interface (API) function calls into the BSL library and out of it.
The "factory default" BSL is configured to operate with a "dynamic backend" which uses dynamic heap allocation and variable-sized data containers (arrays, lists, maps, etc.). An alternative backend could be developed for specific BPA needs, but that is outside the scope of the BSL project.
The factory default BSL also builds example Policy Providers and example Security Contexts in order to be able to fully exercise the BSL behaviors. Alternative Policy Providers are expected to be developed for each deployment. Alternative Security Context implementations are expected to be developed for future contexts, and to adapt to deployment-specific needs such as for key management or specialized cryptographic interfaces.
The BSL project is based on a single source tree but is subdivided into separate libraries, each with their own cross-dependencies (for compiling and linking). The dependencies between areas are shown in Figure 1.1, where the single "BSL" block is meant to represent both the frontend and backend libraries for simplicity.
The BSL is internally separated into two layers of implementation: an API-centric abstract Frontend library and a host-binding concrete Backend library.
The Frontend library provides the service API for the BSL to be called by its associated BPA as needed and for stable public APIs used by Policy Provider implementations and Security Context implementations. The Backend library implements forward-declared structs and functions from the Frontend using specific concrete data containers, algorithms, etc.
Most interactions with the BSL/frontend API occur within the context of a single bundle. There are four points along bundle traversal where BSL interaction from the BPA is necessary:
This is depicted in Figure 1.2, where each of the edges in that diagram indicates a call from the BPA into the BSL to process security on that single bundle at the specific location. A more detailed view of the BSL processing sequence at each of those interaction points is described later in Section 3.2.
Separate from the structural aspects of the BSL and its external APIs, there are different directions that calls are being made for different interactions between the same entities. For the factory configuration, using the dynamic backend, these interactions take two forms:
The initiating calls are directed from the BPA into the BSL, and then into PPs (to inform what security operations need to be done) and SCs (to actually execute the security operations). This is depicted in Figure 1.3, where the BPA initiates the sequence using the frontend API and the BSL calls into each PP and necessary SC based on callbacks injected into the BPA at their times of registration.
As part of normal PP and SC processing, they will need to obtain data from the bundle, access its various blocks, and obtain some data from the BPA itself. Some of these calls will originate from the BSL itself and some will originate from the PP and SC instances, passing through the BSL based on its own frontend API. This is depicted in Figure 1.4, which elides the ultimate source of each of these calls (which is always the BPA).
The following section provides an overview of the BSL API and references to specific sections of the online API documentation.
The information model for how the BSL operates is built upon the BPSec terminology listed in Section 3 with its own additional terms needed for internal logic.
All of the discussion in this subsection is at the level of logical entities and information models. It does not map one-for-one with the actual APIs of the BSL, but is useful for explaining terminology and framing explanations at a higher level than the C-language details discussed in the BSL API Docs.
This document uses UML diagrams to depict the logical structure and associations within the BSL. Because the implementation is based int eh C language, there is no such concept as an abstract class, inheritance, or virtual function override. The BSL uses the concept of a "descriptor" struct to implement this behavior, which is simply a C struct containing a set of callback function pointers and some user data pointer used as a "self" context to each of the callbacks.
The BSL proper is embodied as a "BSL Context" state, for which a single process can have any number of instances. One BPA option is to have a single BSL Context for all of its security processing, which will save on memory use but will act as a bottleneck if the BPA performs its own bundle processing concurrently at each of the interaction points. Another BPA option is to use a separate BSL Context for each interaction point and operate them independently and possibly concurrently.
Because the function of the BSL is perform security processing on individual bundles, all of the processing of the BSL Context operates on a single "Bundle Context" at a time. The purpose of a Bundle Context is to both relate back to some form of BPA-specific handle used to identify the bundle within the BPA, as well as keeping BSL-specific state derived from the BPA-supplied bundle data such as an efficient look-up table for block types or block numbers.
Each BSL Context instance is associated with one or more Policy Provider instances and one or more Security Context instances, as depicted in Figure 2.2. The Policy Providers are used to control what the BSL needs to do for a specific bundle, as discussed in more detail in Section 2.2. The Security Contexts are used to validate and actually execute each security operation, as discussed in more detail in Section 2.3.
The BSL v1.0.0 supports only a single registered Policy Provider for each BSL Context.
In addition to the externally-visible information about security operations and their target, parameters, and results the BSL adds the notion of a security Action which is an ordered sequence of specific operations. This is necessary because some policies require, for example, some operations to be accepted before others are sourced which would refer to the same target block.
Another internal information item is the security Option, which is used to communicate configuration of individual security operations between a Policy Provider and an associated Security Context. Some options are converted by the SC into Parameters or Results that get encoded into the ASB when acting as the Source role. Some options, like key identifiers for the default security contexts, do not have representation in the ASB but are necessary for correct processing of the security operation.
Policy Providers need to be registered with a library context via the dynamic backend before they can be used.
Policy Providers must implement the function headers of the frontend PolicyProvider.h
header file.
Policy Providers must inspect each bundle to produce an Action Set, containing Security Operations. Policy Providers also must finalize over a bundle after each Security Operation has been executed by the security context.
The BSL includes a simple rule-based example PP that may be utilized.
Security Contexts need to be registered with a library context via the dynamic backend before they can be used.
Security Contexts must implement the function headers of the frontend SecurityContext.h
header file.
The BSL includes two Default Security Context implementations, both specified in [RFC9173]:
BIB-HMAC-SHA2
(context ID 1) for Block IntegrityBCB-AES-GCM
(context ID 2) for Block ConfidentialityThe BSL backend cryptographic interface utilizes OpenSSL to perform HMAC-signing, encryption, and decryption operations.
Security Contexts operate in the context of a single Security Operation over a bundle. Security Contexts must validate Security Operations for consistency, and process Security Operations on bundles to produce security outcomes.
An executable used to provide a test fixture and example BPA integration. However, the Mock BPA does not provide any of the normal processing required of a real BPA by [RFC9171], it is limited to decoding and encoding BPv7 protocol data unit (PDU) byte strings, processing specific BPv7 primary block fields, providing BSL-required integration callbacks, and calling into the BSL for each bundle being processed at each interaction point. Users may reference the Mock BPA for an example of library and bundle workflow.
The following are preprocessor define directives that limit certain capabilities within the BSL.
BSL_LOG_QUEUE_SIZE
= 100BSL_CRYPTO_AESGCM_AUTH_TAG_LEN
= 16BSLX_MAX_AES_PAD
= 64RFC9173_BCB_DEFAULT_IV_LEN
= 12BSLP_POLICYPREDICATE_ARRAY_CAPACITY
= 100MOCK_BPA_MAX_POLICIES
= 100DATA_QUEUE_SIZE
= 100A simple BPA that utilizes the example policy provider, default security contexts, and dynamic backend could operate with the following workflow:
The following steps are not thread safe and must be performed before any BSL context instances are initialized (in Section 3.2).
BSL_HostDescriptors_t
struct should be set with host-implemented functions and initialized with BSL_HostDescriptors_Set()
for successful BSL operation. See the Mock BPA for a simple example of implementing host descriptors.The following steps contain BSL initialization instructions to be performed once (per-thread). The correct operation relies on the host BPA configuration from Section 3.1 to be in-place.
BSL_LibCtx_t
pointer. Each instance should be initialized using BSL_LibCtx_Init()
.BSL_HostEID_Init()
.BSL_CryptoInit()
. Then, register the BIB-HMAC-SHA2
and BCB-AES-GCM
Default Security Contexts with the Library Context.The following steps should be performed for each bundle being processed, their entity relationships are depicted in Figure 3.1. All of these actions operate within a BSL library context, initialized in Section 3.2.
BSL_BundleCtx_t
.The BSL Frontend API consists of two primary functions for per-bundle operation:
BSL_API_QuerySecurity
covers steps 2 and 3 above. The function first utilizes the policy providers to query on a bundle. Next, each security operation in the resulting Action Set is validated using the security context associated with that security operation.BSL_API_ApplySecurity
covers steps 4 and 5 above. The function first executes each security operation with its associated security context. Next, the policy providers will finalize over the results.Before joining or termination of an associated work thread, each BSL_LibCtx_t
instance should be de-initialized with BSL_LibCtx_Deinit()
to free its resources.
Each BSL Context is independent of all others, so there is no need to coordinate activities of one with any other.
There are two levels of support for the BSL: troubleshooting by a system administrator, which is detailed in Section 4.1, and upstream support via the BSL public GitHub project, accessible as described in Section 4.2. Attempts to troubleshoot should be made before submitting issue tickets to the upstream project.
The following provides troubleshooting guidance for the BSL from the perspective of a normal or administrative user. Each situation consists of an observed state followed by a recommended troubleshooting activity.
My policy rule with many parameters is not initializing | |
Check the policy rule parameter limit that the BSL was compiled with (see | |
The sample policy provider, with already many appended policy rules, is failing to append more policy rules | |
Check the policy rule limit that the BSL was compiled with (see | |
I am using the Mock BPA Host Descriptors, and the BSL fails to add more blocks | |
Check the Mock BPA bundle block count limit that the Mock BPA was compiled with (see | |
I am using the Mock BPA to test my policy rules, but I cannot append more rules | |
Check the Mock BPA policy rule limit that the Mock BPA was compiled with (see | |
My policy rule with a long description or policy provider with a long name is failing to initialize | |
Check the character limit that the BSL was compiled with (see |
The BSL is hosted on a GitHub repository [bsl-source] with submodule references to several other repositories.
There is a CONTRIBUTING.md
document in the BSL repository which describes detailed procedures for submitting tickets to identify defects and suggest enhancements.
Separate from the source for the BSL proper, the BSL Product Guide and User Guide are hosted on a GitHub repository [bsl-docs], with its own CONTRIBUTING.md
document for submitting tickets about either the Product Guide or User Guide.
While the GitHub repositories are the primary means by which users should submit detailed tickets, other inquiries can be made directly via email to the the support address dtnma-support@jhuapl.edu.