Logo van Nftables Allow Source

Nftables Allow Source

Organisatie
SpecterOps
nftables-allow-source

Add a source IP or CIDR to nftables using the working method from this repo session: live top-of-`input` insertion with `nft -a` verification first, then persistent config update and reload.

Add to TypingMind

Overzicht

UitgeverSpecterOps
Repositoryskills
Skillnaamnftables-allow-source
Sterren
706
Forks
80
Meegeleverde bestanden
3
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 3

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door SpecterOps op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Nftables Allow Source in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/SpecterOps/skills/tree/main/plugins/ops-infrastructure/skills/nftables-allow-source
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SpecterOps/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/ops-infrastructure/skills/nftables-allow-source .claude/skills/nftables-allow-source
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Nftables Allow Source in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Nftables Allow Source automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Nftables Allow Source niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Nftables Allow Source

Use this skill to add a source IP or CIDR to nftables using the method that worked in this repo session:

  • inspect the live input chain with nft -a
  • insert a source allow rule at the top of the live input chain
  • verify the live rule immediately
  • add the same source allow rule to /etc/nftables.conf in the input chain
  • reload the ruleset and verify config and live state match

Do not use a config-first workflow here. The working method is live input insertion first, persistence second.

Direct Triggers

Use this skill when the task mentions any of the following:

  • add an nftables allow rule
  • allow inbound from an IP
  • whitelist an IP in nftables
  • add a source address to the firewall
  • insert an nft rule at the top
  • use nft -a handles

Input Contract

Accept input as: HOST SOURCE [MODE]

Mode:

  • plan: produce the command sequence only
  • execute (default): inspect, insert, and verify the live rule

Examples:

  • $nftables-allow-source bastion 203.0.113.42 execute
  • $nftables-allow-source 198.51.100.25 203.0.113.42/32 plan
  • $nftables-allow-source edge-firewall 198.51.100.0/24 execute

Preconditions

  1. Confirm the host is in scope and operator-controlled.
  2. Confirm SSH or console access exists before changing the firewall.
  3. Confirm nft is installed and the host is actually using nftables.
  4. Prefer live insertion into the input chain before any persistent edit.

Execution Workflow

  1. Inspect the live input chain with handles.
bash
sudo nft -a list chain inet filter input

Use this to:

  • confirm the chain exists
  • see current rule order
  • identify whether a matching source rule already exists
  1. Verify whether the source is already allowed.
  • If already present in the live chain, do not insert a duplicate.
  • Record existing handle and position if present.
  1. Insert the allow rule at the top of the live input chain.

Preferred live insertion pattern:

bash
sudo nft insert rule inet filter input position 0 ip saddr <SOURCE> accept

This is the working method and should be preferred over editing /etc/nftables.conf first.

  1. Verify the live input chain immediately.
bash
sudo nft -a list chain inet filter input

Success means the new ip saddr <SOURCE> accept rule appears at the top of the input chain before the rest of the policy logic.

  1. Persist the same rule in /etc/nftables.conf.
  • insert ip saddr <SOURCE> accept comment "Authorized External IP" immediately after:
    • type filter hook input priority filter; policy drop;
  • do not rely on a broad grep for the source IP elsewhere in the file; check the input chain specifically
  • if /etc/nftables.conf is empty or corrupted, restore from the latest backup before editing
  • back up the file before changing it
  1. Reload and verify.
  • reload with:
    • sudo nft -f /etc/nftables.conf
  • verify both:
    • sudo sed -n '/chain input {/,/}/p' /etc/nftables.conf
    • sudo nft -a list chain inet filter input
  • confirm the persistent and live rules both contain the source allow at the top of the input chain

Command Patterns

Live chain inspection

bash
sudo nft -a list chain inet filter input

Live top-of-chain insertion

bash
sudo nft insert rule inet filter input position 0 ip saddr 203.0.113.42 accept

Persistent config backup

bash
sudo cp /etc/nftables.conf /etc/nftables.conf.bak-$(date +%Y%m%d%H%M%S)

Persistent input-chain insertion

bash
sudo sed -i '/type filter hook input priority filter; policy drop;/a\        ip saddr 203.0.113.42 accept comment "Authorized External IP"' /etc/nftables.conf

Persistent config reload

bash
sudo nft -f /etc/nftables.conf

Post-reload verification

bash
sudo sed -n '/chain input {/,/}/p' /etc/nftables.conf
sudo nft -a list chain inet filter input

Prohibited Method

Do not use these approaches as the default workflow for this skill:

  • editing /etc/nftables.conf first and assuming reload will be safe
  • checking only whether the source IP exists somewhere in the file instead of in the input chain
  • adding the exception only to the management chain when the operator wants a host-wide source exception
  • broad text-rewrite methods that can blank or corrupt /etc/nftables.conf

OPSEC Gate

Require explicit operator confirmation before:

  • broad rules such as 0.0.0.0/0
  • wide CIDR additions that materially expand exposure
  • deleting or reordering existing firewall controls
  • reloading or restarting nftables on production-like hosts when access risk is non-trivial

Before requesting approval, include:

  • exact rule change
  • objective
  • expected impact
  • rollback plan
  • possible connectivity risk

Reporting Requirements

For each run, include:

  • target host
  • live chain modified: inet filter input
  • source IP/CIDR added
  • exact commands used
  • pre-change live chain output
  • post-change live chain output
  • persistent input-chain config snippet after edit
  • whether the rule is live only or also persistent
  • any remaining follow-up needed to reconcile config and runtime state

Troubleshooting Note

If a service is still unreachable after the source allow rule is added:

  1. verify the service is actually listening on the destination host
  2. compare reachability of the blocked port against a temporary listener on an alternate port on the same host
  3. if the alternate port succeeds while the original port fails, do not attribute the failure to nftables alone
  4. report that the environment or path may specifically disallow the original port

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Nftables Allow Source?

Add a source IP or CIDR to nftables using the working method from this repo session: live top-of-`input` insertion with `nft -a` verification first, then persistent config update and reload.

Waarom Nftables Allow Source gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Nftables Allow Source bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Nftables Allow Source in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/SpecterOps/skills/tree/main/plugins/ops-infrastructure/skills/nftables-allow-source. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Nftables Allow Source gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Nftables Allow Source gebruiken?

Zoveel als je wilt. Je kunt Nftables Allow Source gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Nftables Allow Source gratis?

Ja. Deze skill is door SpecterOps op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇