My Home NW Lab

逸般の誤家庭のネットワーク

CML-P上にMerakiのPythonスクリプト開発環境を用意

MerakiPythonスクリプト開発環境をCML-Pで準備するためのメモ書きです。 手っ取り早さを意識して細かいチューニングは避けるようにしています。

構成

  • CML-P上でのネットワーク構成は、NAT設定のExternal Connectorの配下にUbuntuを直接繋げる想定にしております。結線ポートの組み合わせはデフォルトのままにしております。UbuntuIPアドレスはExternal ConnectorからDHCPで払い出されます。

MerakiPythonスクリプト開発環境 on CML-P

CML-P上の構成

  • 実行環境はUbuntuとして、External ConnectorでMeraki Cloudへの疎通性を確保します。

  • ネットワークの個別設定が発生すると手間がかかるので、External Connectorはデフォルト値の NAT 設定のままにします。

  • NAT配下に実行環境のUbuntuが存在するようになっており、外部ネットワークからのSSHはできなくなります。そのため、CML-PのCONSOLEから操作を行う方針になります。

Ubuntuのログイン情報

CML-Pで予め用意されているUbuntuでは、デフォルトのログイン情報がUsernameとPasswordともに cisco となります。

項目
Username cisco
Password cisco

検証当時の環境情報

cisco@ubuntu:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
cisco@ubuntu:~$ 
cisco@ubuntu:~$ python3 --version
Python 3.8.10
cisco@ubuntu:~$ 

設定作業

MerakiPythonスクリプト開発環境をUbuntu上に用意していきます。

作業ディレクトリの作成

Pythonスクリプトを配置するディレクトリを作成します。 他の環境での構築時にコマンドが流用しやすいように、カレント ディレクトリの確認作業を意図的に入れています。

pwd

mkdir ./work_dir/

cd ./work_dir/

pwd

Python Libraryの準備

Meraki Dashboard API Python Libraryを導入します。

github.com

pypi.org

CML-P上のNodeの場合は作業環境を占有できると思いますが、他の環境での構築時にコマンドが流用しやすいように venv を用いるようにしています。

sudo apt -y update

sudo apt -y install python3-venv

python3 -m venv .venv

source .venv/bin/activate

pip install --upgrade pip

pip install meraki

サンプル スクリプト

Merakiアカウントに紐付くOrganizationを取得する参照系のサンプル スクリプトです。 開発環境の動作確認用に適宜活用してください。

cat > ./get_meraki_orgs.py << EOF
#!/usr/bin/env python3

import meraki
import pprint

dashboard = meraki.DashboardAPI(print_console=False, output_log=False)

orgs = dashboard.organizations.getOrganizations()

org_list = []

for org in orgs:
    org_list.append(org['name'])

org_list.sort()

pprint.pprint(org_list)

EOF

サンプル スクリプトの内容がファイルに書き込めているか確認します。

cat ./get_meraki_orgs.py 

サンプル スクリプトに実行権限を与えます。

chmod u+x ./get_meraki_orgs.py

サンプル スクリプトの実行にあたってMeraki Dashboard API Keyを変数に指定します。YOUR_API_KEY の部分は自身のAPI Keyに書き換えてください。

export MERAKI_DASHBOARD_API_KEY='YOUR_API_KEY'

実行時のサンプル出力は下記のようになります。

(.venv) cisco@ubuntu:~/work_dir$ ./get_meraki_orgs.py
['Test_Org_0000',
 'Test_Org_0001',
 'Test_Org_0002',
 'Test_Org_0003',
 'Test_Org_0004',
 'Test_Org_0005',
 'Test_Org_0006',
 'Test_Org_0007',
 'Test_Org_0008',
 'Test_Org_0009',
 'Test_Org_0010']
(.venv) cisco@ubuntu:~/work_dir$ 

Meraki vMXの認証トークンをMeraki Dashboard APIで取得する

Meraki vMXは「Meraki Dashboard上のデバイス設定」と「実際のインスタンス」を認証トークン (Authentication Token)を用いて紐付けます。 なお、AWSやAzureのようなPublic Cloudでは、払い出した認証トークンをUser Dataに格納してMeraki vMXのインスタンスをデプロイする流れになります。

しかしながらWeb UIからの手動操作では、認証トークンをコピー & ペーストする必要があってデプロイの自動化には不向きです

Web UIでのMeraki vMXの認証トークンの生成

そのため、自動化を試みる際の一つの手段として、Meraki Dashboard APIより Create Device Appliance Vmx Authentication TokenREST APIを用いる方法があります。

https://developer.cisco.com/meraki/api-latest/#!create-device-appliance-vmx-authentication-token

POST /devices/{serial}/appliance/vmx/authenticationToken

Create Device Appliance Vmx Authentication Token

なお、対象デバイス (Meraki vMX)を特定するために serial (Serial Number) の情報が必要になります。

実際に利用する際は、curl コマンドやPythonrequests ライブラリなどを用いてREST APIを適宜制御してください。

関連記事

myhomenwlab.hatenablog.com

myhomenwlab.hatenablog.com

SSLOモジュールを用いたBIG-IP Forward Proxy構成でのMicrosoft 365 (MS365)のテナント制限

SSLO (SSL Orchestrator)モジュールを用いて、BIG-IP Forward Proxy構成でMicrosoft 365 (MS365)のテナント制限を設定する方法を整理します。

本記事ではSSLOの v17.0.0.1-10.1 で実装された Office 365 Tenant Restrictions as a service の機能を用います。

techdocs.f5.com

Office 365 Tenant Restrictions as a service
SSL Orchestrator 10.1 now offers Office 365 Tenant Restrictions within the SSL Orchestrator interface, specifically in the F5 tab as part of the Solutions Catalog. This update enables organizations to control their users' access only to the company Office 365 resources while blocking access to personal/non-company Office 365 resources. The SSL Orchestrator inserts Microsoft "Tenant-Restriction" HTTP headers into outbound HTTP flows and provides a mechanism to allow or deny access to O365 resources based on organizational requirements.

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 17.0.0.1-10.1

v17.0.0.1-10.1 以前の場合は、SSLOモジュールではなく、iRulesを用いた実装方法があるため下記の記事を参考にしてください。

myhomenwlab.hatenablog.com

検証環境

本記事は下記のバージョンで検証を行っております。

  • F5 BIG-IP Virtual Edition Version 17.0.0.1
    BIG-IPのモジュールは、LTM, APM, SSLOを有効化しております。

  • SSL Orchestrator Package Version 10.1.15 (v17.0.0-10.1.15)
    Package: f5-iappslx-ssl-orchestrator-17.0.0-10.1.15.noarch
    SSLOはiApps LXのパッケージとして提供されているため、個別のバージョン情報があります。

SSLOのGuide Configurationの設定情報は下記をベースにしております。下記の記事はv16系の情報ですが、v17系でも根本的な設定方法は大きく変わらないため参考になると思われます。

myhomenwlab.hatenablog.com

前提情報

MS365のテナント情報は予め控えておいてください。

Microsoft Azure Portalから、メニュー: Azure Active Directory > Overview に移動すると Tenant IDPrimary domain の確認が可能です。

MS365のテナント情報の確認

設定方法

設定の概要

SSLOでの設定要素はService, Service Chain, Security Policyとなります。 ただし、Security PolicyでMS365のURLを条件に指定する必要があるため、事前にURL CategoriesにMS365のURL情報の格納が必要になります。

MS365テナント制限の設定要素

設定のデフォルト名称で Office 365 を意味する O365 の略称が設定名の一部として使用されている箇所がありました。ですが、昨今の Microsoft 365 へのブランド変更に合わせて MS365 の略称に統一しています。
また、Tenant Restrictionは表す設定名称としてTRの略称を使用しています。

Microsoft 365向けURL Categoriesの作成

Web UI と tmsh コマンドの2通りの設定パターンを紹介します。

Web UIからのURL Categoriesの作成

  • Web UIからの場合は、メニュー: Access > Secure Web Gateway > URL Categories の画面に移動して Create ボタンを押下します。

    Web UIからのURL Categoriesの作成 #1

  • Name には任意の名称を指定します。本記事ではMicrosoft 365 Tenant Restrictionの意味を含めるために MS365_TR としています。
    Associated URLs には Glob Pattern Match のチェックを外した上で下記のURLを Add ボタンで追加します。

    https://login.microsoftonline.com/
    https://login.microsoftonline.com
    https://login.microsoft.com/
    https://login.microsoft.com
    https://login.windows.net/
    https://login.windows.net
    

    Web UIからのURL Categoriesの作成 #2

  • URL Categoriesの設定が完了すると Custom Categories の配下に表示されます。

    Web UIからのURL Categoriesの作成 #3

tmsh コマンドからのURL Categoriesの作成

  • tmsh コマンドで作成する場合は、下記のコマンドを実行します。
tmsh create sys url-db url-category MS365_TR { display-name MS365_TR urls add { https://login.microsoft.com { } https://login.microsoft.com/ { } https://login.microsoftonline.com { } https://login.microsoftonline.com/ { } https://login.windows.net { } https://login.windows.net/ { } } }

tmsh list sys url-db url-category MS365_TR

tmsh save sys config partitions all
  • tmsh コマンドで設定した際の list サブ コマンドの表示例を記載します。
[root@bigip01:Active:In Sync] config # tmsh list sys url-db url-category MS365_TR
sys url-db url-category MS365_TR {
    cat-id 0
    cat-number 1904
    display-name MS365_TR
    f5-id 17004
    is-custom true
    urls {
        https://login.microsoft.com { }
        https://login.microsoft.com/ { }
        https://login.microsoftonline.com { }
        https://login.microsoftonline.com/ { }
        https://login.windows.net { }
        https://login.windows.net/ { }
    }
}
[root@bigip01:Active:In Sync] config # 

SSLO設定前の設定同期

  • 冗長化構成の場合はSSLOの設定に入る前にConfigSyncを行ってください。

    冗長構成時はSSLOの設定変更前にConfigSyncの実行

SSLOの対象設定への移動

  • メニュー: SSL Orchestrator > Configuration に移動して、対象の L3 Explicit Proxy の設定を開きます。

    SSLOの対象設定への移動

Serviceの作成

  • Service の画面に移動して Add Service を押下します。

    Serviceの作成 #1

  • F5 タブを開いて Office 365 Tenant Restrictionsダブル クリックします。タイル アイコンを押下するだけでは Office 365 Tenant Restrictions の設定画面に入れないので注意してください。

    Serviceの作成 #2

  • Office 365 Tenant Restrictions の設定画面で、下記の例を参考に各自のテナント情報を指定します。

    設定箇所 例示用の設定値 備考
    Name MS365_TR (ssloS_MS365_TR) Serviceを識別するための任意の名称を指定します。デフォルトは O365_TR になります。
    Restrict Access To Tenant samplecorp.test 適切なドメインに変更してください。
    Restrict Access Context XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 適切なTenant IDに変更してください。

    Serviceの作成 #3

  • 設定を終えたら保存 (Save)してService Chainの設定に進みます。

Service Chainへの Office 365 Tenant Restrictions (Service) の登録

  • Service Chain の画面に移動して Add を押下します。

    Service Chainへの Office 365 Tenant Restrictions (Service) の登録 #1

  • Service Chain Properties の設定画面で下記のように設定します。

    設定箇所 例示用の設定値 備考
    Name MS365_TR_SC (ssloSC_MS365_TR_SC) Service Chainを識別するための任意の名称を指定します。
    Services の Selected Service Chain Order ssloS_MS365_TR 事前に作成したServiceを指定します。

    Service Chainへの Office 365 Tenant Restrictions (Service) の登録 #2

  • 設定を終えたら保存 (Save)してSecurity Policyの設定に進みます。

Security Policyへのルールの追加

  • Security Policy の画面に移動して RulesAdd を押下します。

    Security Policyへのルールの追加 #1

  • 下記のようにRuleを追加します。

    設定箇所 例示用の設定値 備考
    Name MS365_TR Ruleを識別するための任意の名称を指定します。
    Conditions Category Lookup (SNI) is MS365_TR 事前に作成したURL Categoriesの MS365_TR を指定して、MS365宛の通信を対象にします。
    Action Allow デフォルト値のままです。
    SSL Proxy Action Intercept MS365テナント制限用のHTTP Headerを追加できるように、暗号化通信を復号化します。
    Service Chain ssloSC_MS365_TR_SC 事前に作成したService Chainを指定します。

    MS365宛の通信をURL Categories: MS365_TR で識別した上でSSL復号化 (Intercept)の対象とし、Service Chain: ssloSC_MS365_TR_SC でMS365テナント制限をかけます。

    Security Policyへのルールの追加 #2

  • Ruleの追加後は下記の設定画面のようになります。

    Security Policyへのルールの追加 #3

  • 一連の設定が完了したら、設定を保存 (Save)した上Deploy ボタンを押下します。

    Security Policyへのルールの追加 #4

    Security Policyへのルールの追加 #5

SSLOでデプロイ後の設定同期

  • 冗長化構成の場合はSSLOのデプロイ後にConfigSyncを行ってください。

    冗長構成時はSSLOでデプロイ後にConfigSyncの実行

MS365テナント制限の確認

  • 実際にMS365テナント制限にヒットするか確認します。筆者の場合はアクセスを許可していないテナントに接続したため Error: AADSTS500021 が表示されました。

    MS365テナント制限の確認

    learn.microsoft.com

    Error Description
    AADSTS500021 Access to '{tenant}' tenant is denied. AADSTS500021 indicates that the tenant restriction feature is configured and that the user is trying to access a tenant that isn't in the list of allowed tenants specified in the header Restrict-Access-To-Tenant. For more information, see Use tenant restrictions to manage access to SaaS cloud applications.


SSLOの内部的な挙動 (SSLOがデプロイする設定群)

ここからは設定に関する理解を促すための情報を記載します。

SSLOでデプロイした設定はBIG-IPの標準機能として設定されるため、トラブルシューティングを行う際にどのようなデプロイされたか理解しておくのが重要となります。

今回のMS365テナント制限の場合は、Security Policyで設定を行ったのでPer-Request Policyにデプロイされた設定から内部実装を追えます。

Per-Request Policy上では Service ConnectのItemからConnector Profileを呼び出しており、そのConnector Profileの Entry Virtual Server でMS365テナント制限用のVirtual Serverに向けています。 そして、MS365テナント制限用のVirtual ServerにはiRulesでHTTP Headerを書き換える制御が実装されています。

MS365テナント制限の標準機能としての設定要素

MS365向けの通信はVirtual Serverのホップ数が1段増えるため、通信フローの変更に留意してください。 なお、Forward Proxy構成の基本形の通信フローに関しては下記の記事にまとめているので適宜参照してください。

myhomenwlab.hatenablog.com

ここからは実際の設定画面を見ながら、設定の構成要素を追っていきます。

SSLOからデプロイされたPer-Request Policyは下記の画面キャプチャのようになります。 Service ConnectのItemはConnector Profileを呼び出す設定になっています。

Per-Session Policyの制御フローの確認 (SSLOのSecurity Policyからデプロイされた内容の確認)

Per-Request PolicyのService Connect (Connector Profile)の確認

該当のConnector Profileでは Entry Virtual Server の設定でVirtual Serverを指定しているのが確認できます。

Connector ProfileのEntry Virtual Server設定の確認

Entry Virtual Server で指定されているのはMS365テナント制限用のVirtual Serverであり、TypeInternal となっております。

MS365テナント制限用のVirtual ServerのProperties設定 (Type, Source Addressの確認)

Type: Internal のVirtual Serverは下記のドキュメントを見るとService Chainingで使用されるICAP向けの設定のようです。

Overview of BIG-IP virtual server types (12.x - 17.x)
https://my.f5.com/manage/s/article/K55185917

Virtual server type Description of virtual server type
Internal An Internal virtual server enables usage of Internet Content Adaptation Protocol (ICAP) servers to modify HTTP requests and responses by creating and applying an ICAP profile and adding Request Adapt or Response Adapt profiles to the virtual server. For information about the Internal virtual server, refer to K15819: Overview of the internal virtual server.

MS365テナント制限用のVirtual ServerにはHTTP Headerを書き換えるiRulesが紐付いています。

MS365テナント制限用のVirtual ServerのResoures設定 (紐付いているiRulesの確認)

MS365テナント制限用のiRulesの確認

補足情報ですが、Service ConnectのItemと、Connector Profileは主にSSLOで使用される設定のようです。

APMのVPE (Visual Policy Editor)のItemであるService Connectは、下記のドキュメントに情報がありました。

techdocs.f5.com

About Service Connect
This agent, used primarily by SSLO, allows you to connect to SSLO services that were previously configured. Service Connect provides the option to attach a Connector profile to the virtual server to enable service chaining in a per-request policy.

Connector Profileは下記のドキュメントに情報がありました。

Overview of the Standard virtual server
https://support.f5.com/csp/article/k93017176

Setting Description Notes
Connector Profile A connector profile is associated with a virtual server for a service and defines the type of external service and the virtual servers that talk to the external service. This profile lets you specify the entry virtual server, which is a virtual server of type Internal, for each external service. This can be used for service chaining, for example in F5 SSL Orchestrator. Connector Profile: Local Traffic > Profiles > Other > Connector. Introduced in BIG-IP 14.0.0

情報源

公式ドキュメントの Setup ページ配下には、Features and Terminologies に新機能として Office 365 Tenant Restrictions as a service の説明はあるものの設定方法に関する記載はありませんでした。(2023年01月頃)

techdocs.f5.com

そのため、DevCentralの下記のコミュニティ記事を参考に設定方法を割り出しました。 大きな差異としては Generic ICAP Service の設定個所が Office 365 Tenant Restrictions に変わります。

community.f5.com

SSLOは公式ドキュメント上に情報がなくて、検証するかサポートに問い合わせないと不明瞭な点が多々見受けられるので留意してください。

BIG-IP SSL Orchestrator (SSLO)のドキュメント リンクの体系化

BIG-IP SSL Orchestrator (SSLO)のドキュメント リンクを体系化しました。

2022年12月頃にBIG-IP Knowledge CenterがMyF5のProduct Manuals and Release Notesに移行されましたが、検索前提のシステムとなっており使い勝手が悪かったため、個人的によく使用するBIG-IP SSLOに絞ってドキュメント リンクを体系化しました。

情報源は Product:F5 SSL Orchestrator で絞ったものを対象にしております。

https://my.f5.com/manage/s/tech-documents#t=prodManuals&sort=relevancy&f:@f5_product=%5BF5%20SSL%20Orchestrator%5D

主にRelease Notesと、各種マニュアルがリンクされているSetupページを対象にまとめています。

なお、一部のマニュアルに関しては下記のKnowledge Baseから探すのも便利そうでした。(追記: 2023年01月10日)

K000130285: F5 Product Manuals Index
https://my.f5.com/manage/s/article/K000130285

BIG-IP SSLOのRelease NotesやSetupページは K71174564 のページで一覧で見られるように管理されているようでした。(追記: 2023年05月06日)

Overview of F5 SSL Orchestrator
https://my.f5.com/manage/s/article/K71174564

注記

筆者が常に最新情報を反映できるとは限らないため、更新履歴の記録を残しておきます。 もし公式のドキュメントが体系的に整備された場合は、本記事は検索の邪魔になる可能性があるため非公開にする可能性があります。

更新履歴

No. 更新内容
1 2022年12月29日時点のRelease Notes, Setupページ, 互換性ページに絞って情報を記載しました。当時のRelease Notes数は41種類です。
2 Version 17.1.0-11.0 の情報を追記しました。2023年04月02日時点 (追記時点)のRelease Notes数は42種類です。
3 Version 15.1.9-7.7 の情報を追記しました。2023年07月15日時点 (追記時点)のRelease Notes数は43種類です。

v12系

v12.1.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 12.1.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-12-1-0.html

v13系

v13.0.0

AskF5 | Manual: F5 SSL Orchestrator: Setup
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/manuals/product/f5-herculon-ssl-orchestrator-setup-13-0-0.html

v13.0.0-2.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 13.0.0 with F5 SSL Intercept iAppLX version 2.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-13-0-0-iapp-2-0.html

v13.0.0-2.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 13.0.0 with F5 SSL Intercept iAppLX version 2.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-13-0-0-iapp-2-1.html

v13.0.0-2.2

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 13.0.0 with F5 SSL Intercept iAppLX version 2.2
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-13-0-0-iapp-2-2.html

v13.0.0-2.3

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 13.0.0-2.3
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-13-0-0-iapp-2-3.html

AskF5 | Manual: F5 SSL Orchestrator: Setup version 13.0.0-2.3
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/manuals/product/f5-herculon-ssl-orchestrator-setup-13-0-0-iapp-2-3.html

v13.1.0-3.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 13.1.0-3.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-13-1-0-iapp-3-0.html

AskF5 | Manual: F5 SSL Orchestrator: Setup
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/manuals/product/f5-herculon-ssl-orchestrator-setup-13-1-0-iapp-3-0.html

v14系

v14.0.0-4.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.0.0-4.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-0-0-iapp-4-0.html

AskF5 | Manual: SSL Orchestrator: Setup
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/manuals/product/ssl-orchestrator-setup-14-0-0-4-0.html

v14.1.0-5.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.0-5.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-0-iapp-5-0.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 14.1.0-5.0
https://techdocs.f5.com/en-us/bigip-14-1-0/ssl-orchestrator-setup-14-1-0-5-0.html

v14.1.0-5.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.0-5.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-0-iapp-5-1.html

v14.1.0-5.2

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.0-5.2
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-0-iapp-5-2.html

v14.1.0-5.3

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.0-5.3
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-0-iapp-5-3.html

v14.1.0-5.4

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.0-5.4
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-0-iapp-5-4.html

v14.1.2-5.5

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.2-5.5
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-2-iapp-5-5.html

v14.1.2-5.6

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.2-5.6
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-2-iapp-5-6.html

v14.1.2-5.7

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.2-5.7
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-2-iapp-5-7.html

v14.1.2-5.8

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.2-5.8
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-2-iapp-5-8.html

v14.1.4-5.9

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 14.1.4-5.9
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-14-1-4-iapp-5-9.html

v15系

v15.0.0-6.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.0.0-6.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-0-0-iapp-6-0.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 15.0.0-6.0
https://techdocs.f5.com/en-us/bigip-15-0-0/ssl-orchestrator-setup.html

v15.0.0-6.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.0.0-6.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-0-0-iapp-6-1.html

v15.0.0-6.2

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.0.0-6.2
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-0-0-iapp-6-2.html

v15.0.0-6.3

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.0.0-6.3
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-0-0-iapp-6-3.html

v15.0.0-6.4

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.0.0-6.4
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-0-0-iapp-6-4.html

v15.0.0-6.5

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.0.0-6.5
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-0-0-iapp-6-5.html

v15.1.0-7.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.0-7.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-0-iapp-7-0.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 15.1.0-7.0
https://techdocs.f5.com/en-us/bigip-15-1-0/ssl-orchestrator-setup.html

v15.1.0-7.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.0-7.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-0-iapp-7-1.html

v15.1.0-7.2

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.0-7.2
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-0-iapp-7-2.html

v15.1.0-7.4

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.0-7.4
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-0-iapp-7-4.html

v15.1.0-7.5

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.0-7.5
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-0-iapp-7-5.html

v15.1.2-7.5

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.2-7.5
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-2-iapp-7-5.html

v15.1.2-7.6

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 15.1.2-7.6
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-2-iapp-7-6.html

v15.1.9-7.7

F5 SSL Orchestrator Release Notes version 15.1.9-7.7
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-15-1-9-iapp-7-7.html

v16系

v16.0.0

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 16.0.x
https://techdocs.f5.com/en-us/bigip-16-0-0/ssl-orchestrator-setup.html

v16.0.0-8.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.0.0-8.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-0-0-iapp-8-0.html

v16.0.0-8.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.0.0-8.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-0-0-iapp-8-1.html

v16.0.0-8.2

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.0.0-8.2
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-0-0-iapp-8-2.html

v16.0.1-8.3

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.0.1-8.3
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-0-1-iapp-8-3.html

v16.0.1-8.4

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.0.1-8.4
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-0-1-iapp-8-4.html

v16.1.0-9.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.1.0-9.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-1-0-iapp-9-0.html

v16.1.1-9.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.1.1-9.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-1-1-iapp-9-1.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 16.1.1-9.1
https://techdocs.f5.com/en-us/bigip-16-1-1/ssl-orchestrator-setup.html

v16.1.1-9.2

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.1.1-9.2
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-1-1-iapp-9-2.html

v16.1.3-9.3

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 16.1.3-9.3
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-16-1-3-iapp-9-3.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 16.1.3-9.3
https://techdocs.f5.com/en-us/bigip-16-1-3/ssl-orchestrator-setup.html

v17系

v17.0.0-10.0

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 17.0.0-10.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-17-0-0-iapp-10-0.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 17.0.0-10.0
https://techdocs.f5.com/en-us/bigip-17-0-0/ssl-orchestrator-setup.html

v17.0.0.1-10.1

AskF5 | Release Notes: F5 SSL Orchestrator Release Notes version 17.0.0.1-10.1
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-17-0-0-1-iapp-10-1.html

AskF5 | Manual: F5 Guided Configuration for SSL Orchestrator: Setup 17.0.0.1-10.1
https://techdocs.f5.com/en-us/bigip-17-0-0-1/ssl-orchestrator-setup.html

v17.1-11.0

F5 SSL Orchestrator Release Notes version 17.1.0-11.0
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/releasenotes/product/relnote-ssl-orchestrator-17-1-0-iapp-11-0.html

F5 Guided Configuration for SSL Orchestrator: Setup 17.1-11.0
https://techdocs.f5.com/en-us/bigip-17-1-0/ssl-orchestrator-setup.html

Others (Version問わず)

AskF5 | Manual: Interoperability Matrix for F5 SSL Orchestrator with BIG-IP and BIG-IQ
https://techdocs.f5.com/kb/en-us/products/ssl-orchestrator/manuals/product/f5-sslo-bigip-bigiq-interoperability-matrix.html

BIG-IP SSL Orchestratorはv16.1.0-9.0より冗長構成時の設定同期の挙動が変更

BIG-IP SSL Orchestrator (SSLO)の v16.1.0-9.0 以前 (Older Version)では、冗長構成における設定同期がREST APIベースの実装となり、TMOS (Traffic Management Operating System)が担っているConfigSyncとは別の設定同期方法となっておりました。

旧来のREST APIベースの設定同期では、SSLOのConfiguration Guideでデプロイを行うと設定の一貫性を保つために即時的にHA Pairに対してREST APIによる設定の流し込みが行われて、デプロイ完了後には別途ConfigSyncによる設定同期も必要となっておりました。

BIG-IPの標準機能から外れた独特な実装であるのが理由で、REST APIによる設定同期の処理中に問題が発生すると、最悪の場合で「設定のリストア」"以外"では復旧不可能なレベルで設定崩壊を招く可能性があり、特にv15系時代はSSLOの運用リスクがとても高い状況になっていました。

運用担当者にiApps LXやその技術要素であるNode.jsに対して深い理解がないと、状況に則していない誤った復旧作業を実施してしまい、より一層状況を悪化させる可能性がありトラブルシューティングの実施自体が困難となります。ネットワーク アプライアンスであるのにも関わらず、ネットワーク エンジニアにプログラミング寄りの深い知見を要求するため、テクニカル サポートの支援なしでは復旧が困難な状況に陥ります。最悪の場合、エラー ログとiApps LXのソース コードを突き合わせて問題が発生している処理を突き止める必要があります。

しかし、v16.1.0-9.0 より設定同期の挙動が変更となり、TMOSのネイティブなMCP/CMI HA syncを利用する方式に変更になりました。 また、本挙動変更に伴って Automatic with Incremental Sync がサポートされるようになりました。 そして、SSLOの内部的にはiFileが設定の保存に利用されるようになりました。 筆者が実機に触れている限りでは、設定崩壊が起こりにくくなっており、REST APIベースの頃より改善したように見受けられます。

BIG-IP SSLOの設定同期の挙動

挙動変更に関するRelease Notes

v16.1.0-9.0 のRelease Notesに本挙動変更の情報が記載されております。

techdocs.f5.com

SSO Control Plane re-architecture
SSL Orchestrator 9.0 includes the following significant improvements to the control plane:
* The source-of-truth for the SSL Orchestrator configuration is now stored in the iFile objects. This allows the SSL Orchestrator to utilize native MCP/CMI HA sync functions and support automatic and incremental sync.
* The iApp strictness lock icon has been removed from several objects, excluding network and access objects allowing you to make out-of-band changes freely.
* The SSLO architecture now no longer uses the Gossip sync function to sync SSLO REST configuration.

Youtubeの動画内での情報

F5J DX Team (F5ジャパンのDXチーム)によるYoutubeの動画内でも本挙動に関する情報があります。

https://www.youtube.com/watch?v=gS-VMMXSkh0&t=71s

www.youtube.com

既存ユーザアップデート:16.1のSSL Orchestrator (SSLO)新機能 - YouTube

1分11秒 (71秒)付近から High Availability(HA) 時のSyncの改善 の解説になります。 情報を参照しやすくするためにスライドの内容を引用します。

  • 顧客課題

    • TMOSの基本設定とSSLOGC設置とでHA Config Sync方法が異なっており、両方を考慮する必要があった
  • F5ソリューション

    • SSLOにおけるHA時のConfig Syncが改善され、今までのゴシップ (RESTによるSync) によるHAではなく、SSLOもTMOSのMCP/CMI syncを適用可能となった (SSLOのSyncいは内部でiFileを利用)

    • AutomaticとIncremental syncをサポート

SSLO用iFileの実機情報

SSLOのアーキテクチャの理解度を高めるために、SSLOが内部的に利用しているiFileの存在を確認しました。

v16.1.0-9.0 以上 (Newer Version) であるv17系でも挙動が変わってない点を確認したかったため、検証時はBIG-IP SSLOのバージョンは v17.0.0-10.0.20 (BIG-IP v17.0.0, SSLO v10.0.20) を利用しています。

SSLO用iFileはWeb UIでは表示されなかったですが、tmsh コマンドでは確認できました。

Web UI上ではメニュー: Local Traffic > iRules > iFile List には表示されず、メニュー: File Management > iFile List の方に表示されます。

メニュー: Local Traffic > iRules > iFile List

メニュー: File Management > iFile List

CLIでは tmsh list sys file ifile recursive コマンドを実行すると、SSLO向けiApps LXの設定である ssloF_global.app に紐づいているのが確認できます。

[root@bigip01:Active:In Sync] config # tmsh list sys file ifile recursive
sys file ifile ssloF_global.app/SSLOiFile {
    app-service /Common/ssloF_global.app/ssloF_global
    checksum SHA1:60979:ac965bb2d970ba056f212c0ffee74f4f4a6cdd10
    create-time 2022-12-26:01:26:33
    created-by admin
    last-update-time 2022-12-26:01:31:04
    mode 33188
    revision 4
    size 60979
    source-path file:///tmp/ssloConfigs.json
    updated-by admin
}
[root@bigip01:Active:In Sync] config #

source-path file:///tmp/ssloConfigs.json にファイルの実体があるため、ファイルの中身を見てみるとJSONで記述されておりました。

root@bigip01:Active:In Sync] config # cat /tmp/ssloConfigs.json | jq . | head
{
  "timestamp": "2022-12-25T16:31:04.378Z",
  "configs": [
    {
      "id": "****-****-****",
      "name": "f5-ssl-orchestrator-dg-data",
      "inputProperties": [
        {
          "id": "dependencyGraph",
          "type": "JSON",
[root@bigip01:Active:In Sync] config #

関連Knowledge Base

Knowledge Baseの K48366323 の記事内でも、SSLOの設定同期がRESTのメカニズムを利用している点の記載と、iFileに設定が保存されるようになった点の記述があります。

  • K48366323: When clearing/deleting the SSL Orchestrator (SSLO) config sync may fail.
    https://support.f5.com/csp/article/K48366323

    The synchronization of SSLO has taken place outside of TMM using the REST mechanism. SSLO created TMM objects from a json file stored in SSLO. That has changed and they are now stored in iFiles within TMM. So when only using clear-rest-storage command that may not clear the iFiles and the objects created from there.

v16.1.0-9.0 以前 (Older Version)の挙動に関する情報源

v16.1.0-9.0 以前 (Older Version)の挙動の情報源も記載しておきます。

関連記事

myhomenwlab.hatenablog.com

myhomenwlab.hatenablog.com

Meraki MXのIDS/IPSにおけるルール更新はEvent logから確認可能

Meraki MXではIDS/IPSのルール更新が定期的に行われますが、ルール更新の情報はEvent logから確認可能です。

確認方法

メニュー: Network-wide > Event log の画面にて for security appliances を選択して、Event type: Intrusion detection rules update のログ情報を確認します。

Event type includeIntrusion detection rules update に絞ると確認しやすくなります。

Event type include: Intrusion detection rules update

また、IDS/IPS関連のEvent typeは他にも Intrusion detection startedIntrusion detection error があるため All Intrusion Detection で絞ると関連処理も追いやすくなります。

Event type include: All Intrusion Detection

IDS/IPSのルール更新時のログ出力例は下記のようになります。

Event type Details
Intrusion detection rules update snort_rules_version: 2.9.15.1, source: ids-vrt-security, rules: d9fc81e4a76dce02546a78be6d013248feb556fd

IDS/IPSのルール更新間隔の設定

IDP/IPSのルール更新間隔の設定自体は、メニュー: Security & SD-WAN > SD-WAN & traffic shapingUplink configuration セクションより List update interval にて指定できます。設定値には Hourly, Daily, Weekly を指定可能です。

List update interval

更新チェック時に今より新しいルールが必ずあるとは限らないので、設定通りの間隔で Event type: Intrusion detection rules update が出力されるわけではない点に留意してください。 例えば、List update intervalHoourly に設定していても、1時間毎にログが出力されるとは限りません。

また、List update interval に関してのドキュメントは下記になります。

documentation.meraki.com

List update interval
This setting determines how often the MX should check for updates to security lists. You can specify an Hourly, Daily, or Weekly update interval. To specify different intervals depending on which uplink is being used to download lists, click "details". This can be useful if you want to control bandwidth usage due to security list downloads on a low-bandwidth WAN link or cellular uplink.

Features affected by this setting include IDS/IPS, Top Sites Content Filtering, and Malware Scanning.

Features affected by this setting include IDS/IPS, Top Sites Content Filtering, and Malware Scanning. の記述があるように、List update interval はIDS/IPSのルール更新のためだけの機能ではない点に留意してください。

関連記事

myhomenwlab.hatenablog.com

Catalyst 8000V (Public Cloud版)の Section: Scripts によるguestshellでのスクリプト実行

Public Cloud版のCatalyst 8000Vでは、User Dataにスクリプトの情報を記述することによってguestshell (コンテナ)でスクリプトを実行できます。

具体的にはUser Dataにて Section: Scripts のセクションでスクリプトのURLと引数を記述しますが、筆者が検証してた際にハマり所があったため関連情報をまとめて整理します。

Section: Scripts の書式

まずは肝心要の Section: Scripts の書式や使用例ですが、下記のドキュメントに記載があります。

www.cisco.com

Section: scripts
public_url <arg1> <arg2>

しかしながら、2022年12月時点でドキュメント内に複数の書式の表記が混在しているため、筆者が実機で確認してスクリプトの実行可否を表に整理しました。

ドキュメント内の Section: Scripts の書式 (2022年12月時点)

書式 実行可否 備考
Section: scripts OK 頭文字: 小文字, 複数形
Section: Scripts OK 頭文字: 大文字, 複数形
Section: Script NG 頭文字: 大文字, 単数形

Section: Scripts セクションの2行目からはguesthellへ渡すためのスクリプトのURLや引数 (任意)を記述します。

Section: Scripts の動作をイメージ化すると下記のようになります。

Catalyst 8000VのSection: Scripts

補足ですが、IOX-XEホストOS上では bootflash:guest-share/customdata_bash.shスクリプト ファイルが一時的に生成されるため、中身を確認すると挙動を追いやすくなります。 当該ファイルはguestshellの起動タイミングで一時的に生成されて後に削除されるため、筆者はターミナルでリアルタイムにログを追いながら検証しておりました。 参考までに確認に用いたい際のコマンドを下記に記載します。

terminal monitor

terminal length 0

dir bootflash:guest-share/

more bootflash:guest-share/customdata_bash.sh

Section: Scripts で同じURLもしくはファイル名を渡された際の挙動

Section: Scripts のセクション内では複数のURLを指定できますが、同じURLを重複して指定すると最後のものしか実行されない挙動がありました。

単一のスクリプトでも引数で挙動を変えられる都合上、同じURLを引数違いで渡す可能性があるため詳細な挙動を確認しました。 結論を先に出すと、同一スクリプトを使い回したい場合はURL Parameterを付与して一意なURLにする回避策がありました。

筆者はguestshell上にて下記のようなスクリプトcreate_node.py を引数違いで複数回実行したい目的があって本挙動を調べました。
create_node.py はPublic Cloud環境でCatalyst 8000Vの冗長化を実現するために用意されているスクリプトです。

#!/bin/bash
#
# Description
#
#   This script is intended to be called from "Section: Scripts" and executed by guestshell.
#   Execute create_node.py with arguments.
#
#
# Arguments
#
#   arg1: Node Index (e.g. 1)
#   arg2: Region (e.g. us-west-2)
#   arg3: Route table Name (e.g. rtb-0123456789)
#   arg4: Next Hop Interface (e.g. eni-0123456789)
#   arg5: Route/CIDR Prefix (e.g. 0.0.0.0/0)
#   arg6: primary or secondary
#
#
# Reference
#
#  Cisco Catalyst 8000V Edge Software High Availability Configuration Guide - Configure High Availability on Cisco Catalyst 8000V Running on Amazon Web Services [Cisco IOS XE 17] - Cisco
#  https://www.cisco.com/c/en/us/td/docs/routers/C8000V/HighAvailability/c8000v-high-availability-configuration-guide/configure-high-availability-for-aws.html

create_node.py -i ${1} -rg ${2} -t ${3} -n ${4} -r ${5} -m ${6}

検証環境

検証時の情報を控えておきます。 ドキュメントには明記されていなかった挙動もあるため、挙動変更される可能性も考慮して適宜最新の情報を確認してください。

項目名 情報
環境 AWS
製品名 Cisco Catalyst 8000V Edge Software - BYOL
Version 17.09.01a

例示用スクリプト: echo_msg.sh

動作確認に用いた例示用のスクリプトを掲載します。

与えられた第1引数がファイル名且つメッセージ内容となります。ファイルの出力先はホーム ディレクトリです。

#!/bin/bash

echo "${1}" > ~/"${1}"

guestshell上にて ls ~/ コマンドでファイルの生成有無を調べて、スクリプトの実行有無の確認に用います。

想定ケース: 同じURLの重複指定

同じURLが重複して指定されると、最後のものが優先されて実行されます。URL分だけ重複して実行されるわけではないので留意してください。

同じURLの重複指定

Section: Scripts で同じURLに対して、異なる引数を渡して動作確認を行いました。

Section: Scripts
https://www.example.test/echo_msg.sh Hello
https://www.example.test/echo_msg.sh World

guestshellでスクリプトのダウンロード状況を確認すると、同じURLを複数行記載していることもあってファイル自体は echo_msg.sh の名称で1つしかダウンロードされていません。

[guestshell@guestshell ~]$ ls ~/customdata/
customdata.log  echo_msg.sh  echo_msg.sh.log  syslogger.py
[guestshell@guestshell ~]$

guestshellでスクリプトの実行結果を確認すると、ホーム ディレクトリに World (最後の引数)のファイルが出力されているため最後のURLと引数の組み合わせが優先して実行されたのが確認できます。

[guestshell@guestshell ~]$ ls ~/
World  cloud  customdata
[guestshell@guestshell ~]$

なお、Section: Scripts の記述を元に生成された bootflash:guest-share/customdata_bash.sh では、最後の引数分の処理しか生成されていませんでした。 そのため、同じURLの指定分回数のダウンロード処理は走らないようになっておりました。

想定ケース: ファイル名 (ベースURL)は重複且つURL Parameterは一意

同じ内容のスクリプトを何個もコピーしてURLを一意にするのはスクリプトの保守・運用性が悪くなります。 そのため、URL Parameterを用いてファイルの実体は1つでありながら、疑似的に一意なURLを複数生成する回避策を見つけました。

ファイル名 (ベースURL)は重複且つURL Parameterは一意

Section: Scripts に記述するベースとなるURLは同じものの、URL Parameterにダミーの値を渡してURLを別物扱いにしました。

Section: Scripts
https://www.example.test/echo_msg.sh?v=dummy1 Hello
https://www.example.test/echo_msg.sh?v=dummy2 World

guestshellでスクリプトのダウンロード状況を確認すると、URL Parameterを付与された名称でファイルがダウンロードされます。

[guestshell@guestshell ~]$ ls ~/customdata/
 customdata.log         'echo_msg.sh?v=dummy1.log'  'echo_msg.sh?v=dummy2.log'
'echo_msg.sh?v=dummy1'  'echo_msg.sh?v=dummy2'       syslogger.py
[guestshell@guestshell ~]$

guestshellでスクリプトの実行結果を確認すると、ホーム ディレクトリに HelloWorld のファイルがあるため、同じベースURLのスクリプトを元に実行されているのが分かります。

[guestshell@guestshell ~]$ ls ~/
Hello  World  cloud  customdata
[guestshell@guestshell ~]$

想定ケース: 異なるURLで同一ファイル名

異なるURLであってもファイル名部分は重複する可能性があるため動作確認を行いました。

スクリプトは上から順にダウンロードと実行がなされます。そして、同名ファイルは上書きされるため、結果的に最後のURLのファイルの内容だけが残ります。

異なるURLで同一ファイル名

Section: Scripts のURLのファイル名部分が同じになるようにして動作確認を行いました。

Section: Scripts
https://www.example.test/echo_msg.sh Hello
https://www.example.test/dir/echo_msg.sh World

guestshellでスクリプトのダウンロード状況を確認すると、同じファイル名のURLを複数行記載していることもあってファイル自体は echo_msg.sh の名称で1つしかダウンロードされていません。

[guestshell@guestshell ~]$ ls ~/customdata/
customdata.log  echo_msg.sh  echo_msg.sh.log  syslogger.py
[guestshell@guestshell ~]$

guestshellでスクリプトの実行結果を確認すると、ホーム ディレクトリに HelloWorld のファイルがあるため、異なるURLで同一ファイル名であっても実行されているのが分かります。

[guestshell@guestshell ~]$ ls
Hello  World  cloud  customdata
[guestshell@guestshell ~]$

詳細な挙動ですが、最初のURLのファイルをダウンロードして実行してから、次のURLのファイルをダウンロードして実行されます。 ファイル自体は上書きされてしまいますが処理自体は同一ファイル名であっても実行されます。

IOX-XEホストOS上で一時的に生成される bootflash:guest-share/customdata_bash.sh ファイルの中の処理を見ると一目瞭然だと思われます。

c8000v01#more bootflash:guest-share/customdata_bash.sh
<snip>
wget --read-timeout=30 --tries=5 https://www.example.test/echo_msg.sh -O echo_msg.sh &>> customdata.log
<snip>
  chmod +x echo_msg.sh
    ./echo_msg.sh  Hello &>> echo_msg.sh.log &
<snip>
wget --read-timeout=30 --tries=5 https://www.example.test/dir/echo_msg.sh -O echo_msg.sh &>> customdata.log
<snip>
  chmod +x echo_msg.sh
    ./echo_msg.sh  World &>> echo_msg.sh.log &
<snip>

wget コマンドの -O (--output-document=file) オプションで出力先ファイル名が同名になっているため、順次上書きされてしまい、最後のファイルの内容だけが残る仕組みです。 ちなみに -O オプションによるファイル名の指定がないと、重複したファイルは連番が付与されます。

関連ドキュメント

myhomenwlab.hatenablog.com