Skip to content

test #159

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

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

test #159

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fd981e8
Set up CI with Azure Pipelines
w09rkerbee Sep 7, 2021
5000259
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 7, 2021
76a7e0f
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 7, 2021
00a9e45
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
b734855
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
e89a8fd
Update azure-pipelines.yml for Azure Pipelines installation
w09rkerbee Sep 10, 2021
796b8fe
Update azure-pipelines.yml for Azure Pipelines installation
w09rkerbee Sep 10, 2021
547b11e
Update azure-pipelines.yml for Azure Pipelines installation
w09rkerbee Sep 10, 2021
13312e0
Update azure-pipelines.yml for Azure Pipelines installation
w09rkerbee Sep 10, 2021
08af290
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
b6ce8f6
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
b563eae
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
667c78d
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
97ac4c0
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
d24d964
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
f30a03b
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
30150bf
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 10, 2021
40b093f
Update sysmonconfig-export.xml
w09rkerbee Sep 10, 2021
86f7612
Update azure-pipelines.yml fir defaults for rest of install
w09rkerbee Sep 13, 2021
d1009ff
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 13, 2021
5535540
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 13, 2021
58ca17c
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 13, 2021
e092e5a
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 13, 2021
525e285
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 13, 2021
dc2bba7
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 13, 2021
f8853e1
Update azure-pipelines.yml for Azure Pipelines
w09rkerbee Sep 14, 2021
5cf4ea2
Merge branch 'SwiftOnSecurity:master' into master
w09rkerbee Sep 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

pool:
vmImage: windows-2019
demands: Limit -equals DisAbleParallel

steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "downloading sysmon..."
$sysmonDir = "C:\Sysmon"

If (!(test-path $sysmonDir)) {
New-Item -ItemType Directory -Force -Path $sysmonDir} Else {
Write-Host "Sysmon directory exists. Exiting"
exit
}

$sysmonPath = "C:\Sysmon\Sysmon.exe"
$sysmonConfigPath = "D:\a\1\s\sysmonconfig.xml"

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

(New-Object System.Net.WebClient).DownloadFile('https://live.sysinternals.com/Sysmon.exe', $sysmonPath)
failOnStderr: true


- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$sysmonDir= "C:\Sysmon"

Write-Host "Installing Sysmon"
Start-Process -FilePath "$sysmonDir\Sysmon.exe" -ArgumentList "-accepteula -i"

Write-Host "verify that sysmon service is running..."
Start-Sleep 5
If ((Get-Service -name Sysmon).Status -ne "Running") {
throw "The sysmon service did NOT start"
}
failOnStderr: true

- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$sysmonConfigPath = "D:\a\1\s\sysmonconfig-export.xml"

Write-Host "Loading sysmon config"
$sysmon = C:\Sysmon\Sysmon.exe -c $sysmonConfigPath
$sysmon 2> $null
if($sysmon -like '*Configuration updated.*') {Write-Host "all good!"} else {throw "Error loading sysmon config to sysmon"}
failOnStderr: false

- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Install-PackageProvider -Name Nuget -MinimumVersion 2.8.5.201 -Force
Set-MpPreference -DisableRealtimeMonitoring $true


- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# install ART; installing the atomics takes a long while
IEX (IWR 'https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1' -UseBasicParsing);
Install-AtomicRedTeam -getAtomics -Force


- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# Clear all sysmon events before invoking ART

$evtsession = [System.Diagnostics.Eventing.Reader.EventLogSession]::New("localhost")
$evtsession.ClearLog("Microsoft-Windows-Sysmon/Operational")


- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# then first pull out the windows events at the time

get-winevent -FilterHashtable @{LogName="Microsoft-Windows-Sysmon/Operational";} | format-table -wrap | Out-File -FilePath .\beforeTest


- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# Run specific ART tests
Invoke-AtomicTest T1218.010 -TestNumbers 1,2

- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# pull events after the ART test(s); then diff

get-winevent -FilterHashtable @{LogName="Microsoft-Windows-Sysmon/Operational";} | format-table -wrap | Out-File -FilePath .\afterTest
compare-object (get-content .\beforeTest) (get-content .\afterTest)| Out-File -FilePath atomicT1218.010_sysmonResults


3 changes: 2 additions & 1 deletion sysmonconfig-export.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!--
testing the devops pipeline
sysmon-config | A Sysmon configuration focused on default high-quality event tracing and easy customization by the community
Source version: 74 | Date: 2021-07-08
Source project: https://github.com/SwiftOnSecurity/sysmon-config
Expand Down Expand Up @@ -1157,4 +1158,4 @@
<!--Cannot be filtered.-->

</EventFiltering>
</Sysmon>
</Sysmon>