Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
2 changes: 1 addition & 1 deletion UnitySetup/UnitySetup.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
RootModule = 'UnitySetup'

# Version number of this module.
ModuleVersion = '5.5'
ModuleVersion = '5.6'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
54 changes: 46 additions & 8 deletions UnitySetup/UnitySetup.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Import-Module powershell-yaml -MinimumVersion '0.3' -ErrorAction Stop

Expand All @@ -22,7 +22,8 @@ enum UnitySetupComponent {
Mac_IL2CPP = (1 -shl 14)
Lumin = (1 -shl 15)
Linux_IL2CPP = (1 -shl 16)
All = (1 -shl 17) - 1
Windows_Server = (1 -shl 17)
All = (1 -shl 18) - 1
}

[Flags()]
Expand Down Expand Up @@ -66,13 +67,19 @@ class UnitySetupInstance {
[UnitySetupComponent]::Documentation = , [io.path]::Combine("$Path", "Editor\Data\Documentation");
[UnitySetupComponent]::StandardAssets = , [io.path]::Combine("$Path", "Editor\Standard Assets");
[UnitySetupComponent]::Windows_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "windowsstandalonesupport\Variations\win32_development_il2cpp"),
[io.path]::Combine("$playbackEnginePath", "windowsstandalonesupport\Variations\win32_player_development_il2cpp");;
[io.path]::Combine("$playbackEnginePath", "windowsstandalonesupport\Variations\win32_player_development_il2cpp");
[UnitySetupComponent]::UWP = [io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_.NET_D3D"),
[io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_D3D");
[UnitySetupComponent]::UWP_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_IL2CPP_D3D");
[UnitySetupComponent]::Linux = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport\Variations\linux64_headless_development_mono");
[UnitySetupComponent]::Linux_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport\Variations\linux64_headless_development_il2cpp");
[UnitySetupComponent]::Mac = , [io.path]::Combine("$playbackEnginePath", "MacStandaloneSupport");
[UnitySetupComponent]::Windows_Server = , [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win32_player_development_mono"),
[io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win32_server_development_il2cpp"),
[io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win32_server_development_mono"),
[io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win64_player_development_mono"),
[io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win64_server_development_il2cpp"),
[io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win64_server_development_mono");
}
}
([OperatingSystem]::Linux) {
Expand Down Expand Up @@ -414,6 +421,7 @@ function Find-UnitySetupInstaller {
[UnitySetupComponent]::Windows_IL2CPP = , "$targetSupport/UnitySetup-Windows-IL2CPP-Support-for-Editor-$Version.$installerExtension";
[UnitySetupComponent]::Lumin = , "$targetSupport/UnitySetup-Lumin-Support-for-Editor-$Version.$installerExtension";
[UnitySetupComponent]::Linux_IL2CPP = , "$targetSupport/UnitySetup-Linux-IL2CPP-Support-for-Editor-$Version.$installerExtension";
[UnitySetupComponent]::Windows_Server = , "$targetSupport/UnitySetup-Windows-Server-Support-for-Editor-$Version.$installerExtension";
}

# In 2019.x there is only IL2CPP UWP so change the search for UWP_IL2CPP
Expand Down Expand Up @@ -485,11 +493,16 @@ function Find-UnitySetupInstaller {
}
}

if($Hash -ne ""){
$searchPages += "http://beta.unity3d.com/download/$Hash/download.html"
}

foreach ($page in $searchPages) {
try {
Write-Verbose "Searching page - $page"
$webResult = Invoke-WebRequest $page -UseBasicParsing
$prototypeLink = $webResult.Links |
Select-Object -ExpandProperty href -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty href -ErrorAction SilentlyContinue |
Where-Object {
$link = $_

Expand All @@ -500,11 +513,18 @@ function Find-UnitySetupInstaller {
}

return $false

} |
} |
Select-Object -First 1

if ($null -ne $prototypeLink) { break }
if ($null -ne $prototypeLink)
{
# Ensure prototype link is absolute uri
if(-not [system.uri]::IsWellFormedUriString($_,[System.UriKind]::Absolute)) {
$prototypeLink = "$([system.uri]::new([system.uri]$page, [system.uri]$prototypeLink))"
}

break
}
}
catch {
Write-Verbose "$page failed: $($_.Exception.Message)"
Expand All @@ -515,6 +535,7 @@ function Find-UnitySetupInstaller {
throw "Could not find archives for Unity version $Version"
}

Write-Verbose "Prototype link found: $prototypeLink"
$linkComponents = $prototypeLink -split $unitySetupRegEx -ne ""

if ($knownBaseUrls -notcontains $linkComponents[0]) {
Expand All @@ -535,6 +556,7 @@ function Find-UnitySetupInstaller {
foreach ( $baseUrl in $knownBaseUrls) {
$endpoint = [uri][System.IO.Path]::Combine($baseUrl, $linkComponents[1], $template);
try {
Write-Verbose "Attempting to get component $_ details from endpoint: $endpoint"
$testResult = Invoke-WebRequest $endpoint -Method HEAD -UseBasicParsing
# For packages on macOS the Content-Length and Last-Modified are returned as an array.
if ($testResult.Headers['Content-Length'] -is [System.Array]) {
Expand Down Expand Up @@ -1179,6 +1201,8 @@ function Uninstall-UnitySetupInstance {
Get the Unity versions installed and their locations
.PARAMETER BasePath
Under what base patterns should we look for Unity installs?
Defaults to Unity default locations by platform
Default can be configured by comma separated paths in $env:UNITY_SETUP_INSTANCE_DEFAULT_BASEPATH
.EXAMPLE
Get-UnitySetupInstance
#>
Expand All @@ -1189,6 +1213,13 @@ function Get-UnitySetupInstance {
[string[]] $BasePath
)

if((-not $BasePath) -and $env:UNITY_SETUP_INSTANCE_BASEPATH_DEFAULT){
$BasePath = ($env:UNITY_SETUP_INSTANCE_BASEPATH_DEFAULT -split ',') | ForEach-Object {
$_.trim()
}
Write-Verbose "Set BasePath to $BasePath from `$env:UNITY_SETUP_INSTANCE_BASEPATH_DEFAULT."
}

switch (Get-OperatingSystem) {
([OperatingSystem]::Windows) {
if (-not $BasePath) {
Expand All @@ -1205,6 +1236,7 @@ function Get-UnitySetupInstance {
}
}

Write-Verbose "Searching `"$BasePath`" for UnitySetup instances..."
Get-ChildItem -Path $BasePath -Directory -ErrorAction Ignore |
Where-Object { (Get-UnityEditor $_.FullName).Count -gt 0 } |
ForEach-Object {
Expand Down Expand Up @@ -1668,6 +1700,8 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
The log file for the Unity Editor to write to.
.PARAMETER BuildTarget
The platform build target for the Unity Editor to start in.
.PARAMETER StandaloneBuildSubtarget
Select an active build sub-target for the Standalone platforms before loading a project.
.PARAMETER AcceptAPIUpdate
Accept the API Updater automatically. Implies BatchMode unless explicitly specified by the user.
.PARAMETER Credential
Expand Down Expand Up @@ -1756,6 +1790,9 @@ function Start-UnityEditor {
[ValidateSet('StandaloneOSX', 'StandaloneWindows', 'iOS', 'Android', 'StandaloneLinux', 'StandaloneWindows64', 'WebGL', 'WSAPlayer', 'StandaloneLinux64', 'StandaloneLinuxUniversal', 'Tizen', 'PSP2', 'PS4', 'XBoxOne', 'N3DS', 'WiiU', 'tvOS', 'Switch', 'Lumin')]
[string]$BuildTarget,
[parameter(Mandatory = $false)]
[ValidateSet('Player', 'Server')]
[string]$StandaloneBuildSubtarget,
[parameter(Mandatory = $false)]
[switch]$AcceptAPIUpdate,
[parameter(Mandatory = $false)]
[pscredential]$Credential,
Expand Down Expand Up @@ -1875,6 +1912,7 @@ function Start-UnityEditor {
if ( $OutputPath ) { $sharedArgs += "-buildOutput", "`"$OutputPath`"" }
if ( $LogFile ) { $sharedArgs += "-logFile", "`"$LogFile`"" }
if ( $BuildTarget ) { $sharedArgs += "-buildTarget", $BuildTarget }
if ( $StandaloneBuildSubtarget ) { $sharedArgs += "-standaloneBuildSubtarget", $StandaloneBuildSubtarget }
if ( $BatchMode ) { $sharedArgs += "-batchmode" }
if ( $Quit ) { $sharedArgs += "-quit" }
if ( $ExportPackage ) { $sharedArgs += "-exportPackage", ($ExportPackage | ForEach-Object { "`"$_`"" }) }
Expand Down Expand Up @@ -2063,7 +2101,7 @@ function Get-UnityLicense {
[PSCustomObject]@{
'LicenseVersion' = $license.LicenseVersion.Value
'Serial' = ConvertTo-SecureString $licenseSerial -AsPlainText -Force
'UnityVersion' = [UnityVersion]$license.ClientProvidedVersion.Value
'UnityVersion' = $license.ClientProvidedVersion.Value
'DisplaySerial' = $license.SerialMasked.Value
'ActivationDate' = ConvertTo-DateTime $license.InitialActivationDate.Value
'StartDate' = ConvertTo-DateTime $license.StartDate.Value
Expand Down