Accepting a BCB and sourcing a new BCB over the same target at one interaction point deletes the bundle
メンテナーはふだん 6 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with BSL_SecCtx_ValidatePolicyActionSet and BSLP_QueryPolicy, the two entry points named in the issue, and trace how acceptor and source operations on the same target are validated and classified. Review the related tests, including mock-bpa-test/test_default_scs.py and EXAMPLE_A_2_WITH_BCB; done means the BCB acceptor followed by a source forwards the bundle with only the new BCB, with same-role duplicates still handled correctly. An open linked pull request already covers this work.
索引モデルが issue の本文から書いたものです。
説明
Description
A policy with two rules at the same location, a BCB acceptor and then a BCB
source, both over the payload block, cannot be applied. The intent is to
re-encrypt the payload at that point: decrypt it with the existing BCB, then
encrypt it again under a new security source and key. Instead the bundle is
deleted.
Expected behavior
The acceptor removes the existing BCB and decrypts the payload, then the source
operation adds a new BCB over the payload. The bundle continues with only the
new BCB.
Actual behavior
Validation of the action set rejects the source operation because the payload
is still covered by the existing BCB when the set is validated, before the
acceptor has run. The whole action is skipped and the bundle is deleted with
reason code 0:
<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
<INFO> [SamplePolicyProvider.c:472:BSLP_FinalizePolicy] PP FINALIZE: Sec Oper from action 0 at index 1: INVALID
There is a second, related cause in the sample policy provider:
BSLP_QueryPolicy marks the second of two operations of the same service on
the same target as BSL_SECOP_CONCLUSION_INVALID, without looking at their
roles, so an acceptor followed by a source is treated like a duplicate rule.
The same pattern with BIBs (accept an existing BIB and source a new one at the
same location) currently produces the expected output, but only because the
INVALID conclusion set during the query is overwritten when the operation is
executed.
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": "clout", "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 (the code involved is the same in v2.0.1) - Ubuntu 24.04, gcc 13, OpenSSL 3.0.13, Jansson 2.14
Proposed fix
I have a fix with tests and can open a pull request:
- In
BSL_SecCtx_ValidatePolicyActionSet, while validating the operations of
an action in order, keep the set of targets released by acceptor operations
and do not count their existing BIB/BCB against a later source operation on
the same target. - In
BSLP_QueryPolicy, only mark same-service operations on one target as
duplicates when they have the same role.
- 主要言語
- C
- スター
- 16
- フォーク
- 11
- 平均マージ
- 8日 3時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NASA-AMMOS/BSL のほかの issue
-
Accepting a BCB at one interaction point and sourcing a new BCB over the same target at a different interaction point deletes the bundle対応中かも @pablomadoery が 6 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
NASA-AMMOS/BSL#398 ·
メンテナーはふだん 6 日以内に返信
-
sustainment
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
NASA-AMMOS/BSL#386 ·
メンテナーはふだん 6 日以内に返信
-
sustainment
難易度 4/5 3〜5日 初心者へのやさしさ 40/100
NASA-AMMOS/BSL#372 ·
メンテナーはふだん 6 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 38/100
NASA-AMMOS/BSL#370 ·
メンテナーはふだん 6 日以内に返信
-
sustainment
難易度 3/5 半日 初心者へのやさしさ 50/100
NASA-AMMOS/BSL#361 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
FreeRTOS/FreeRTOS-Plus-TCP#1395 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
qoretechnologies/qore#8222 ·
メンテナーはふだん 1 日以内に返信
-
c easy first-contributor first-contributors good first issue help wanted up-for-grabs
難易度 1/5 1〜3時間 初心者へのやさしさ 96/100
fork-commit-merge/fork-commit-merge#8696 ·
メンテナーはふだん 1 日以内に返信