Accepting a BCB at one interaction point and sourcing a new BCB over the same target at a different interaction point deletes the bundle
Maintainers usually reply within 6 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with BSL_BundleRefState_RepopulateTgts and trace how it updates the bcb_tgts map when an acceptor removes a BCB result. Then inspect BSL_SecCtx_ValidatePolicyActionSet, which the issue identifies as treating an empty target entry as active. Done means a BCB accepted at CLIN can be replaced at CLOUT and the bundle is forwarded with only the new BCB; tests and a proposed fix are mentioned, and linked pull request #399 is already open.
Written by the indexing model from the issue text.
Description
Description
A policy that accepts a BCB over the payload at CLIN and sources a new BCB
over the payload at CLOUT cannot be applied. The intent is to re-encrypt the
payload while forwarding: decrypt it with the existing BCB when the bundle is
received, then encrypt it again under a new security source when it is sent.
Instead the bundle is deleted at CLOUT. The same happens with APPIN and APPOUT.
This is different from #396, where both operations are at the same interaction
point; the fix proposed for #396 (#397) does not cover this case.
Expected behavior
At CLIN the acceptor decrypts the payload and removes the BCB. At CLOUT the
source operation adds a new BCB over the payload, and the bundle is forwarded
with only the new BCB.
Actual behavior
The acceptor succeeds at CLIN, but at CLOUT validation still finds an existing
BCB over the payload, the action is skipped and the bundle is deleted with
reason code 0:
<INFO> [BCB_AES_GCM.c:108:BSLX_BCB_Decrypt] BCB attempting to decrypt
<INFO> [SamplePolicyProvider.c:467:BSLP_FinalizePolicy] PP FINALIZE: Sec Oper from action 0 at index 0: SUCCESS
<ERROR> [SecurityContext.c:818:BSL_SecCtx_ValidatePolicyActionSet] Cannot add service to target 1 that is already targeted by an existing BCB
<WARNING> [SecurityContext.c:661:BSL_SecCtx_ExecutePolicyActionSet] Skipping security action due to previous BSL validation failure
<INFO> [agent.c:445:MockBPA_DeleteBundle] MockBPA: BSL indicated to delete bundle with reason code 0
The first two lines are from CLIN, the rest from CLOUT.
The cause is in BSL_BundleRefState_RepopulateTgts. When the acceptor strips
the result for the payload, the reference to the BCB is removed from the
payload's entry in bcb_tgts, but the entry itself stays in the map with an
empty set. BSL_SecCtx_ValidatePolicyActionSet only checks whether the target
is present in the map (BSLB_AsbPtrSetMap_cget(...)), so the payload still
counts as a BCB target.
The same pattern with BIBs produces the expected output, because an existing
BIB over the target only causes a non-blocking warning for a BIB source.
Steps to reproduce
With bsl-mock-bpa built from main (ad0cb52), policy (keys from
mock-bpa-test/data/default-scs/keyset-1.json):
{
"policyrule_set": [
{ "policyrule": {
"filter": { "rule_id": "1", "role": "a", "tgt": 1, "loc": "clin", "sc_id": 2 },
"spec": { "svc": "bcb", "sc_id": 2,
"sc_parms": { "key_name": "ExampleA.2", "key_wrap": true } },
"policy_action_on_fail": "delete_bundle" } },
{ "policyrule": {
"filter": { "rule_id": "2", "role": "s", "tgt": 1, "loc": "clout", "sc_id": 2 },
"spec": { "svc": "bcb", "sc_id": 2,
"sc_parms": { "key_name": "ExampleA.2", "aes_variant": 1,
"aad_scope": 0, "key_wrap": true } },
"policy_action_on_fail": "delete_bundle" } }
]
}
Send the RFC 9173 Appendix A.2 bundle (EXAMPLE_A_2_WITH_BCB in
mock-bpa-test/test_default_scs.py) from the underlayer. No bundle is
forwarded, and the log shows the lines above.
Environment
- BSL
mainat ad0cb52 (also reproduced with v2.0.1) - Ubuntu 22.04, gcc 13.4, OpenSSL 3.0.2, Jansson 2.15.1
Proposed fix
I have a fix with tests and can open a pull request: in
BSL_BundleRefState_RepopulateTgts, remove target blocks that no security
block references any more, so that a block is only present in the target maps
while it is actually targeted.
- Dominant language
- C
- Stars
- 16
- Forks
- 11
- Avg merge
- 8d 3h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NASA-AMMOS/BSL
-
Accepting a BCB and sourcing a new BCB over the same target at one interaction point deletes the bundlePossibly taken @pablomadoery claimed this 6 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
NASA-AMMOS/BSL#396 ·
Maintainers usually reply within 6 days
-
sustainment
Difficulty 4/5 3-5 days Newbie friendliness 42/100
NASA-AMMOS/BSL#386 ·
Maintainers usually reply within 6 days
-
sustainment
Difficulty 4/5 3-5 days Newbie friendliness 40/100
NASA-AMMOS/BSL#372 ·
Maintainers usually reply within 6 days
-
Difficulty 3/5 Half a day Newbie friendliness 38/100
NASA-AMMOS/BSL#370 ·
Maintainers usually reply within 6 days
-
sustainment
Difficulty 3/5 Half a day Newbie friendliness 50/100
NASA-AMMOS/BSL#361 · 1 comment ·
Maintainers usually reply within 6 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
c easy first-contributor first-contributors good first issue help wanted up-for-grabs
Difficulty 1/5 1-3 hours Newbie friendliness 96/100
fork-commit-merge/fork-commit-merge#8696 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
libsdl-org/SDL#16873 ·
Maintainers usually reply within 1 day
-
cwc.kbd.xkb_layout/xkb_options changes are not applied to all keyboard groups after reload/runtimeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ionut-mihalache/aqua#31 · 1 comment ·