-
Notifications
You must be signed in to change notification settings - Fork 557
[windows] Add Windows AppLocker Data Stream (Packaged app-Deployment) #7393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
efd6
merged 16 commits into
elastic:main
from
nicpenning:windows-applocker-packaged-app-deployment
Aug 17, 2023
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f29b0bb
Update CODEOWNERS
nicpenning d2e2906
Merge branch 'elastic:main' into main
nicpenning 668427a
Test, Build and Deploy AppLocker Packaged App-Deployment
nicpenning f3c4011
Update changelog.yml
nicpenning 31246e9
Add new files
nicpenning 39c5551
Merge branch 'windows-applocker-packaged-app-deployment' of https://g…
nicpenning e6dd8f6
Update CODEOWNERS
nicpenning 0428aa5
Update changelog.yml
nicpenning bd3dc0d
Update packages/windows/data_stream/applocker_packaged_app_deployment…
nicpenning eb3293b
Update packages/windows/data_stream/applocker_packaged_app_deployment…
nicpenning 86738f4
Update packages/windows/data_stream/applocker_packaged_app_deployment…
nicpenning 486bb6d
Update packages/windows/data_stream/applocker_packaged_app_deployment…
nicpenning 679a58e
Update packages/windows/data_stream/applocker_packaged_app_deployment…
nicpenning f3badc0
Update test-events-microsoft-windows-applocker-packaged-app-deploymen…
nicpenning db66026
Update test-events-microsoft-windows-applocker-packaged-app-deploymen…
nicpenning 47773f2
Update default.yml
nicpenning File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...t/_dev/test/pipeline/test-events-microsoft-windows-applocker-packaged-app-deployment.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "events": [ | ||
| { | ||
| "@timestamp": "2023-08-15T14:12:32.6801945Z", | ||
| "event": { | ||
| "code": 8023, | ||
| "kind": "event", | ||
| "provider": "Microsoft-Windows-AppLocker" | ||
| }, | ||
| "host": { | ||
| "name": "WIN1012009LL.local" | ||
| }, | ||
| "log": { | ||
| "level": "Information" | ||
| }, | ||
| "message": "Microsoft.BingNews was allowed to be installed.", | ||
| "winlog": { | ||
| "activity_id": "eac4f4ed-cf73-0001-a741-c5ea73cfd901", | ||
| "channel": "Microsoft-Windows-AppLocker/Packaged app-Deployment", | ||
| "computer_name": "WIN1012009LL.local", | ||
| "user_data": { | ||
| "PolicyNameLength": "4", | ||
| "PolicyName": "APPX", | ||
| "RuleId": "{a9e18c21-ff8f-43cf-b9fc-db40eed693ba}", | ||
| "RuleNameLength": "39", | ||
| "RuleName": "(Default Rule) All signed packaged apps", | ||
| "RuleSddlLength": "81", | ||
| "RuleSddl": "D:(XA;;FX;;;S-1-1-0;((Exists APPID://FQBN) \u0026\u0026 ((APPID://FQBN) \u003e= ({\"*\\*\\*\",0}))))", | ||
| "TargetUser": "S-1-5-21-1133191089-1850170202-1535859923-200319", | ||
| "TargetProcessId": "4584", | ||
| "PackageLength": "18", | ||
| "Package": "Microsoft.BingNews", | ||
| "FqbnLength": "118", | ||
| "Fqbn": "CN=MICROSOFT CORPORATION, O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\MICROSOFT.BINGNEWS\\APPX\\4.55.62231.00" | ||
| }, | ||
| "event_id": "8023", | ||
| "level": "Information", | ||
| "opcode": "Info", | ||
| "process": { | ||
| "pid": 4584, | ||
| "thread": { | ||
| "id": 26688 | ||
| } | ||
| }, | ||
| "provider_guid": "cbda4dbf-8d5d-4f69-9578-be14aa540d22", | ||
| "provider_name": "Microsoft-Windows-AppLocker", | ||
| "record_id": 6269, | ||
| "time_created": "2023-08-15T14:12:32.6801945Z", | ||
| "user": { | ||
| "identifier": "S-1-5-21-1133191089-1850170202-1535859923-200319", | ||
| "name": "Topsy" | ||
| }, | ||
| "version": 0 | ||
| } | ||
| } | ||
| ] | ||
| } |
81 changes: 81 additions & 0 deletions
81
...peline/test-events-microsoft-windows-applocker-packaged-app-deployment.json-expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "@timestamp": "2023-08-15T14:12:32.680Z", | ||
| "ecs": { | ||
| "version": "8.9.0" | ||
| }, | ||
| "event": { | ||
| "category": "process", | ||
| "code": "8023", | ||
| "kind": "event", | ||
| "provider": "Microsoft-Windows-AppLocker", | ||
| "type": "start" | ||
| }, | ||
| "file": { | ||
| "pe": { | ||
| "file_version": "4.55.62231.00", | ||
| "original_file_name": "APPX", | ||
| "product": "MICROSOFT.BINGNEWS" | ||
| }, | ||
| "x509": { | ||
| "subject": { | ||
| "common_name": "MICROSOFT CORPORATION", | ||
| "country": "US", | ||
| "locality": "REDMOND", | ||
| "organization": "MICROSOFT CORPORATION", | ||
| "state_or_province": "WASHINGTON" | ||
| } | ||
| } | ||
| }, | ||
| "host": { | ||
| "name": "WIN1012009LL.local" | ||
| }, | ||
| "log": { | ||
| "level": "Information" | ||
| }, | ||
| "message": "Microsoft.BingNews was allowed to be installed.", | ||
| "user": { | ||
| "id": "S-1-5-21-1133191089-1850170202-1535859923-200319", | ||
| "name": "Topsy" | ||
| }, | ||
| "winlog": { | ||
| "activity_id": "eac4f4ed-cf73-0001-a741-c5ea73cfd901", | ||
| "channel": "Microsoft-Windows-AppLocker/Packaged app-Deployment", | ||
| "computer_name": "WIN1012009LL.local", | ||
| "event_id": "8023", | ||
| "level": "Information", | ||
| "opcode": "Info", | ||
| "process": { | ||
| "pid": 4584, | ||
| "thread": { | ||
| "id": 26688 | ||
| } | ||
| }, | ||
| "provider_guid": "cbda4dbf-8d5d-4f69-9578-be14aa540d22", | ||
| "provider_name": "Microsoft-Windows-AppLocker", | ||
| "record_id": "6269", | ||
| "time_created": "2023-08-15T14:12:32.6801945Z", | ||
| "user": { | ||
| "identifier": "S-1-5-21-1133191089-1850170202-1535859923-200319" | ||
| }, | ||
| "user_data": { | ||
| "Fqbn": "CN=MICROSOFT CORPORATION, O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\MICROSOFT.BINGNEWS\\APPX\\4.55.62231.00", | ||
| "FqbnLength": 118, | ||
| "Package": "Microsoft.BingNews", | ||
| "PackageLength": "18", | ||
| "PolicyName": "APPX", | ||
| "PolicyNameLength": 4, | ||
| "RuleId": "{a9e18c21-ff8f-43cf-b9fc-db40eed693ba}", | ||
| "RuleName": "(Default Rule) All signed packaged apps", | ||
| "RuleNameLength": 39, | ||
| "RuleSddl": "D:(XA;;FX;;;S-1-1-0;((Exists APPID://FQBN) \u0026\u0026 ((APPID://FQBN) \u003e= ({\"*\\*\\*\",0}))))", | ||
| "RuleSddlLength": 81, | ||
| "TargetProcessId": 4584, | ||
| "TargetUser": "S-1-5-21-1133191089-1850170202-1535859923-200319" | ||
| }, | ||
| "version": 0 | ||
| } | ||
| } | ||
| ] | ||
| } |
10 changes: 10 additions & 0 deletions
10
...ws/data_stream/applocker_packaged_app_deployment/_dev/test/system/test-default-config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| input: httpjson | ||
| service: splunk-mock | ||
| vars: | ||
| url: http://{{Hostname}}:{{Port}} | ||
| username: test | ||
| password: test | ||
| enable_request_tracer: true | ||
| data_stream: | ||
| vars: | ||
| preserve_original_event: true |
104 changes: 104 additions & 0 deletions
104
packages/windows/data_stream/applocker_packaged_app_deployment/agent/stream/httpjson.yml.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| config_version: "2" | ||
| interval: {{interval}} | ||
| {{#if enable_request_tracer}} | ||
| request.tracer.filename: "../../logs/httpjson/http-request-trace-*.ndjson" | ||
| {{/if}} | ||
| {{#unless token}} | ||
| {{#if username}} | ||
| {{#if password}} | ||
| auth.basic.user: {{username}} | ||
| auth.basic.password: {{password}} | ||
| {{/if}} | ||
| {{/if}} | ||
| {{/unless}} | ||
| cursor: | ||
| index_earliest: | ||
| value: '[[.last_event.result.max_indextime]]' | ||
| request.url: {{url}}/services/search/jobs/export | ||
| {{#if ssl}} | ||
| request.ssl: {{ssl}} | ||
| {{/if}} | ||
| request.method: POST | ||
| request.transforms: | ||
| - set: | ||
| target: url.params.search | ||
| value: |- | ||
| {{search}} | streamstats max(_indextime) AS max_indextime | ||
| - set: | ||
| target: url.params.output_mode | ||
| value: "json" | ||
| - set: | ||
| target: url.params.index_earliest | ||
| value: '[[ .cursor.index_earliest ]]' | ||
| default: '[[(now (parseDuration "-{{interval}}")).Unix]]' | ||
| - set: | ||
| target: url.params.index_latest | ||
| value: '[[(now).Unix]]' | ||
| - set: | ||
| target: header.Content-Type | ||
| value: application/x-www-form-urlencoded | ||
| {{#unless username}} | ||
| {{#unless password}} | ||
| {{#if token}} | ||
| - set: | ||
| target: header.Authorization | ||
| value: {{token}} | ||
| {{/if}} | ||
| {{/unless}} | ||
| {{/unless}} | ||
| response.decode_as: application/x-ndjson | ||
| {{#if tags.length}} | ||
| tags: | ||
| {{else if preserve_original_event}} | ||
| tags: | ||
| {{/if}} | ||
| {{#each tags as |tag|}} | ||
| - {{tag}} | ||
| {{/each}} | ||
| {{#if preserve_original_event}} | ||
| - preserve_original_event | ||
| {{/if}} | ||
| {{#contains "forwarded" tags}} | ||
| publisher_pipeline.disable_host: true | ||
| {{/contains}} | ||
| processors: | ||
| - decode_json_fields: | ||
| fields: message | ||
| target: json | ||
| add_error_key: true | ||
| - drop_event: | ||
| when: | ||
| not: | ||
| has_fields: ['json.result'] | ||
| - fingerprint: | ||
| fields: | ||
| - json.result._cd | ||
| - json.result._indextime | ||
| - json.result._raw | ||
| - json.result._time | ||
| - json.result.host | ||
| - json.result.source | ||
| target_field: "@metadata._id" | ||
| - drop_fields: | ||
| fields: message | ||
| - rename: | ||
| fields: | ||
| - from: json.result._raw | ||
| to: event.original | ||
| - from: json.result.host | ||
| to: host.name | ||
| - from: json.result.source | ||
| to: event.provider | ||
| ignore_missing: true | ||
| fail_on_error: false | ||
| - drop_fields: | ||
| fields: json | ||
| - decode_xml_wineventlog: | ||
| field: event.original | ||
| target_field: winlog | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| map_ecs_fields: true | ||
| {{#if processors.length}} | ||
| {{processors}} | ||
| {{/if}} | ||
31 changes: 31 additions & 0 deletions
31
packages/windows/data_stream/applocker_packaged_app_deployment/agent/stream/winlog.yml.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Microsoft-Windows-AppLocker/Packaged app-Deployment | ||
| condition: ${host.platform} == 'windows' | ||
| {{#if event_id}} | ||
| event_id: {{event_id}} | ||
| {{/if}} | ||
| {{#if ignore_older}} | ||
| ignore_older: {{ignore_older}} | ||
| {{/if}} | ||
| {{#if language}} | ||
| language: {{language}} | ||
| {{/if}} | ||
| {{#if tags.length}} | ||
| tags: | ||
| {{#each tags as |tag|}} | ||
| - {{tag}} | ||
| {{/each}} | ||
| {{/if}} | ||
| {{#if preserve_original_event}} | ||
| include_xml: true | ||
| {{/if}} | ||
| processors: | ||
| - translate_sid: | ||
| field: winlog.event_data.MemberSid | ||
| account_name_target: winlog.event_data._MemberUserName | ||
| domain_target: winlog.event_data._MemberDomain | ||
| account_type_target: winlog.event_data._MemberAccountType | ||
| ignore_missing: true | ||
| ignore_failure: true | ||
| {{#if processors.length}} | ||
| {{processors}} | ||
| {{/if}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.