「Avamar:edit-firewall-rules.sh を使用してカスタムAvamarファイアウォール ルールを追加または削除する方法(v7.3以降)

概要: この記事では、edit-firewall-rules.sh スクリプトを使用してカスタムAvamarファイアウォール ルールを追加または削除する方法について説明します。 これは、Avamar v7.3以降で使用できます。

この記事は次に適用されます: この記事は次には適用されません: この記事は、特定の製品に関連付けられていません。 すべての製品パージョンがこの記事に記載されているわけではありません。

手順

Avamar v7.3以降では、ユーザーが独自のカスタム iptables ルールを追加または削除できるツールを使用できます。

機能: 
  • v7.3に同梱されている標準のAvamarファイアウォールRPMの一部。
  • ユーザーは、独自のカスタム iptables ルールを追加または削除できます。
  • カスタム ルールは、Avamarバージョンのアップグレード後も維持されます。
  • カスタム ルールは、ファイアウォール パッケージの更新後も存続します。
次の新しいファイルは、 avfwb security 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 - "


Running the script:スクリプトを実行する前にSSHキーをロードする」
を使用してrootユーザーに切り替えます。  

キーがロードされていない場合、スクリプトはルールを他のノードにコピーするときに失敗する可能性があります。  

詳細については、記事「メモ」または 『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。
  • チェーン:Output、Input、Logdrop、または Forward。
  • [Protocol]:TCP、UDP、ICMP。
  • 送信元IP。
  • 送信元ポート。
  • 宛先IP。
  • 宛先ポート。
  • Target:[Accept]、[Reject]、[Drop]、[Reject]。
  • ノード タイプ: すべて、データ、ユーティリティ。
カスタム ルールは 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):

その他の情報

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 

対象製品

Avamar

製品

Avamar, Avamar Server
文書のプロパティ
文書番号: 000019911
文書の種類: How To
最終更新: 03 4月 2025
バージョン:  8
質問に対する他のDellユーザーからの回答を見つける
サポート サービス
お使いのデバイスがサポート サービスの対象かどうかを確認してください。