Skip to content

Commit ca5f737

Browse files
authored
[BugFix] PowerShell - Fix user.name, user.domain, and script_block_signature (#15834)
* [BugFix] PowerShell - Fix `user.name`, `user.domain`, and `script_block_signature` * Update packages/windows/changelog.yml * add related.hosts * ++
1 parent 4aa233e commit ca5f737

File tree

10 files changed

+816
-509
lines changed

10 files changed

+816
-509
lines changed

packages/windows/changelog.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# newer versions go on top
2+
- version: "3.2.1"
3+
changes:
4+
- description: |
5+
Fix PowerShell pipeline to correctly populate `user.domain`, `user.name`, and `script_block_signature` fields.
6+
type: bugfix
7+
link: https://github.com/elastic/integrations/pull/15834
28
- version: "3.2.0"
39
changes:
410
- description: Expose the "Perfmon Match By Parent Instance" option in Windows Perfmon (default=true). When unchecked, unique instance names are used for processes with the same name.
511
type: enhancement
612
link: https://github.com/elastic/integrations/pull/15763
713
- version: "3.1.3"
814
changes:
9-
- description: Add powershell.file.script_block_entropy and powershell.file.script_block_entropy_normalized fields.
15+
- description: |
16+
Add powershell.file.script_block_entropy_bits, powershell.file.script_block_surprisal_stdev,
17+
powershell.file.script_block_length, and powershell.file.script_block_unique_symbols fields to improve context.
1018
type: enhancement
1119
link: https://github.com/elastic/integrations/pull/15698
1220
- version: "3.1.2"

packages/windows/data_stream/forwarded/_dev/test/pipeline/test-powershell-events.json

Lines changed: 144 additions & 171 deletions
Large diffs are not rendered by default.

packages/windows/data_stream/forwarded/_dev/test/pipeline/test-powershell-events.json-expected.json

Lines changed: 429 additions & 265 deletions
Large diffs are not rendered by default.

packages/windows/data_stream/forwarded/_dev/test/pipeline/test-powershell-operational-events.json

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"winlog": {
66
"time_created": "2020-05-13T09:04:04.755Z",
77
"user": {
8-
"identifier": "S-1-5-21-1350058589-2282154016-2764056528-1000"
8+
"identifier": "S-1-5-21-2882078887-1352635951-3305458046-1000",
9+
"domain": "DESKTOP-6RJHI71",
10+
"name": "JohnDoe",
11+
"type": "User"
912
},
1013
"activity_id": "{dd68516a-2930-0000-5962-68dd3029d601}",
1114
"process": {
@@ -66,7 +69,10 @@
6669
"time_created": "2020-05-15T08:11:47.897Z",
6770
"level": "information",
6871
"user": {
69-
"identifier": "S-1-5-21-1350058589-2282154016-2764056528-1000"
72+
"identifier": "S-1-5-21-2882078887-1352635951-3305458046-1000",
73+
"domain": "DESKTOP-6RJHI71",
74+
"name": "JohnDoe",
75+
"type": "User"
7076
},
7177
"activity_id": "{1aca0717-2acb-0002-c208-ca1acb2ad601}"
7278
},
@@ -102,7 +108,10 @@
102108
],
103109
"winlog": {
104110
"user": {
105-
"identifier": "S-1-5-21-1350058589-2282154016-2764056528-1000"
111+
"identifier": "S-1-5-21-2882078887-1352635951-3305458046-1000",
112+
"domain": "DESKTOP-6RJHI71",
113+
"name": "JohnDoe",
114+
"type": "User"
106115
},
107116
"activity_id": "{e3200b8a-290e-0002-332a-20e30e29d601}",
108117
"channel": "Microsoft-Windows-PowerShell/Operational",
@@ -148,7 +157,7 @@
148157
"event_data": {
149158
"MessageNumber": "1",
150159
"MessageTotal": "1",
151-
"ScriptBlockText": "# SIG # Begin signature block\n# MIIbDQYJKoZIhvcNAQcCoIIa/jCCGvoCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB\n# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR\n# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUxKaXN7doWq+mq18IrzABoXMr\n# 4l6gghXyMIIEoDCCA4igAwIBAgIKYRr16gAAAAAAajANBgkqhkiG9w0BAQUFADB5\n# MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVk\n# bW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSMwIQYDVQQDExpN\n# aWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQTAeFw0xMTExMDEyMjM5MTdaFw0xMzAy\n# MDEyMjQ5MTdaMIGDMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQ\n# MA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n# SIG # End signature block\n\n.\\patata.ps1",
160+
"ScriptBlockText": "###\n# ==++==\n#\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n###\n@{\n GUID = \"4ae9fd46-338a-459c-8186-07f910774cb8\"\n Author = \"Microsoft Corporation\"\n CompanyName = \"Microsoft Corporation\"\n Copyright = \"(C) Microsoft Corporation. All rights reserved.\"\n HelpInfoUri = \"https://go.microsoft.com/fwlink/?linkid=2113634\"\n ModuleVersion = \"1.4.8.1\"\n PowerShellVersion = \"3.0\"\n ClrVersion = \"4.0\"\n RootModule = \"PackageManagement.psm1\"\n\tDescription = 'PackageManagement (a.k.a. OneGet) is a new way to discover and install software packages from around the web.\n It is a manager or multiplexor of existing package managers (also called package providers) that unifies Windows package management with a single Windows PowerShell interface. With PackageManagement, you can do the following.\n - Manage a list of software repositories in which packages can be searched, acquired and installed\n - Discover software packages\n - Seamlessly install, uninstall, and inventory packages from one or more software repositories'\n\n CmdletsToExport = @(\n 'Find-Package',\n 'Get-Package',\n 'Get-PackageProvider',\n 'Get-PackageSource',\n 'Install-Package',\n 'Import-PackageProvider'\n 'Find-PackageProvider'\n 'Install-PackageProvider'\n 'Register-PackageSource',\n 'Set-PackageSource',\n 'Unregister-PackageSource',\n 'Uninstall-Package'\n 'Save-Package'\n\t)\n\n\tFormatsToProcess = @('PackageManagement.format.ps1xml')\n\n\tPrivateData = @{\n PSData = @{\n Tags = @('PackageManagement', 'PSEdition_Core', 'PSEdition_Desktop', 'Linux', 'Mac')\n ProjectUri = 'https://oneget.org'\n ReleaseNotes = @'\n## 1.4.8.1\n- Update PackageManagement's strong name signing\n\n## 1.4.8\n- Add NuGet as a source when generating nuget.config file for user in the NuGet Provider\n\n## 1.4.7\n- Update security protocol to use TLS 1.2\n- Remove catalog file\n\n## 1.4.6\n- Update `HelpInfoUri` to point to the latest content\n\n## 1.4.5\n- Bug fix for deadlock when getting parameters in an event\n\n## 1.4.4\n- Bug fix when installing modules from private feeds\n\n ## 1.4.3\n- Another bug fix when registering repositories with PowerShellGet\n\n## 1.4.2\n- Bug fix for passing credentials from PowerShellGet when registering repositories\n\n## 1.4.1\n- Bug fix for using credential provider installed in Visual Studio\n\n## 1.4\n- Allow credential persistance for registering private repositories and finding or installing packages from those repositories\n\n## 1.3.2\n- Enable bootstrap on PSCore\n- Bug fix to run on .NET Core 3.0\n\n## 1.3.1\n- Targets net452 and netstandard2.0 instead of net451, netcoreapp2.0, and netstandard1.6\n \n## Previous releases are not included in this Changelog\n'@\n }\n }\n}\n\n# SIG # Begin signature block\n# MIInoQYJKoZIhvcNAQcCoIInkjCCJ44CAQExDzANBglghkgBZQMEAgEFADB5Bgor\n# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG\n# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCANw97w1D+bi5LY\n# 8ZEuubcA0tI0Z0h+CImFRYop+IIqQaCCDYEwggX/MIID56ADAgECAhMzAAACUosz\n# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD\n# +nC4D7IMA1+6smM7fbSJa7o4BHfyje8PHB3w9GF223mZTG0EhBlultQkMSpV/c88\n# 9hsbwx16Cr5sY9M/lSRt4oC3qzSuTmYd6VYJ/ILt9ptrpOkaYCiXXRx8Cfz7w53w\n# Au/J8xJjNWvrKxkcc8XiUXPfGGTXujyiS2MqvztBkg6wCduFKqogmvOtQiiwQQxE\n# G6lU/rss27omoTUc41EawOr1km5y+fUS9aoYX9K8NNhFH6TSni3dp/+Hiyif1T7X\n# g0cBy4yHuYxMmRrFcmGeplW3KhXHfkJjbHaVs1QgnRfkgFuypwF5YoFWrW7Xgj+a\n# ZCDKSoYq45E4v0ryIvyu0shBoHQXREAzpBv3L9h5A9vEFQG4alCI57oSbdqJ1YIa\n# ggkTQHR2CWdB7FnQilCqqZjSnAtXYZh/RD+PX6fg1UyUUQf5ohnw951pQeKYTYHm\n# Fwut+RibzdbHEF/kLZr6SZsDupCv\n# SIG # End signature block",
152161
"ScriptBlockId": "50d2dbda-7361-4926-a94d-d9eadfdb43fa"
153162
},
154163
"provider_name": "Microsoft-Windows-PowerShell",
@@ -158,7 +167,10 @@
158167
"provider_guid": "{a0c1853b-5c40-4b15-8766-3cf1c58f985a}",
159168
"time_created": "2020-05-14T11:33:51.389Z",
160169
"user": {
161-
"identifier": "S-1-5-21-1350058589-2282154016-2764056528-1000"
170+
"identifier": "S-1-5-21-2882078887-1352635951-3305458046-1000",
171+
"domain": "DESKTOP-6RJHI71",
172+
"name": "JohnDoe",
173+
"type": "User"
162174
},
163175
"activity_id": "{fb13c9de-29f7-0001-18e0-13fbf729d601}",
164176
"channel": "Microsoft-Windows-PowerShell/Operational",
@@ -255,7 +267,10 @@
255267
"task": "Executing Pipeline",
256268
"time_created": "2023-06-01T05:27:01.2479769Z",
257269
"user": {
258-
"identifier": "S-1-5-5"
270+
"identifier": "S-1-5-21-2882078887-1352635951-3305458046-1000",
271+
"domain": "DESKTOP-6RJHI71",
272+
"name": "JohnDoe",
273+
"type": "User"
259274
},
260275
"version": 1
261276
}

0 commit comments

Comments
 (0)