Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql PowerBI服务器列表_Postgresql_Powerbi_Firewall - Fatal编程技术网

Postgresql PowerBI服务器列表

Postgresql PowerBI服务器列表,postgresql,powerbi,firewall,Postgresql,Powerbi,Firewall,我在Postgresql数据库中有一个事实表,我知道如何使用PowerBI professional构建PowerBI分析。 如果我让Postgresql接受来自所有internet IP地址的连接,它可以工作,但不安全。我想限制对Power BI服务器的访问。 如何识别PowerBI传入流量?是否有设置防火墙的最佳做法?您不应打开任何来自Internet的连接。是的,您可以获得所有Azure IP地址的列表,但这并不限制它们仅支持BI,而且每年更新列表几次是一个手动过程。更好的解决方案是在您的

我在Postgresql数据库中有一个事实表,我知道如何使用PowerBI professional构建PowerBI分析。 如果我让Postgresql接受来自所有internet IP地址的连接,它可以工作,但不安全。我想限制对Power BI服务器的访问。
如何识别PowerBI传入流量?是否有设置防火墙的最佳做法?

您不应打开任何来自Internet的连接。是的,您可以获得所有Azure IP地址的列表,但这并不限制它们仅支持BI,而且每年更新列表几次是一个手动过程。更好的解决方案是在您的网络中安装,这将允许。

在我的情况下,我更喜欢偶尔用官方Microsoft列表中的白名单更新我的pg_hba.conf。生产文件将被新文件覆盖。脚本将替换注释行

#PowerBI
在带有新列表的模板pg_hba.conf文件中

import requests

whiteListUrl = "https://download.microsoft.com/download/7/1/D/71D86715-5596-4529-9B13-DA13A5DE5B63/ServiceTags_Public_20210524.json"
modelFile = "/path/to/template/pg_hba.conf"
outputFileName = "/path/to/production/pg_hba.conf"
userName = "power_bi"

response = requests.get(whiteListUrl)
whiteLists = response.json()

for group in whiteLists["values"]:
    if group["name"]!='PowerBI':
        continue
    text_file = open(modelFile, "r").read()
    whiteList = ""
    for address in group["properties"]["addressPrefixes"]:
        whiteList += "host    all     {}             {}            md5\n".format(userName, address)
    text_file = text_file.replace("#PowerBI", whiteList)

    textfile = open(outputFileName, "w")
    a = textfile.write(text_file)
    textfile.close()
使用新列表

import requests

whiteListUrl = "https://download.microsoft.com/download/7/1/D/71D86715-5596-4529-9B13-DA13A5DE5B63/ServiceTags_Public_20210524.json"
modelFile = "/path/to/template/pg_hba.conf"
outputFileName = "/path/to/production/pg_hba.conf"
userName = "power_bi"

response = requests.get(whiteListUrl)
whiteLists = response.json()

for group in whiteLists["values"]:
    if group["name"]!='PowerBI':
        continue
    text_file = open(modelFile, "r").read()
    whiteList = ""
    for address in group["properties"]["addressPrefixes"]:
        whiteList += "host    all     {}             {}            md5\n".format(userName, address)
    text_file = text_file.replace("#PowerBI", whiteList)

    textfile = open(outputFileName, "w")
    a = textfile.write(text_file)
    textfile.close()

您需要将Azure DC IP添加到您的白名单中。我的服务器是Linux Ubuntu macchine。我了解到本地linux实现还不可用。您可以将其安装在网络中任何可以访问Postgresql server的Windows计算机上。它不需要在同一台服务器上。