Avamar: Como adicionar ou remover regras personalizadas de firewall do Avamar com o edit-firewall-rules.sh (v7.3 em diante)

Résumé: Este artigo descreve como adicionar ou remover regras personalizadas de firewall do Avamar usando o script edit-firewall-rules.sh. Ele está disponível no Avamar v7.3 e versões posteriores. ...

Cet article concerne Cet article ne concerne pas Cet article n’est associé à aucun produit spécifique. Toutes les versions du produit ne sont pas identifiées dans cet article.

Instructions

No Avamar v7.3 e posterior, está disponível uma ferramenta que permite aos usuários adicionar ou remover suas próprias regras iptables personalizadas .

Características: 
  • Parte do RPM padrão do firewall do Avamar fornecido com a versão 7.3.
  • Os usuários podem adicionar ou remover suas próprias regras iptables personalizadas .
  • As regras personalizadas sobrevivem aos upgrades de versão do Avamar.
  • As regras personalizadas sobrevivem às atualizações do pacote de firewall.
Os arquivos novos a seguir são instalados nos sistemas pelo RPM de segurança avfwb. Os arquivos estão em: /usr/local/avamar/lib/admin/security.
  • edit-firewall-rules.sh.
  • manage-custom-rules.sh.
  • avfwb_custom_config.txt.

edit-firewall-rules.sh:
  • Este arquivo é um script interativo que recebe a entrada do usuário e formata-o no formato iptables .
  • Este arquivo apresenta informações de maneira amigável.
manage-custom-rules.sh:
  • Esse arquivo é o mecanismo por trás do script interativo edit-firewall-rules.sh .
  • Esse arquivo cria as regras e comandos do iptables que são baseados no conjunto de regras personalizado salvo no arquivo de configuração.
  • Esse arquivo reinicia o serviço avfirewall para aplicar as novas regras.

Execute os scripts acima como usuário root. 
Depois de carregar as chaves como usuário administrador, alterne para o usuário root com "su - "


Running the script:
Load the SSH keys before running the script.  

Se as chaves não forem carregadas, o script poderá falhar quando copiar regras para outros nós.  

Consulte o artigo "notes" ou o Guia de administração do sistema Avamar para obter mais informações.
 
Choose an Action
----------------
1) Add a custom rule
2) Remove a custom rule
3) List Current Custom Rules
4) Exit
5) Save & Exit
Enter desired action:

Add a Custom Rule
The user can make selections for iptables fields to construct the rule they wish to add.
  • Tipo de regra: IPv4 ou IPv6.
  • Cadeia: Output, Input, Logdrop ou Forward.
  • Protocolo: TCP, UDP, ICMP.
  • IP de origem.
  • Porta de origem.
  • IP de destino.
  • Porta de destino.
  • Alvo: Aceitar, rejeitar, descartar, rejeitar.
  • Tipo de nó: todos, dados, utilitários.
As regras personalizadas são armazenadas em avfwb_custom_config.txt arquivo como linhas delimitadas por pipe.

Formato:
IP de origem | Porta de origem | IP de destino | Porto de destino | Protocolo | Tipo ICMP | Alvo | Cadeia | Exemplo de tipo

de nó:
10.10.10.10||10.10.10.11||tcp||ACCEPT|OUTPUT|ALL

Add Rule Example

Select the type of firewall rule to add
Firewall Rule Types
-------------------
1) IPv4 Rule
2) IPv6 Rule
Enter Firewall Rule Type:
Protocol
--------
1) TCP
2) UDP
3) ICMP
Enter Protocol:
Select the desired CHAIN
Firewall Chains
---------------
1) OUTPUT
2) INPUT
3) LOGDROP
4) FORWARD
Select Chain:
Select the Protocol type to be used
Protocol
--------
1) TCP
2) UDP
3) ICMP
Enter Protocol:

Enter source IP (leave blank for none):
Enter source port (leave blank for none):
Enter destination IP (leave blank for none):
Enter destination port (leave blank for none):
Select the desired target action
Targets
-------
1) ACCEPT
2) REJECT
3) DROP
4) LOGDROP
Select Target:

Select which type of node this new rule will be applied to
Node Types
----------
1) ALL
2) DATA
3) UTILITY
Select node type to apply rule to:

The script will ask you to confirm that you want to add the new rule to the avfwb_custom_config.txt file
Add rule ||||tcp||ACCEPT|OUTPUT|ALL to file? (Y/N): y
Adding ||||tcp||ACCEPT|OUTPUT|ALL to file...

The script asks if you wish to add another rule or return to the main menu
Add another rule? (Y/N):
Return to main menu? (Y/N):

Saving and applying rules
Choose an Action
----------------
1) Add a custom rule
2) Remove a custom rule
3) List Current Custom Rules
4) Exit
5) Save & Exit
Enter desired action: 5

Rules have been saved to /usr/local/avamar/lib/admin/security/avfwb_custom_config.txt
Save and execute rules now? (Y/N):

Choosing Y when asked to save and execute will propagate the config file to all 
nodes, applies the rules accordingly and restarts the avfirewall service.

kA5j00000008VAYCA2_1_0

Removing a rule 
 Choose an Action
----------------
1) Add a custom rule
2) Remove a custom rule
3) List Current Custom Rules
4) Exit
5) Save & Exit
Enter desired action: 2

kA5j00000008VAYCA2_1_1
Select the rule to remove.  The script will confirm "Line xxx has been removed from configuration file"

Return to the main menu.  If we select option 3 "List Current Custom Rules" we will see the list of rules and a list of 'Changes Pending'.

kA5j00000008VAYCA2_1_2

Pending changes will be executed when exiting the script and selecting Y to "Save and execute rules now".
 Rules have been saved to /usr/local/avamar/lib/admin/security/avfwb_custom_config.txt
Save and execute rules now? (Y/N):

Informations supplémentaires

Tenha cuidado para não criar regras de firewall que possam afetar a funcionalidade do aplicativo Avamar. Por exemplo, Rejeitando o tráfego de ou para uma porta do servidor Avamar.

Consulte a versão mais recente do Guia de segurança do produto Avamar para obter informações sobre as portas necessárias do Avamar.

O Guia de segurança do produto também tem uma ferramenta semelhante "manage-custom-rules.sh", que não é interativa.

Como verificar se as chaves SSH estão carregadas e, se não, como carregá-las.
admin@util:~/>: ssh-add -l
Could not open a connection to your authentication agent.   <-- keys not loaded
admin@util:~/>: ssh-agent bash
admin@util:~/>: ssh-add ~/.ssh/dpnid
Identity added: .ssh/dpnid (.ssh/dpnid)
admin@util:~/>: ssh-add -l
1024 1b:af:88:95:7a:d8:a9:16:fb:cb:9e:0e:49:32:a3:cd [MD5] .ssh/dpnid (DSA)  <-- keys loaded 

Produits concernés

Avamar

Produits

Avamar, Avamar Server
Propriétés de l’article
Numéro d’article: 000019911
Type d’article: How To
Dernière modification: 03 avr. 2025
Version:  8
Trouvez des réponses à vos questions auprès d’autres utilisateurs Dell
Services de support
Vérifiez si votre appareil est couvert par les services de support.