Skip to content

fix: unbounded pending queue + non-idempotent iptables rules #13

Description

Summary

Several unbounded data structures and non-idempotent operations could lead to resource exhaustion:

  1. Pending approvals queue unbounded (blocklist.rs:56) — pending_approvals: Vec has no size limit. A noisy agent spamming egress fetch with random URLs could exhaust router memory.

  2. iptables rules not idempotent (entrypoint.sh:44-65, reconciler.rs:666-700) — rules are appended without checking for duplicates. Pod restarts accumulate duplicate rules, degrading network performance.

Proposed Fixes

Bounded queue:

const MAX_PENDING: usize = 1000;
if pending.len() >= MAX_PENDING {
    return Err("Pending approval queue full");
}

Idempotent iptables:

# In egress-guard init container:
iptables -F OUTPUT 2>/dev/null || true  # Flush existing rules
iptables -A OUTPUT ...                   # Apply fresh

AGT's resource quota policy engine can enforce configurable limits on all bounded resources.

References

  • blocklist.rs line 56
  • entrypoint.sh lines 44-65
  • reconciler.rs lines 666-700

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions