Logo de Nftables Allow Source

Nftables Allow Source

Organização
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

Visão geral

Publicado porSpecterOps
Repositórioskills
Nome da habilidadenftables-allow-source
Estrelas
706
Forks
80
Arquivos incluídos
3
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 3

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por SpecterOps no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Nftables Allow Source no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/SpecterOps/skills/tree/main/plugins/ops-infrastructure/skills/nftables-allow-source
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Nftables Allow Source em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Nftables Allow Source automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Nftables Allow Source não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Nftables Allow Source faz?

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.

Por que usar Nftables Allow Source no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Nftables Allow Source é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Nftables Allow Source no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/SpecterOps/skills/tree/main/plugins/ops-infrastructure/skills/nftables-allow-source. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Nftables Allow Source?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Nftables Allow Source?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Nftables Allow Source com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Nftables Allow Source é gratuita?

Sim. A habilidade é publicada no GitHub por SpecterOps sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇