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 Product Guide provides architectural and maintenance details about 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 technical details about the BSL installation, upgrade, monitoring, and maintenance. For details about the logical structure, workflows, and application programming interface (API) of the BSL see the BSL User Guide.
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 Architecture Description Document (ADD) | DOC-005089 |
BSL Software Requirements Document (SRD) | |
BSL Software Interface Specification (SIS) | |
BSL User 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®) | |
Security Requirements for Cryptographic Modules | |
Using SELinux | |
Packaging and distributing software | |
Fedora Packaging Guidelines | |
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 | |
CMake Reference Documentation | |
The Ninja build system | |
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 purposefully designed to be a software library independent of any specific Bundle Protocol Agent (BPA) implementation and runtime environment. It is intended to be linked to and used by a BPA during runtime to process BPSec security blocks according to local security policy.
The location of the BSL as a subsystem within a BP Node, operated by a BPA is shown in Figure 1.1. The interactions between the BSL and BPA are twofold: calls into the BSL to provide its security services, and calls from BSL into the BPA to provide agent, bundle, and block data and metadata.
Additionally, BSL security services are needed at four distinct points during bundle processing procedures within the BPA. These are depicted in Figure 1.2 and correspond to the following
![]() |
The BSL source is separated into several different components, each of which is explained in detail in the inline API Documentation BSL API Docs. A summary of the components is below.
These components are represented as targets (libraries and executables) in the diagram of Figure 1.3, which was auto-generated from the BSL CMake project.
The basic requirements in the BSL SRD are that the build environment use a C compiler, with its standard headers and libraries [C99], and include POSIX headers and libraries [POSIX].
The BSL dynamic backend uses the [MLIB] library for heap-allocated data containers, including dynamic arrays, linked lists, sorted trees, and hash maps. The BSL backend uses the [QCBOR] library for encoding and decoding of ASB sequences within security blocks.
The example ION-heritage policy provider distributed with the BSL uses the [Jansson] library for JSON parsing.
The example security contexts distributed with the BSL uses the [OpenSSL] library for all cryptographic functions.
The Mock BPA distributed with the BSL uses POSIX UDP/IP sockets for BPv7 PDU transport, both as a test CLA and a test application interface.
This allows traffic into and out of the Mock BPA to be captured by tools such as pcap
and inspected with tools such as Wireshark and tshark
[wireshark].
The Mock BPA also uses [QCBOR] for encoding and decoding of whole bundle PDUs, as well as the [Jansson] library for decoding JWK key stores.
Unit tests for each of the BSL components use the [unity-test] library for defining test fixtures and assertion logic.
The entire BSL repository tree is managed using the [CMake] tool and by default is configured to use the [Ninja] build tool. The official releases of the BSL use default CMake options, but developers can use other options as described in Section 2.4.1.
The official releases of the BSL are packaged and distributed as RPM packages intended to be usable within a YUM/DNF repository [rhel9-packaging]. Packages are version marked based on the latest git tag in the working copy’s commit history and revision marked based on the specific latest git commit hash of the working copy along with the distribution tag (see the "Versioning" and "Dist Tag" sections of [fedora-packaging]).
For example, a pre-release build of the BSL is marked with RPM version-revision of 0.0.0-0.g71ab437.el9
indicating it does not follow a release version tag (so gets marked with version 0.0.0
), it is zero commits from that (non-)tag, it is from commit hash 71ab437
, and it was built on RHEL-9 (or equivalent).
BSL packages can also built from the source tree, either under RHEL-9 directly or using a (Docker or Podman) container to provide an RHEL-9 environment. Details on these procedures are provided in Section 2.1.
The set of packages for each BSL release (or local package build) contains the following:
bsl
/usr/lib64/
.bsl-devel
/usr/include/
and /usr/lib64/
.bsl-apidoc
/usr/share/doc/bsl/
, which contains an html
directory.bsl-debuginfo
bsl
package.
This relies on bsl-debugsource
for tracing to individual source lines for interactive debugging.bsl-debugsource
*-debuginfo
packages to support interactive debugging.bsl-test
/usr/bin/
, containing the bsl-mock-bpa
executable, /usr/lib64/
for its libraries, and /usr/libexec/bsl/
which contains each unit test executable for the BSL.bsl-test-devel
/usr/include/
and /usr/lib64/
.bsl-test-debuginfo
bsl-test
package.
This relies on bsl-debugsource
for tracing to individual source lines for interactive debugging.The BSL itself does not require any specific input or configuration files for its normal operation. It relies on the host BPA to perform any configuration file management, loading, parsing, etc..
As a Linux shared library, it does relate to the host file system in the following paths:
/usr/lib64/
/usr/include/
bsl
sub-directory, and its inbuilt (non-OS) dependencies under QCBOR
and m-lib
sub-directories./usr/bin/
bsl-mock-bpa
here./usr/libexec/
bsl
sub-directory.The BSL itself does not require any specific OS networking configuration or API interfaces. It relies on the host BPA to perform any network configuration or runtime use.
The Mock BPA distributed with the BSL uses UDP/IP sockets, configured by command-line options, to communicate bundles into and out of the Mock BPA process (see Section 2.5).
The BSL itself does not require any specific OS or middleware cryptographic functions.
The example implementation of the default security contexts distributed with the BSL uses the [OpenSSL] library for performing all cryptographic functions.
This chapter includes specific procedures related to managing an BSL deployment from source and for development of BSL changes.
The BSL source is composed of a top-level repository BSL
[bsl-source] and a number of submodule repositories; all of them are required for building the BSL.
The following procedure is targeted for the RHEL-9 environment.
Other conditions and procedures are discussed in more detail in the source repository README.md
document.
The top-level checkout can be done with:
git clone --recursive --branch <TAGNAME> https://github.com/NASA-AMMOS/BSL.git
Optional: switching to a different tag or branch can be done with the sequence:
git checkout <TAGNAME> git submodule update --init --recursive
If necessary, dependency OS packages can be installed with:
sudo dnf install -y epel-release sudo crb enable sudo dnf install -y \ rsync cmake git ninja-build gcc ruby \ openssl-devel jansson-devel \ doxygen graphviz plantuml texlive-bibtex \ asciidoctor \ rpm-build rpmlint
The packages `doxygen graphviz plantuml texlive-bibtex asciidoctor` are optional, and used only for the `bsl-docs` subpackage. . The BSL CMake project is configured with:
./build.sh rpm-prep
The BSL packages are then built with:
./build.sh rpm-build
The resulting packages can be seen by the listing:
find build/default/pkg/rpmbuild -name '*.rpm'
Optionally: A check and test install of the packages can be performed using:
./build.sh rpm-check
Once packages are built locally, they can all be installed by running:
pushd build/default/pkg/rpmbuild/RPMS/x86_64 dnf install -y bsl-*.rpm popd
Or by some more discriminate choice of packages, such as only the two necessary to integrate the BSL library: bsl bsl-devel
Or if pre-built packages are available on an enabled YUM/DNF repository, they can be installed (more simply by name) using:
dnf install -y bsl bsl-devel
Once installed, the BSL library can be linked with and built against as any other OS-installed C library.
Because the BSL is deployed in an RPM package form, the normal operating system tools and procedures for dealing with software library upgrading apply to the BSL. The BSL provides SOVERSION information in its libraries, so RPM management tools such as DNF which are cross-dependence-aware will ensure that the correct needed SOVERSION of the BSL is installed.
Individual BSL releases may identify pre-upgrade or post-upgrade steps in their specific Release Description Document (RDD) which would augment this OS-standard procedure.
When modifying the BSL itself (or one of its example Policy Provider or Security Context implementations or the Mock BPA) a more varied set of procedures is necessary, because RPM packages are not used as intermediate forms because of the time and resources it takes to build them and the separation they then have from the original BSL sources.
The BSL CMake Project has several options to control what and how the components of the project are build, tested, and installed.
Some built-in CMake options which are useful for development are:
CMAKE_PREFIX_PATH
CMAKE_INSTALL_PREFIX
CMAKE_BUILD_TYPE
BUILD_SHARED_LIBS
The BSL-specific options (defined at the top of the root CMakeLists.txt
) are:
BUILD_LIB
BUILD_DOCS_API
BUILD_DOCS_MAN
BUILD_MOCK_BPA
BUILD_UNITTEST
TEST_MEMCHECK
BUILD_COVERAGE
BUILD_FUZZING
BUILD_PACKAGE
The coarse-grained procedure for building and testing the BSL locally is the following, based on a working copy of the BSL repository and starting shell commands within that working copy root directory.
Build the local dependencies an install into the local target tree ./testroot/
using:
./build.sh deps
Prepare the CMake project, with optional additional options, using:
./build.sh prep -DBUILD_COVERAGE=ON
Build the artifacts into the out-of-source tree ./build/default/
using:
./build.sh
Install artifacts into the local target tree ./testroot
using:
./build.sh install
Optionally, execute registered unit tests using:
./build.sh check
If BSL sources are updated and need re-testing, they must be built-and-installed using:
./build.sh && ./build.sh install
Optionally, execute Mock BPA built-item tests using the following sub-procedure.
Install and enter a local Python virtualenv using:
python3 -m venv venv source venv/bin/activate pip install -r mock-bpa-test/requirements.txt
Run the test suite using:
python3 -m pytest mock-bpa-test --log-cli-level=info
If BSL sources are updated and need re-testing, they must be built-and-installed using:
./build.sh && ./build.sh install
Leave the virtualenv using:
deactivate
Collect and report on coverage metrics using:
./build.sh coverage ./build.sh coverage-summary
The coverage outputs under the build tree can be viewed in a Web Browser using:
xdg-open build/default/coverage-html/index.html
The full API documentation can be built and edited locally using the following procedure.
Build the local dependencies (the same as a normal build) using:
./build.sh deps
Prepare the CMake project, with options to enable API documentation building, using:
./build.sh prep -DBUILD_DOCS_API=ON
Build the documentation itself, observing warnings, using:
./build.sh docs
The documentation outputs under the build tree can be viewed in a Web Browser using:
xdg-open build/default/docs/api/html/index.html
The BSL itself, as a software library, does not directly make use of any OS-level logging or monitoring facilities.
As discussed more in the BPA integration portion of the BSL User Guide, one form of monitoring output from the BSL is its log events and another form is polling for BSL telemetry counters.
Because the Mock BPA uses "normal" BPv7/UDPCL it can be monitored using off-the-shelf Wireshark since version 4.0 [wireshark] with the protocols "BPv7" and "UDPCL" enabled, and the appropriate UDP ports used by the Mock BPA set to "Decode As…" the UDPCL.
The procedures in this section are a summary of more detail provided in Chapter 5 of the RedHat [rhel9-selinux] document.
By default, the setroubleshootd
service is running, which intercepts SELinux audit events
To observe the system audit log in a formatted way run:
sudo sealert -l '*'
Some SELinux denials are marked as "don’t audit" which suppresses normal audit logging when they occur.
They are often associated with network access requests which would flood an audit log if they happen often and repeatedly.
To enable logging of dontaudit
events run:
sudo semanage dontaudit off
The effect of FIPS-140 enforcement and denied behavior appear as 'normal' failures of the corresponding cryptographic API and must be observed from logs of the BSL or of the cryptographic library itself. Because the BSL operates as a library, its logging is routed through the callback API to its host application (i.e. the BPA). Determining how to access the host application logs is outside the scope of this guide.
The BSL packaging procedure includes built unit tests within the bsl-test
RPM package which allows executing unit tests on the BSL library after build time on any other host.
The bsl-mock-bpa
executable distributed as part of that package also enables verification of the installed BSL libraries using an example policy provider and example security contexts and real BPv7 PDUs exchanged via UDP sockets (equivalent to the un-framed transfer of the UDPCL).
All other checkout of the BSL requires a specific BPA integration in order to exercise its service interface from a running BPA instance.
There are two levels of support for the BSL: troubleshooting by a system administrator, which is detailed in Section 3.1, and upstream support via the BSL public GitHub project, accessible as described in Section 3.2. Attempts to troubleshoot should be made before submitting issue tickets to the upstream project.
The following situations provide troubleshooting guidance for the BSL from the perspective of a package maintainer or BSL developer, typically working from a local clone of the BSL git repository. Each situation consists of an observed state followed by a recommended troubleshooting activity.
This section covers issues that can occur during packaging (see Section 2.1) or during development (see Section 2.4) of the BSL.
Portions of the CMake project are giving errors during preparation | |
It is important that all CMake options (see Section 2.4.1) given at prep time are consistent. When the same option is supplied on the command multiple times, the last value is the one actually used. | |
Mock BPA tests are failing inconsistently or due to symbol errors | |
Before running Mock BPA tests, the built artifacts must be installed to the | |
The API documentation target complains about misspellings | |
If it is a false positive (the word is correctly spelled, just not in the current dictionary) edit the file |
This section covers issues that can occur during installation (see Section 2.2) of the BSL.
Permission is denied by YUM/DNF to install packages | |
Because the RPM packages are installed to the OS, their use requires privileged user account or the use of |
This section covers issues that can occur after successful installation (see Section 2.2) and checkout (see Section 2.6) of the BSL.
Behavior is reported or suspected to be blocked by SELinux | |
If there is any behavior of the BSL not working correctly and there is suspicion that it is being blocked because of local SELinux policy, the procedures of Section 2.5.1 should be used to troubleshoot. | |
Behavior is reported or suspected to be blocked by FIPS-140 enforcement | |
The example security contexts maintained as part of the BSL make use of a FIPS-approved version of OpenSSL with algorithms and security parameters also compliant with FIPS-140. So these default security contexts should not run afoul of any blocks caused by enabling "FIPS mode" on the host OS. Any additional security contexts registered with a specific BSL instance may not be FIPS-140 compliant and should be carefully considered before use in an expected FIPS-enabled environment. |
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.