client: AddRule/RevokeRule drop unreadable rules and dedup ignores ArgumentConstraints
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start with core/client/resources_policy.go at the rewrite loop around line 297 and the deduplication logic around line 185. Trace how rule entries are parsed and compared, then check for existing tests covering malformed entries and ArgumentConstraints. Done means unreadable entries are preserved or reported, distinct constraints remain distinct, and the related tests pass.
Written by the indexing model from the issue text.
Description
Problem
Two related rule-handling gaps in packages/core/client/resources_policy.go:
:297—AddRule/RevokeRulesilently drop any existing rule entry that fails to parse/read correctly while rewriting the rule set, rather than preserving it or surfacing an error, meaning a single malformed rule causes silent data loss of unrelated rules processed alongside it.:185— the deduplication logic used when adding rules compares rules without consideringArgumentConstraints, so two rules that are identical except for their argument constraints are treated as duplicates and one is discarded, losing a materially different rule.
Impact
A malformed rule entry anywhere in the rule set can cause other, valid rules to be silently dropped during an unrelated add/revoke operation. Separately, legitimately distinct rules that differ only in their argument constraints can be collapsed into one, silently narrowing the effective policy.
Repro
- Insert one malformed rule entry into the rule set, then call
AddRuleorRevokeRulefor an unrelated rule; observe other valid rules are missing from the rewritten set. - Add two rules identical in every field except
ArgumentConstraintsand observe only one survives the dedup step.
Suggested fix
Change the rewrite loop in AddRule/RevokeRule to preserve any rule entry it cannot fully parse (round-tripping its raw form unchanged) rather than dropping it, and surface a warning/error for the operator to investigate. Extend the dedup comparison to include ArgumentConstraints as part of rule identity, so rules differing only there are kept as distinct entries.
- Dominant language
- Go
- Stars
- 157
- Forks
- 19
- Avg merge
- 4h 28m
- Merged PRs (30d)
- 88
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
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
solongate/agent-security#227 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
solongate/agent-security#226 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
solongate/agent-security#225 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
solongate/agent-security#224 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
solongate/agent-security#223 ·
Maintainers usually reply within 1 day
All issues in solongate/agent-security
Similar issues
-
agent-butler-finding bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jordansmall/spindrift#6161 ·
Maintainers usually reply within 1 day
-
C-bug O-community X-blathers-untriaged
Difficulty 1/5 Under an hour Newbie friendliness 84/100
cockroachdb/cockroach#176210 · 1 comment ·
-
VLAgent `spec.k8sCollector.includePodLabels: false` has no effectPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
VictoriaMetrics/operator#2772 ·
Maintainers usually reply within 1 day
-
refactor Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OpenNSW/nsw-srilanka#969 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Gaurav-Gosain/tuios#1316 ·
Maintainers usually reply within 1 day