Accepting a BCB at one interaction point and sourcing a new BCB over the same target at a different interaction point deletes the bundle
I maintainer di solito rispondono entro 6 giorni
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C
- Stelle
- 16
- Fork
- 11
- Merge medio
- 8g 3h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NASA-AMMOS/BSL
-
Accepting a BCB and sourcing a new BCB over the same target at one interaction point deletes the bundleForse già presa @pablomadoery l’ha presa 6 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
NASA-AMMOS/BSL#396 ·
I maintainer di solito rispondono entro 6 giorni
-
sustainment
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
NASA-AMMOS/BSL#386 ·
I maintainer di solito rispondono entro 6 giorni
-
sustainment
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
NASA-AMMOS/BSL#372 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 38/100
NASA-AMMOS/BSL#370 ·
I maintainer di solito rispondono entro 6 giorni
-
sustainment
Difficoltà 3/5 Mezza giornata Idoneità per principianti 50/100
NASA-AMMOS/BSL#361 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di NASA-AMMOS/BSL
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 63/100
FreeRTOS/FreeRTOS-Plus-TCP#1395 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
qoretechnologies/qore#8222 ·
I maintainer di solito rispondono entro 1 giorno
-
c easy first-contributor first-contributors good first issue help wanted up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 96/100
fork-commit-merge/fork-commit-merge#8696 ·
I maintainer di solito rispondono entro 1 giorno