概要
このドキュメントでは、Microsoft Office 365(Microsoft Teamsを含む)およびCisco Webex宛てのトラフィックをVPN接続から除外するように、適応型セキュリティアプライアンス(ASA)を設定する方法について説明します。ネットワークアドレスの除外と、それをサポートするAnyConnectクライアントの動的(完全修飾ドメイン名(FQDN)ベース)の除外が組み込まれています。
スプリット トンネリング
トンネルから除外するIPv4およびIPv6宛先の指定されたリストを「除外」するようにASAを設定する必要があります。残念ながら、アドレスのリストは動的であり、変更される可能性があります。Pythonスクリプトの設定セクションと、リストの取得とサンプル設定の生成に使用できるオンラインPython読み取り/評価 – 印刷ループ(REPL)へのリンクを参照してください。
ダイナミックスプリットトンネリング
スプリット除外ネットワークアドレスのリストに加えて、AnyConnect 4.6 for Windows and Macにダイナミックスプリットトンネリングが追加されました。ダイナミックスプリットトンネリングでは、FQDNを使用して、接続がトンネルを通過する必要があるかどうかを判断します。Pythonスクリプトは、カスタムAnyConnect属性に追加するエンドポイントのFQDNも決定します。
コンフィギュレーション
このスクリプトは、Python 3 REPLで実行するか、https://repl.it/@ministryofjay/AnyConnectO365DynamicExcludeなどのパブリックREPL環境で実行します。
import urllib.request
import uuid
import json
import re
def print_acl_lines(acl_name, ips, section_comment):
slash_to_mask = (
"0.0.0.0",
"128.0.0.0",
"192.0.0.0",
"224.0.0.0",
"240.0.0.0",
"248.0.0.0",
"252.0.0.0",
"254.0.0.0",
"255.0.0.0",
"255.128.0.0",
"255.192.0.0",
"255.224.0.0",
"255.240.0.0",
"255.248.0.0",
"255.252.0.0",
"255.254.0.0",
"255.255.0.0",
"255.255.128.0",
"255.255.192.0",
"255.255.224.0",
"255.255.240.0",
"255.255.248.0",
"255.255.252.0",
"255.255.254.0",
"255.255.255.0",
"255.255.255.128",
"255.255.255.192",
"255.255.255.224",
"255.255.255.240",
"255.255.255.248",
"255.255.255.252",
"255.255.255.254",
"255.255.255.255",
)
print(
"access-list {acl_name} remark {comment}".format(
acl_name=acl_name, comment=section_comment
)
)
for ip in sorted(ips):
if ":" in ip:
# IPv6 address
print(
"access-list {acl_name} extended permit ip {ip} any6".format(
acl_name=acl_name, ip=ip
)
)
else:
# IPv4 address. Convert to a mask
addr, slash = ip.split("/")
slash_mask = slash_to_mask[int(slash)]
print(
"access-list {acl_name} extended permit ip {addr} {mask} any4".format(
acl_name=acl_name, addr=addr, mask=slash_mask
)
)
# Fetch the current endpoints for O365
http_res = urllib.request.urlopen(
url="https://endpoints.office.com/endpoints/worldwide?clientrequestid={}".format(
uuid.uuid4()
)
)
res = json.loads(http_res.read())
o365_ips = set()
o365_fqdns = set()
for service in res:
if service["category"] == "Optimize":
for ip in service.get("ips", []):
o365_ips.add(ip)
for fqdn in service.get("urls", []):
o365_fqdns.add(fqdn)
# Generate an acl for split excluding For instance
print("##### Step 1: Create an access-list to include the split-exclude networks\n")
acl_name = "ExcludeSass"
# O365 networks
print_acl_lines(
acl_name=acl_name,
ips=o365_ips,
section_comment="v4 and v6 networks for Microsoft Office 365",
)
# Microsoft Teams
# https://docs.microsoft.com/en-us/office365/enterprise/office-365-vpn-implement-split-tunnel#configuring-and-securing-teams-media-traffic
print_acl_lines(
acl_name=acl_name,
ips=["13.107.60.1/32"],
section_comment="v4 address for Microsoft Teams"
)
# Cisco Webex - Per https://help.webex.com/en-us/WBX000028782/Network-Requirements-for-Webex-Teams-Services
webex_ips = [
"64.68.96.0/19",
"66.114.160.0/20",
"66.163.32.0/19",
"170.133.128.0/18",
"173.39.224.0/19",
"173.243.0.0/20",
"207.182.160.0/19",
"209.197.192.0/19",
"216.151.128.0/19",
"114.29.192.0/19",
"210.4.192.0/20",
"69.26.176.0/20",
"62.109.192.0/18",
"69.26.160.0/19",
]
print_acl_lines(
acl_name=acl_name,
ips=webex_ips,
section_comment="IPv4 and IPv6 destinations for Cisco Webex",
)
# Edited. April 1st 2020
# Per advice from Microsoft they do NOT advise using dynamic split tunneling for their properties related to Office 365
#
print(
"\n\n##### Step 2: Create an Anyconnect custom attribute for dynamic split excludes\n"
)
print("SKIP. Per Microsoft as of April 2020 they advise not to dynamically split fqdn related to Office365")
#print(
# """
#webvpn
# anyconnect-custom-attr dynamic-split-exclude-domains description dynamic-split-exclude-domains
#
#anyconnect-custom-data dynamic-split-exclude-domains saas {}
#""".format(
# ",".join([re.sub(r"^\*\.", "", f) for f in o365_fqdns])
# )
#)
#
print("\n##### Step 3: Configure the split exclude in the group-policy\n")
print(
"""
group-policy GP1 attributes
split-tunnel-policy excludespecified
ipv6-split-tunnel-policy excludespecified
split-tunnel-network-list value {acl_name}
""".format(
acl_name=acl_name
)
)
注:Microsoftでは、公開されたIPv4およびIPv6アドレス範囲を使用してスプリットトンネリングを設定することにより、VPN接続の範囲から主要なOffice 365サービス宛てのトラフィックを除外することを推奨しています。VPNのキャパシティを最大限に活用するには、Office 365 Exchange Online、SharePoint Online、およびMicrosoft Teams(Microsoftのドキュメントでは最適化カテゴリと呼ばれます)に関連する専用IPアドレス範囲へのトラフィックを、VPNトンネルの外部にルーティングします。この推奨事項の詳細については、「VPNスプリットトンネリングを使用したリモートユーザのOffice 365接続の最適化」を参照してください。
注:2020年4月初旬の時点で、Microsoft TeamsにはIP範囲13.107.60.1/32をトンネルから除外する必要があるという依存関係があります。詳細は、「Teamsメディアトラフィックの設定と保護」を参照してください。
検証
ユーザが接続されると、「Non-Secured Routes」にACLで指定されたアドレスと「Dynamic Tunnel Exclusion」リストが表示されます。

