Logo von Nftables Allow Source

Nftables Allow Source

Organisation
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

Übersicht

HerausgeberSpecterOps
Repositoryskills
Skill-Namenftables-allow-source
Sterne
706
Forks
80
Mitgelieferte Dateien
3
LizenzApache-2.0
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 3

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von SpecterOps auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Nftables Allow Source in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/SpecterOps/skills/tree/main/plugins/ops-infrastructure/skills/nftables-allow-source
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Nftables Allow Source in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Nftables Allow Source automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Nftables Allow Source nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-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.

Warum Nftables Allow Source in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Nftables Allow Source besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Nftables Allow Source in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/SpecterOps/skills/tree/main/plugins/ops-infrastructure/skills/nftables-allow-source ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Nftables Allow Source nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Nftables Allow Source verwenden?

So viele Sie möchten. In TypingMind können Sie Nftables Allow Source mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Nftables Allow Source kostenlos?

Ja. Der Skill wird von SpecterOps auf GitHub unter der Lizenz Apache-2.0 veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇