Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

client: AddRule/RevokeRule drop unreadable rules and dedup ignores ArgumentConstraints

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend, security

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

bug

Problem

Two related rule-handling gaps in packages/core/client/resources_policy.go:

  1. :297 — AddRule/RevokeRule silently 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.
  2. :185 — the deduplication logic used when adding rules compares rules without considering ArgumentConstraints, 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

  1. Insert one malformed rule entry into the rule set, then call AddRule or RevokeRule for an unrelated rule; observe other valid rules are missing from the rewritten set.
  2. Add two rules identical in every field except ArgumentConstraints and 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from solongate/agent-security

All issues in solongate/agent-security

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.