在Azure Sentinel笔记本上运行配置Msticpy时会出现错误
我正在使用Azure Sentinel笔记本进行威胁智能。试图配置Msticpy以使其连接到Azure Sentinel,但要获得“值错误”。以下是我使用的代码:
from msticpy.config import MpConfigEdit
import os
mp_conf = "msticpyconfig.yaml"
# check if MSTICPYCONFIG is already an env variable
mp_env = os.environ.get("MSTICPYCONFIG")
mp_conf = mp_env if mp_env and Path (mp_env).is_file() else mp_conf
if not Path(mp_conf).is_file():
print(
"No msticpyconfig.yaml was found!",
"Please check that there is a config.json file in your workspace folder.",
"If this is not there, go back to the Microsoft Sentinel portal and launch",
"this notebook from there.",
sep="\n"
)
else:
mpedit = MpConfigEdit(mp_conf)
mpedit.set_tab("AzureSentinel")
display(mpedit)
ValueError: File not found: 'None'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在Azure ML终端中,在用户文件夹的根部中创建 nbuser_settings.py 文件,该文件是带有用户名的文件夹。
在 nbuser_settings.py 文件中,添加以下行:
https://learn.microsoft.com/en-us/Azure/sentinel/notebooks-msticpy-advanced?msclkid=e7cd84dfd05c11ecb0df15e0892300fc&tabs=azure-ml
参考
msticpy 的某些元素需要配置参数。一个例子是威胁情报提供商。这些参数的值可以在msticpyconfig.yaml文件中设置。
该软件包具有默认配置文件,该文件存储在软件包目录中。您不需要直接编辑此文件。取而代之的是,您可以使用自己的参数创建自定义文件 - 这些设置将与默认文件中的设置相结合或覆盖设置。
默认情况下,从当前目录中读取自定义msticpyconfig.yaml。您可以使用环境变量
msticpyConfig
指定明确的位置。您还应该读取Msticpy设置编辑器文档,以查看如何使用Jupyter Notebook中使用和交互式用户界面配置设置。
!!!!笔记 !!!对于Linux和Windows选项,您需要重新启动Jupyter服务器才能拾取定义的环境变量。
In the Azure ML terminal, create the nbuser_settings.py file in the root of your user folder, which is the folder with your username.
In the nbuser_settings.py file, add the following lines:
https://learn.microsoft.com/en-us/Azure/sentinel/notebooks-msticpy-advanced?msclkid=e7cd84dfd05c11ecb0df15e0892300fc&tabs=azure-ml
Reference
Some elements of MSTICPy require configuration parameters. An example is the Threat Intelligence providers. Values for these and other parameters can be set in the msticpyconfig.yaml file.
The package has a default configuration file, which is stored in the package directory. You should not need to edit this file directly. Instead you can create a custom file with your own parameters - these settings will combine with or override the settings in the default file.
By default, the custom msticpyconfig.yaml is read from the current directory. You can specify an explicit location using an environment variable
MSTICPYCONFIG
.You should also read the MSTICPy Settings Editor document to see how to configure settings using and interactive User Interface from a Jupyter notebook.
!!! NOTE !!! For the Linux and Windows options, you'll need to restart your Jupyter server for it to pick up the environment variable that you defined.
https://msticpy.readthedocs.io/en/latest/getting_started/msticpyconfig.html?msclkid=96fde57dd04d11ec9e5406de243d7c67
Msticpy的作者已在Github&我们必须等待最新版本。请以更多详细信息,请点击线程:
https://github.com/microsoft/microsoft/msticpy/issues/msticpy/issues/ 393
The author of msticpy has posted the issue on github & we have to wait for the latest release. Please follow the thread for more details:
https://github.com/microsoft/msticpy/issues/393