Avamar:如何在 edit-firewall-rules.sh (7.3 版以上) 新增或移除自訂 Avamar 防火牆規則

Résumé: 本文說明如何使用 edit-firewall-rules.sh 指令檔新增或移除自訂 Avamar 防火牆規則。 這在 Avamar v7.3 及更新版本中提供。

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

在 Avamar v7.3 及更新版本中,有一個工具可供使用者新增或移除自己的自訂 iptables 規則。

特點: 
  • 隨附 v7.3 的標準 Avamar 防火牆 RPM 的一部分。
  • 用戶可以添加或刪除自己的自定義 iptables 規則。
  • 自訂規則可在 Avamar 版本升級後繼續有效。
  • 自訂規則在防火牆套件更新後仍可繼續使用。
下列新檔案會透過 avfwb 安全性 RPM 安裝至系統。檔案位於:/usr/local/avamar/lib/admin/security。
  • edit-firewall-rules.sh
  • manage-custom-rules.sh
  • avfwb_custom_config.txt

edit-firewall-rules.sh:
  • 此檔是一個互動式腳本,它接受使用者輸入並將其格式化為iptables 格式。
  • 該檔以客戶友好的方式列出資訊。
manage-custom-rules.sh:
  • 此檔是 edit-firewall-rules.sh 互動式腳本背後的引擎。
  • 此檔案會根據組態檔案中儲存的自訂規則集建立 iptables 規則和命令。
  • 此檔案會重新啟動 avfirewall 服務以套用新規則。

以 root 使用者身分執行上述指令檔。
以系統管理員使用者身分載入金鑰後,請切換至根使用者並顯示「su -


執行指令檔:
先載入 SSH 金鑰再執行指令檔。  

如果未載入金鑰,腳本在將規則複製到其他節點時可能會失敗。  

如需詳細資訊,請參閱文章「備註」或 Avamar 系統管理指南
 
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.
  • 規則類型:IPv4 或 IPv6。
  • 鏈:輸出、輸入、logdrop 或轉發。
  • 通訊協定:TCP、UDP、ICMP。
  • 來源 IP。
  • 來源連接埠。
  • 目的地 IP。
  • 目的地連接埠。
  • 目標:接受、拒絕、放棄、拒絕。
  • 節點類型:全部,數據,實用程式。
自訂規則以豎 avfwb_custom_config.txt 分隔行的形式儲存在檔中。

格式:
來源 IP |源埠 |目標 IP |目的地連接埠 |協定 |ICMP 類型 |目標 |連鎖 |節點類型

範例:
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

請小心不要建立任何可能影響 Avamar 應用程式功能的防火牆規則。例如,拒絕進出 Avamar 伺服器連接埠的流量。

如需 Avamar 所需連接埠的相關資訊,請參閱最新版本的 Avamar 產品安全性指南

產品安全性指南也有一個類似的非互動式工具「manage-custom-rules.sh」。

如何檢查 SSH 金鑰是否已載入,如果沒有,如何載入。
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.