AgentStack
SKILL verified MIT Self-run

Br Network Security

skill-lonsdale201-wp-agent-skills-br-network-security · by Lonsdale201

Use better-route 0.6.0 network security middleware for trusted-proxy client IP resolution and CIDR allowlists. Triggers on TrustedProxyClientIpResolver, ClientIpResolverInterface, CidrMatcher, IpAllowlistMiddleware, CF-Connecting-IP, X-Forwarded-For, REMOTE_ADDR, trusted proxy CIDRs, IP allowlist, webhook IP pinning, or replacing direct forwarded-header reads. Updated 2026-05-02.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-lonsdale201-wp-agent-skills-br-network-security

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Br Network Security? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

better-route: Network security and IP allowlists

Use this when an endpoint depends on client IP, especially behind Cloudflare, nginx, a load balancer, or any reverse proxy. Never read forwarded headers directly in handlers.

Trusted proxy resolver

use BetterRoute\Middleware\Network\TrustedProxyClientIpResolver;

$resolver = new TrustedProxyClientIpResolver(
    trustedProxyCidrs: [
        '10.0.0.0/24',
        '2001:db8:1234::/48',
    ],
    forwardedHeaders: ['CF-Connecting-IP', 'X-Forwarded-For']
);

$ip = $resolver->resolve($request);

Forwarded headers are trusted only when the immediate REMOTE_ADDR matches trustedProxyCidrs.

IP allowlist middleware

use BetterRoute\Middleware\Network\IpAllowlistMiddleware;

$allowlist = new IpAllowlistMiddleware(
    allowedCidrs: ['203.0.113.0/24', '2001:db8:feed::/48'],
    ipResolver: $resolver,
    failClosed: true
);

$router->post('/back-channel/logout', $handler)
    ->middleware([$allowlist])
    ->publicRoute();

Rate limiter integration

RateLimitMiddleware accepts the new ClientIpResolverInterface in 0.6.0:

$rateLimit = new RateLimitMiddleware(
    limiter: $limiter,
    limit: 60,
    windowSeconds: 60,
    clientIpResolver: $resolver
);

Critical rules

  • Single IP strings are accepted as CIDRs (1.2.3.4 behaves like /32, IPv6 like /128).
  • Header order matters; put the most authoritative proxy header first.
  • X-Forwarded-For returns the first valid IP from the comma-delimited list.
  • If IP is unresolvable and failClosed: true, IpAllowlistMiddleware rejects.
  • Keep Cloudflare or provider CIDR lists current; stale proxy ranges cause false denials or unsafe trust.
  • IP allowlists are not a replacement for request authentication when IPs are broad or dynamic; combine with HMAC when needed.

Cross-references

  • Use br-rate-limiting for throttling semantics and fixed-window stores.
  • Use br-hmac-signature for signed requests when IP pinning is too brittle.
  • Use br-audit-enrichment if safe client IP should be added to audit events.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.