zoukankan      html  css  js  c++  java
  • Azure Database for MySQL Connection Security -(3) Private Endpoint

    本文介绍:

    Azure Database for MySQL 安全连接的第三种方式:Private endpoint connections

    案例:创建MySQL private endpoint connection;

               在相同VNET里的VM里通过private endpoint 连接到MySQL;

               跨VNET的 VM无法通过private endpoint 连接到MySQL;

    图文步骤:

    (一)禁用公网访问:

    Deny public network access 设置为Yes


    (二)创建Private endpoint connection

    创建Private endpoint的两个入口:

    入口(1)从MySQL页面创建 private endpoint

    入口(2)Private link center 入口创建 private endpoint

    选择资源组,设定Name,选择Region:

    选择“create private endpoint”按钮:

    本例中Resource Type选择“Microsoft.DBforMySQL/servers”,  然后在下拉列表中选择要设置的MySQL服务器,Target sub-resource 默认为mysqlServer:

    选择一个虚拟网络和子网,默认会创建一个新的Private DNS Zone,按照提示将 Integration with private dns zone 设定为 yes即可:


     
     
    (三)验证VNET下使用Private endpoint 连接MySQL

    创建完成后,转到资源,可以看到如下页面,本例中,为MySQL分配了一个Private IP 10.1.0.5

    同时在MySQL的private endpoint connection 页面可以看到如下的 connection已经创建完成:

    在资源组中,可以找到已经创建的Private endpoint 和 Private DNS Zone:

    点击Private DNS Zone进入,可以看到增加了一条A记录,A记录是域名到IP的绑定,如下图所示,Private link的域名应该是标注1 和标注 2的 组合:

    本例中应该为:sean-mysql.privatelink.mysql.database.azure.com

    测试从专用IP地址(内网IP)或Private link的 域名 连接到MySQL:

    本例中选择 Private endpoint 相同的 VNET下的一台VM,注意,此VM和private endpoint 在不同的 子网中:

    本立中使用 sean-mysql.privatelink.mysql.database.azure.com 或者 10.1.0.5 都可以访问MySQL服务器

    在虚拟机中使用nslookup sean-mysql.privatelink.mysql.database.azure.com,查看 域名解析情况,得到 如下图内网专用IP:

    使用跨VNET的VM通过private endpoint 连接MySQL:

    因为配置private endpoint时 将Deny public network access 设置为Yes,无法连接,提示如下:Client with IP "xxx" is not allowed to connect to this MySQL server.



  • 相关阅读:
    【转】Linux逻辑卷管理
    oracle range分区表已经有了MAXVALUE 分区,如何添加分区?要不能删除MAXVALUE分区里的数据,不影响在线应用。
    切换用户后whoami打印用户的问题
    tomcat版本号修改已dwr配置错误安全漏洞整改
    [LeetCode]: 64: Minimum Path Sum
    [LeetCode]: 292: Nim Game
    [LeetCode]: 22 : Generate Parentheses
    [LeetCode]: 121: Best Time to Buy and Sell Stock
    [LeetCode]: 62: Unique Paths
    [LeetCode]: 145: Binary Tree Postorder Traversal
  • 原文地址:https://www.cnblogs.com/shuzhenyu/p/13571992.html
Copyright © 2011-2022 走看看