From 0fb2576dfd224bd90b2364ce68cd88a479712c0b Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Fri, 19 Jun 2020 16:00:31 +0200 Subject: [PATCH] Removed several outdated configuration files (#3015) --- config/jenkins/windows/bootstrap-vm.ps1 | 81 ----- .../windows/plaso_end_to_end_windows.ps1 | 165 --------- config/vagrant/Vagrantfile | 30 -- data/plaso_kibana_example.json | 329 ------------------ 4 files changed, 605 deletions(-) delete mode 100644 config/jenkins/windows/bootstrap-vm.ps1 delete mode 100644 config/jenkins/windows/plaso_end_to_end_windows.ps1 delete mode 100644 config/vagrant/Vagrantfile delete mode 100644 data/plaso_kibana_example.json diff --git a/config/jenkins/windows/bootstrap-vm.ps1 b/config/jenkins/windows/bootstrap-vm.ps1 deleted file mode 100644 index f0961eabd9..0000000000 --- a/config/jenkins/windows/bootstrap-vm.ps1 +++ /dev/null @@ -1,81 +0,0 @@ -# Avoid re-running -if (Test-Path -Path $data_directory) { - Write-Host 'Tools already present, exiting startup script.' - exit -} - -## Set up default URLs and Paths -$install_log_path = "$($data_directory)\provision.log" -$jenkins_slave_path = "$($jenkins_home_directory)\slave.jar" -$vc_for_python_url = 'https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi' -$vc_for_python_path = "$($data_directory)\VCForPython27.msi" -$vs_registry_key_path = 'HKLM:\Software\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC' -$vs_registry_key_value = "C:\Users\$($username)\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0" - -mkdir $data_directory - -## Download & install Visual Studio for Python -echo "Downloading $($vc_for_python_url) to $($vc_for_python_path)" | Tee-Object -Append -FilePath $install_log_path -(New-Object System.Net.WebClient).DownloadFile($vc_for_python_url, $vc_for_python_path) -echo 'Download complete, now installing' | Tee-Object -Append -FilePath $install_log_path -$msiexec_arguments=@" -/i $($vc_for_python_path) ROOT="$($vs_registry_key_value)" /qn /L*+ $($install_log_path) -"@ -Start-Process msiexec.exe -Wait -ArgumentList $msiexec_arguments -echo "Adding registry key $($vs_registry_key_path)\productdir with value $($vs_registry_key_value)" | Tee-Object -Append -FilePath $install_log_path -New-Item $vs_registry_key_path -Force | New-ItemProperty -Name productdir -Value $vs_registry_key_value -Force -echo 'Installing Microsoft Visual C++ Compiler for Python 2.7... done!' | Tee-Object -Append -FilePath $install_log_path - -## Download & install Chocolatey -echo 'Installing Chocolatey' | Tee-Object -Append -FilePath $install_log_path -iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -# -## Set up SSHd -$user_dirs = Get-ChildItem "C:\Users\$($username)*" -$user_dir = $user_dirs[0].FullName -$ssh_user_directory = "$($user_dir)\.ssh" -$authorized_keys_path = "$($ssh_user_directory)\authorized_keys" -mkdir $ssh_user_directory | Tee-Object -Append -FilePath $install_log_path - -echo 'Installing SSHd' | Tee-Object -Append -FilePath $install_log_path -Choco install openssh -y --force --params '"/SSHServerFeature"' | Tee-Object -Append -FilePath $install_log_path -echo "Write public key to $($authorized_keys_path) file" | Tee-Object -Append -FilePath $install_log_path -Set-content -Path $authorized_keys_path -Encoding ASCII -Value $pub_key_content - -echo 'Give read access to SSHd' | Tee-Object -Append -FilePath $install_log_path -$Acl = Get-Acl $authorized_keys_path -$Ar = New-Object system.security.accesscontrol.filesystemaccessrule("NT SERVICE\sshd","Read","Allow") -$Acl.SetAccessRule($Ar) -Set-Acl $authorized_keys_path $Acl - -echo "Remove extra permissions on $($authorized_keys_path)" | Tee-Object -Append -FilePath $install_log_path -.\icacls.exe $($authorized_keys_path) /inheritance:d -.\icacls.exe $($authorized_keys_path) /remove Everyone -.\icacls.exe $($authorized_keys_path) /remove BUILTIN\Users - -echo "New ACLs for $($authorized_keys_path):" | Tee-Object -Append -FilePath $install_log_path -Get-Acl $authorized_keys_path | Tee-Object -Append -FilePath $install_log_path - -## Install plaso dependencies -Choco install patch -y | Tee-Object -Append -FilePath $install_log_path # Used when building plaso dependencies -Choco install jre8 -y | Tee-Object -Append -FilePath $install_log_path # Needed for jenkins client -Choco install git -y --params '"/GitAndUnixToolsOnPath"' | Out-Null #Tee-Object -Append -FilePath $install_log_path -Choco install python2 -y | Tee-Object -Append -FilePath $install_log_path -# Pip package is broken as per 2017-07-14 -Choco install pip -y --allow-empty-checksums | Tee-Object -Append -FilePath $install_log_path -Choco install vcredist2010 -y | Tee-Object -Append -FilePath $install_log_path - -c:\python27\scripts\pip.exe install wmi | Tee-Object -Append -FilePath $install_log_path -c:\python27\scripts\pip.exe install pypiwin32 | Tee-Object -Append -FilePath $install_log_path -c:\python27\scripts\pip.exe install requests | Tee-Object -Append -FilePath $install_log_path -c:\python27\scripts\pip.exe install pyinstaller | Tee-Object -Append -FilePath $install_log_path - -echo 'Downloading Jenkins client' | Tee-Object -Append -FilePath $install_log_path -mkdir $jenkins_home_directory -(New-Object System.Net.WebClient).DownloadFile($jenkins_slave_url, $jenkins_slave_path) - -# Disable stupid UAC -New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name EnableInstallerDetection -Value 0 -Force -# This needs a reboot to be applied - -Restart-Computer diff --git a/config/jenkins/windows/plaso_end_to_end_windows.ps1 b/config/jenkins/windows/plaso_end_to_end_windows.ps1 deleted file mode 100644 index f52a411f48..0000000000 --- a/config/jenkins/windows/plaso_end_to_end_windows.ps1 +++ /dev/null @@ -1,165 +0,0 @@ -# Script to run automated end-to-end tests on Windows platforms -# -# This script requires four arguments to run: -# $config_file : the path to the test configuration INI file to use -# $config_bucket_baseurl : the base URL for the Cloud bucket -# where test configuration files are stored. -# $evidence_bucket_baseurl : the base URL for the Cloud bucket -# where evidence/source files are stored. -# $results_bucket_baseurl : the base URL for the Cloud bucket -# where the test results should be uploaded. -# -# Example: -# powershell.exe plaso_end_to_end_windows.ps1 ` -# -config_file studentpc1-noprofile.ini ` -# -config_bucket_baseurl gs://bucket1 ` -# -evidence_bucket_baseurl gs://bucket2 ` -# -results_bucket_baseurl gs://bucket3 - -param ( - [Parameter(Mandatory=$true)] - [string]$config_file, - [Parameter(Mandatory=$true)] - [string]$config_bucket_baseurl, - [Parameter(Mandatory=$true)] - [string]$evidence_bucket_baseurl, - [Parameter(Mandatory=$true)] - [string]$results_bucket_baseurl -) - -# Some hardcoded values -$gsutilexec = 'gsutil' -$data_directory = 'C:\data\' -$plaso_tools_directory = '.\tools' - -# Some helper functions -function Exists-Command { - <# - .SYNOPSIS - Returns True if a command exists. - - .PARAMETER Name - The command to check. - - .OUTPUTS - True if the command exists. - #> - - param ( - [string]$Name - ) - - return ((Get-Command $Name -errorAction SilentlyContinue) -ne $null) -} - -Function Get-IniContent { - <# - .SYNOPSIS - Returns the content of a well formed INI file as a hashmap. - - .PARAMETER IniFile - The path to the INI file. - - .OUTPUTS - A hashmap reflecting the content of the INI file. - #> - - Param( - [string]$IniFile - ) - $hashmap = @{} - switch -regex -file $IniFile - { - "^(;.*)$" - { - # This is a comment, do nothing. - } - "^\[(.+)\]$" - { - $current_section = $matches[1] - $hashmap[$current_section] = @{} - } - "(.+?)\s*=\s*(.*)" # key=value - { - $key = $matches[1] - $value = $matches[2] - $hashmap[$current_section][$key] = $value - } - } - Return $hashmap -} - -# Checking variables are set properly - -if ( ! $config_file ) { - throw 'Please specify the name of the INI configuration file' -} - -$tests_configuration = Get-IniContent $config_file -$tests_set_name = $tests_configuration.Keys[0] -$evidence_filename = $tests_configuration["$tests_set_name"]["source"] - -$results_directory = "plaso_end_to_end_windows_$tests_set_name" - -$evidence_path = "$($data_directory)\$($evidence_filename)" -$config_storage_url = "$($config_bucket_baseurl)/$($config_file)" -$evidence_storage_url = "$($evidence_bucket_baseurl)/$($evidence_filename)" - -$job = If ($env:JOB_NAME) {$env:JOB_NAME} Else {'test-job'} -$build = If ($env:BUILD_NUMBER) {$env:BUILD_NUMBER} Else {'test-buildnum'} - -$pythonexec = 'C:\Python27\python.exe' -if (! $(Exists-Command $pythonexec)) { - $pythonexec = 'C:\Program Files\Python27\python.exe' - if (! $(Exists-Command $pythonexec)) { - throw "Unable to find Python executable $($pythonexec)" - } -} - -if (! $(Exists-Command $gsutilexec)) { - throw "Unable to find GSutil executable $($gsutilexec)" -} - -if (!(Test-Path -Path $plaso_tools_directory)) { - throw "Unable to find tools directory $($plaso_tools_directory)" -} - -if (Test-Path -Path $results_directory) { - Remove-Item -Recurse -Force $results_directory -} -New-Item -ItemType directory -Path $results_directory - -if (!(Test-Path -Path $data_directory)) { - New-Item -ItemType directory -Path $data_directory -} - -if (!(Test-Path -Path $evidence_path)) { - Write-Host "Copying $($evidence_storage_url) to $($evidence_path)" - & $gsutilexec cp $evidence_storage_url $evidence_path -} - -if (!(Test-Path -Path $config_file)) { - Write-Host "Copying $($config_storage_url) to $($config_file)" - & $gsutilexec cp $config_storage_url $config_file -} - -# Run test -$env:PYTHONPATH = '.' -Write-Host "Running $($pythonexec) .\tests\end-to-end.py --debug --config " + - "$($config_file) --sources-directory $($data_directory) --tools-directory "+ - "$($plaso_tools_directory) --results-directory $($results_directory)" -& $pythonexec .\tests\end-to-end.py --debug --config $config_file ` - --sources-directory $data_directory --tools-directory $plaso_tools_directory ` - --results-directory $results_directory 2>&1 - -if ($LastExitCode -ne 0) { - throw "Error running the end to end test" -} - -# Export test results to storage bucket -Write-Host "Running $($gsutilexec) cp $($results_directory) "+ - "$($results_bucket_baseurl)/$($results_directory)/$($job)/$($build)" -& $gsutilexec cp -r $results_directory ` - "$results_bucket_baseurl/$results_directory/$job/$build" - -Write-Host "All done!" diff --git a/config/vagrant/Vagrantfile b/config/vagrant/Vagrantfile deleted file mode 100644 index ba60d933b2..0000000000 --- a/config/vagrant/Vagrantfile +++ /dev/null @@ -1,30 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Set VirtualBox as default provider -ENV["VAGRANT_DEFAULT_PROVIDER"] = "virtualbox" - -Vagrant.configure("2") do |config| - - config.vm.box = "ubuntu/xenial64" - config.vm.box_check_update = true - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - config.vm.synced_folder "../../", "/opt/plaso" - - - config.vm.provider "virtualbox" do |vb| - vb.name = "plaso-vagrant-dev" - vb.cpus = 4 - vb.memory = 2048 - end - - # Set up the system using the standard shell script. - config.vm.provision :shell, args: "--include-development --include-test --include-debug", - path: "../linux/gift_ppa_install.sh" - config.vm.hostname = "plaso-vagrant-dev" - -end diff --git a/data/plaso_kibana_example.json b/data/plaso_kibana_example.json deleted file mode 100644 index ad1f8a9230..0000000000 --- a/data/plaso_kibana_example.json +++ /dev/null @@ -1,329 +0,0 @@ -{ - "title": "Plaso", - "services": { - "query": { - "idQueue": [ - 1, - 2, - 3, - 4 - ], - "list": { - "0": { - "query": "*", - "alias": "", - "color": "#7EB26D", - "id": 0, - "pin": false, - "type": "lucene" - } - }, - "ids": [ - 0 - ] - }, - "filter": { - "idQueue": [ - 0, - 1, - 2 - ], - "list": {}, - "ids": [] - } - }, - "rows": [ - { - "title": "Histogram", - "height": "200px", - "editable": true, - "collapse": false, - "collapsable": true, - "panels": [ - { - "span": 12, - "editable": true, - "type": "histogram", - "loadingEditor": false, - "mode": "count", - "time_field": "datetime", - "queries": { - "mode": "all", - "ids": [ - 0 - ] - }, - "value_field": null, - "auto_int": true, - "resolution": 100, - "interval": "1y", - "intervals": [ - "auto", - "1s", - "1m", - "5m", - "10m", - "30m", - "1h", - "3h", - "12h", - "1d", - "1w", - "1M", - "1y" - ], - "fill": 0, - "linewidth": 3, - "timezone": "browser", - "spyable": true, - "zoomlinks": true, - "bars": true, - "stack": true, - "points": false, - "lines": false, - "legend": true, - "x-axis": true, - "y-axis": true, - "percentage": false, - "interactive": true, - "options": true, - "tooltip": { - "value_type": "cumulative", - "query_as_alias": false - }, - "title": "Histogram" - } - ], - "notice": false - }, - { - "title": "Graph", - "height": "250px", - "editable": true, - "collapse": false, - "collapsable": true, - "panels": [ - { - "error": false, - "span": 4, - "editable": true, - "type": "terms", - "loadingEditor": false, - "queries": { - "mode": "selected", - "ids": [ - 0 - ] - }, - "field": "source_short", - "exclude": [], - "missing": true, - "other": true, - "size": 10, - "order": "count", - "style": { - "font-size": "10pt" - }, - "donut": false, - "tilt": false, - "labels": true, - "arrangement": "horizontal", - "chart": "bar", - "counter_pos": "below", - "spyable": true, - "title": "Source Distribution" - }, - { - "error": false, - "span": 4, - "editable": true, - "type": "terms", - "loadingEditor": false, - "queries": { - "mode": "selected", - "ids": [] - }, - "field": "parser", - "exclude": [], - "missing": true, - "other": true, - "size": 10, - "order": "count", - "style": { - "font-size": "10pt" - }, - "donut": false, - "tilt": false, - "labels": true, - "arrangement": "horizontal", - "chart": "table", - "counter_pos": "above", - "spyable": true, - "title": "Parser Count" - }, - { - "error": false, - "span": 4, - "editable": true, - "type": "terms", - "loadingEditor": false, - "queries": { - "mode": "selected", - "ids": [] - }, - "field": "hostname", - "exclude": [], - "missing": true, - "other": true, - "size": 10, - "order": "count", - "style": { - "font-size": "10pt" - }, - "donut": false, - "tilt": false, - "labels": true, - "arrangement": "horizontal", - "chart": "bar", - "counter_pos": "above", - "spyable": true, - "title": "Hosts" - } - ], - "notice": false - }, - { - "title": "Events", - "height": "650px", - "editable": true, - "collapse": false, - "collapsable": true, - "panels": [ - { - "error": false, - "span": 12, - "editable": true, - "group": [ - "default" - ], - "type": "table", - "size": 100, - "pages": 5, - "offset": 0, - "sort": [ - "datetime", - "desc" - ], - "style": { - "font-size": "9pt" - }, - "overflow": "min-height", - "fields": [ - "datetime", - "timestamp_desc", - "hostname", - "username", - "source_short", - "source_long", - "message", - "tag", - "display_name" - ], - "highlight": [], - "sortable": true, - "header": true, - "paging": true, - "spyable": true, - "queries": { - "mode": "all", - "ids": [ - 0 - ] - }, - "field_list": true, - "status": "Stable", - "trimFactor": 300, - "normTimes": true, - "title": "Documents", - "all_fields": false - } - ], - "notice": false - } - ], - "editable": true, - "index": { - "interval": "none", - "pattern": "[logstash-]YYYY.MM.DD", - "default": "_all" - }, - "style": "light", - "failover": false, - "panel_hints": true, - "loader": { - "save_gist": false, - "save_elasticsearch": true, - "save_local": true, - "save_default": true, - "save_temp": true, - "save_temp_ttl_enable": true, - "save_temp_ttl": "30d", - "load_gist": true, - "load_elasticsearch": true, - "load_elasticsearch_size": 20, - "load_local": true, - "hide": false - }, - "pulldowns": [ - { - "type": "query", - "collapse": false, - "notice": false, - "query": "*", - "pinned": true, - "history": [], - "remember": 10, - "enable": true - }, - { - "type": "filtering", - "collapse": true, - "notice": false, - "enable": true - } - ], - "nav": [ - { - "type": "timepicker", - "collapse": false, - "notice": false, - "status": "Stable", - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ], - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "timefield": "@timestamp", - "enable": true - } - ], - "refresh": false -} \ No newline at end of file