panels: rule match editor collapses Allowed/Denied lists and ignores RootDirectory when flagging blanket rules
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start by reading policies_rule.go around lines 110 and 236, then trace how the rule match editor stores Allowed and Denied values and how the policy engine determines effective scope. Reproduce both cases with a rule containing entries in both lists and with a specific RootDirectory. Done when editing either list preserves the other and the blanket warning reflects the rule's effective scope.
Written by the indexing model from the issue text.
Description
Problem
Two related issues in packages/tui/panels:
policies_rule.go:110— the match editor's rendering/editing logic for a rule's Allowed and Denied value lists shares state in a way that collapses them into a single effective list when editing, so changes meant for one list can overwrite or merge into the other.policies_rule.go:236— the guard that warns the user they are about to save an overly broad "blanket" rule checks only the Allowed/Denied selectors and does not takeRootDirectoryinto account, so a rule that is actually meaningfully scoped byRootDirectoryis incorrectly flagged as blanket, while conversely a rule with an unsetRootDirectorythat should be flagged may not be, if the logic's omission cuts both ways depending on implementation.
Impact
The collapsed Allowed/Denied editing state can cause a user to unintentionally corrupt one list while editing the other, resulting in a saved rule that doesn't match what was intended. The blanket-rule warning being blind to RootDirectory either produces false-positive warnings that train users to ignore the warning, or misses genuinely overly broad rules, in either case undermining the warning's usefulness as a safety check before saving a rule.
Repro
- Open the rule match editor for a rule with both Allowed and Denied entries, edit the Allowed list, save, and observe the Denied list has been altered/collapsed as a side effect.
- Create a rule with a narrow
RootDirectorybut broad Allowed/Denied selectors (or vice versa) and observe the blanket-rule warning's determination does not reflect the actual effective scope onceRootDirectoryis considered.
Suggested fix
Give the Allowed and Denied lists independent editing state in the match editor (e.g. separate backing fields/widgets) so editing one cannot bleed into the other. Extend the blanket-rule check to factor in RootDirectory: a rule scoped to a specific, non-root directory should not be flagged as blanket purely based on its Allowed/Denied selectors, and the check should use the same effective-scope logic the policy engine itself uses when deciding how broad a rule actually is.
- Dominant language
- Go
- Stars
- 157
- Forks
- 19
- Avg merge
- 4h 4m
- Merged PRs (30d)
- 81
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 solongate/agent-security
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
solongate/agent-security#154 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
solongate/agent-security#147 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
solongate/agent-security#143 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
solongate/agent-security#142 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
solongate/agent-security#140 ·
Maintainers usually reply within 1 day
All issues in solongate/agent-security
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
yetone/magpie#4095 · 1 comment ·
Maintainers usually reply within 1 day
-
docs: Google Safe Browsing flags go-bonnie.dev as "deceptive" (pipe-to-shell install instructions)Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
[Bug]: Telegram bot (v3.11.0): "Ban log" no longer sends the current 3xipl-banned.logPossibly taken @HamedSanaei claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
MHSanaei/3x-ui#6990 · 1 comment ·
Maintainers usually reply within 3 days
-
bug(tool/internal/instrument): identical inject_code rules from two rule packages are applied twiceOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-go-compile-instrumentation#1611 ·
Maintainers usually reply within 2 days