From fa3fc4a0c356e7d26dfb15a86439d063aa99385d Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 15 Apr 2025 16:01:36 +0100 Subject: [PATCH] PS: Fix more problems in MaD rows for sources. --- .../frameworks/MicrosoftWin32/model.yml | 4 ---- .../powershell/frameworks/System/model.yml | 2 +- .../powershell/frameworks/SystemIO/model.yml | 20 +++++++++---------- .../model.yml | 2 +- .../model.yml | 4 ++-- .../frameworks/SystemNetSockets/model.yml | 8 ++++---- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/powershell/ql/lib/semmle/code/powershell/frameworks/MicrosoftWin32/model.yml b/powershell/ql/lib/semmle/code/powershell/frameworks/MicrosoftWin32/model.yml index f9ae972381f..b68fe45c24d 100644 --- a/powershell/ql/lib/semmle/code/powershell/frameworks/MicrosoftWin32/model.yml +++ b/powershell/ql/lib/semmle/code/powershell/frameworks/MicrosoftWin32/model.yml @@ -7,10 +7,6 @@ extensions: - ["microsoft.win32.registrykey", "Method[getvalue].ReturnValue", "windows-registry"] - ["microsoft.win32.registrykey", "Method[getvaluenames].ReturnValue", "windows-registry"] - ["microsoft.win32.registrykey", "Method[getsubkeynames].ReturnValue", "windows-registry"] - - ["microsoft.win32.registry!", "Method[getvalue].ReturnValue", "windows-registry"] - - ["microsoft.win32.registrykey", "Method[getvalue].ReturnValue", "windows-registry"] - - ["microsoft.win32.registrykey", "Method[getvaluenames].ReturnValue", "windows-registry"] - - ["microsoft.win32.registrykey", "Method[getsubkeynames].ReturnValue", "windows-registry"] - addsTo: pack: microsoft-sdl/powershell-all diff --git a/powershell/ql/lib/semmle/code/powershell/frameworks/System/model.yml b/powershell/ql/lib/semmle/code/powershell/frameworks/System/model.yml index 71f5c80882c..2ef1f5aa2ac 100644 --- a/powershell/ql/lib/semmle/code/powershell/frameworks/System/model.yml +++ b/powershell/ql/lib/semmle/code/powershell/frameworks/System/model.yml @@ -9,7 +9,7 @@ extensions: - ["system.environment!", "Method[expandenvironmentvariables].ReturnValue", "environment"] - ["system.environment!", "Method[getcommandlineargs].ReturnValue", "command-line"] - ["system.environment!", "Method[getenvironmentvariable].ReturnValue", "environment"] - - ["system.environment!", "Method[getenvironmentvariables].ReturnValue", "environment"] + - ["system.environment!", "Method[getenvironmentvariables].ReturnValue", "environment"] - addsTo: pack: microsoft-sdl/powershell-all diff --git a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemIO/model.yml b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemIO/model.yml index b76389c2dc8..f017257c3ae 100644 --- a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemIO/model.yml +++ b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemIO/model.yml @@ -19,16 +19,16 @@ extensions: - ["system.io.file!", "Method[readalltextasync].ReturnValue", "file"] - ["system.io.file!", "Method[readlines].ReturnValue", "file"] - ["system.io.file!", "Method[readlinesasync].ReturnValue", "file"] - - ["system.io.fileInfo!", "Method[appendtext].ReturnValue", "file-write"] - - ["system.io.fileInfo!", "Method[create].ReturnValue", "file-write"] - - ["system.io.fileInfo!", "Method[createtext].ReturnValue", "file-write"] - - ["system.io.fileInfo!", "Method[open].ReturnValue", "file-write"] - - ["system.io.fileInfo!", "Method[open].ReturnValue", "file"] - - ["system.io.fileInfo!", "Method[openread].ReturnValue", "file"] - - ["system.io.fileInfo!", "Method[opentext].ReturnValue", "file"] - - ["system.io.fileInfo!", "Method[openwrite].ReturnValue", "file-write"] - - ["system.io.fileStream", "Instance", "file"] - - ["system.io.fileStream", "Instance", "file-write"] + - ["system.io.fileinfo", "Method[appendtext].ReturnValue", "file-write"] + - ["system.io.fileinfo", "Method[create].ReturnValue", "file-write"] + - ["system.io.fileinfo", "Method[createtext].ReturnValue", "file-write"] + - ["system.io.fileinfo", "Method[open].ReturnValue", "file-write"] + - ["system.io.fileinfo", "Method[open].ReturnValue", "file"] + - ["system.io.fileinfo", "Method[openread].ReturnValue", "file"] + - ["system.io.fileinfo", "Method[opentext].ReturnValue", "file"] + - ["system.io.fileinfo", "Method[openwrite].ReturnValue", "file-write"] + - ["system.io.filestream", "Instance", "file"] + - ["system.io.filestream", "Instance", "file-write"] - ["system.io.streamwriter", "Instance", "file-write"] - addsTo: diff --git a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationEngineIntrinsics/model.yml b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationEngineIntrinsics/model.yml index 0d3375fa025..a90e8af103d 100644 --- a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationEngineIntrinsics/model.yml +++ b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationEngineIntrinsics/model.yml @@ -9,7 +9,7 @@ extensions: pack: microsoft-sdl/powershell-all extensible: typeModel data: - - ["system.management.automation.commandinvocationintrinsics","System.Management.Automation.EngineIntrinsics","Member[InvokeCommand]"] + - ["system.management.automation.commandinvocationintrinsics", "System.Management.Automation.EngineIntrinsics","Member[InvokeCommand]"] - addsTo: pack: microsoft-sdl/powershell-all diff --git a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationPowerShell/model.yml b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationPowerShell/model.yml index 2701b87b07d..5260ab618e2 100644 --- a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationPowerShell/model.yml +++ b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemManagementAutomationPowerShell/model.yml @@ -4,13 +4,13 @@ extensions: extensible: sinkModel data: - ["system.management.automation.powershell", "Method[addscript].Argument[0]", "command-injection"] - - ["System.Management.Automation.ScriptBlock!", "Method[create].Argument[0]", "command-injection"] + - ["system.management.automation.scriptblock!", "Method[create].Argument[0]", "command-injection"] - addsTo: pack: microsoft-sdl/powershell-all extensible: typeModel data: - - ["system.management.automation.powershell","system.management.automation.powershell!","Method[create].ReturnValue"] + - ["system.management.automation.powershell", "system.management.automation.powershell!","Method[create].ReturnValue"] - addsTo: pack: microsoft-sdl/powershell-all diff --git a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemNetSockets/model.yml b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemNetSockets/model.yml index 3116e9776a9..733e2c8b06d 100644 --- a/powershell/ql/lib/semmle/code/powershell/frameworks/SystemNetSockets/model.yml +++ b/powershell/ql/lib/semmle/code/powershell/frameworks/SystemNetSockets/model.yml @@ -3,10 +3,10 @@ extensions: pack: microsoft-sdl/powershell-all extensible: sourceModel data: - - ["System.Net.Sockets.TcpClient", "Method[GetStream].ReturnValue", "remote"] - - ["system.net.sockets.udpclient", "Method[EndReceive].ReturnValue", "remote"] - - ["system.net.sockets.udpclient", "Method[Receive].ReturnValue", "remote"] - - ["system.net.sockets.udpclient", "Method[ReceiveAsync].ReturnValue", "remote"] + - ["system.net.sockets.tcpclient", "Method[getstream].ReturnValue", "remote"] + - ["system.net.sockets.udpclient", "Method[endreceive].ReturnValue", "remote"] + - ["system.net.sockets.udpclient", "Method[receive].ReturnValue", "remote"] + - ["system.net.sockets.udpclient", "Method[receiveasync].ReturnValue", "remote"] - addsTo: pack: microsoft-sdl/powershell-all