Skip to content

Storage modules update + ANF option for FSlogix#764

Open
danycontre wants to merge 57 commits into
mainfrom
anf-fslogix
Open

Storage modules update + ANF option for FSlogix#764
danycontre wants to merge 57 commits into
mainfrom
anf-fslogix

Conversation

@danycontre
Copy link
Copy Markdown
Contributor

Overview/Summary

Replace this with a brief description of what this Pull Request fixes, changes, etc.

This PR fixes/adds/changes/removes

  1. Replace me
  2. Replace me
  3. Replace me

Breaking Changes

  1. Replace me
  2. Replace me

Testing Evidence

Replace this with any testing evidence to show that your Pull Request works/fixes as described and planned (include screenshots, if appropriate).

As part of this Pull Request I have

  • Read the Contribution Guide and ensured this PR is compliant with the guide
  • Ensured the resource API versions in .bicep file/s I am adding/editing are using the latest API version possible
  • Checked for duplicate Pull Requests
  • Associated it with relevant GitHub Issues
  • (AVD LZA Team Only) Associated it with relevant ADO Items
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Performed testing and provided evidence.
  • Updated relevant and associated documentation (e.g. Contribution Guide, Module READMEs, Docs etc.)

"type": "string",
"defaultValue": "TLSv1_2",
"allowedValues": [
"TLSv1_0",

Check failure

Code scanning / devskim

An outdated SSL/TLS protocol version is specified.

Do not use outdated SSL/TLS protocols
"type": "string",
"defaultValue": "TLSv1_2",
"allowedValues": [
"TLSv1_0",

Check failure

Code scanning / devskim

An Outdated or Banned SSL/TLS Protocol is Used

An Outdated or Banned SSL/TLS Protocol is Used
"defaultValue": "TLSv1_2",
"allowedValues": [
"TLSv1_0",
"TLSv1_1",

Check failure

Code scanning / devskim

An outdated SSL/TLS protocol version is specified.

Do not use outdated SSL/TLS protocols
"defaultValue": "TLSv1_2",
"allowedValues": [
"TLSv1_0",
"TLSv1_1",

Check failure

Code scanning / devskim

An Outdated or Banned SSL/TLS Protocol is Used

An Outdated or Banned SSL/TLS Protocol is Used
}
# Create Domain credential
$DomainJoinUserName = $DomainJoinUserPrincipalName.Split('@')[0]
$DomainPassword = ConvertTo-SecureString -String $DomainJoinUserPwd -AsPlainText -Force

Check failure

Code scanning / PSScriptAnalyzer

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.
# Create credential for accessing the storage account
Write-Log -message "Building Storage Key Credential"
$StorageUsername = 'Azure\' + $StorageAccountName
$StoragePassword = ConvertTo-SecureString -String "$($StorageKey)" -AsPlainText -Force

Check failure

Code scanning / PSScriptAnalyzer

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.
}
# Creates a password for the Azure Storage Account in AD using the Kerberos key
Write-Log -message "Creating a password for the Azure Storage Account in AD using the Kerberos key"
$ComputerPassword = ConvertTo-SecureString -String $Key.Replace("'", "") -AsPlainText -Force

Check failure

Code scanning / PSScriptAnalyzer

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.

# Update the password on the computer object with the new Kerberos key on the Storage Account
Write-Log -message "Updating the password on the computer object with the new Kerberos key (kerb1) on the Storage Account"
$NewPassword = ConvertTo-SecureString -String $Key -AsPlainText -Force

Check failure

Code scanning / PSScriptAnalyzer

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.

File 'Set-NtfsPermissions.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.
Write-Log -message "Getting an access token for Azure resources"
$AzureManagementAccessToken = (Invoke-RestMethod `
-Headers @{Metadata = "true" } `
-Uri $('http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=' + $ResourceManagerUriFixed + '&client_id=' + $UserAssignedIdentityClientId)).access_token

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected.

Insecure URL
If ($FsLogixStorageAccountKey -ne '') {
$SAName = $FSLogixStorageFQDN.Split('.')[0]
Write-Log -Message "Adding Local Storage Account Key for '$FSLogixStorageFQDN' to Credential Manager" -Category 'Info'
$CMDKey = Start-Process -FilePath 'cmdkey.exe' -ArgumentList "/add:$FSLogixStorageFQDN /user:localhost\$SAName /pass:$FSLogixStorageAccountKey" -Wait -PassThru

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling.

Do not leave debug code in production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants