forked from MicrosoftDocs/PowerShell-Docs-Modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(MicrosoftDocsGH-90) Document PSAvoidUsingBrokenHashAlgorithms
This change: - documents the new `PSAvoidUsingBrokenHashAlgorithms` rule for **PSScriptAnalyzer** by updating the rule table and adding a document for the rule. - Resolves MicrosoftDocs#90 - Fixes AB#4996
- Loading branch information
1 parent
13f0ba0
commit 72dd411
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
reference/docs-conceptual/PSScriptAnalyzer/Rules/AvoidUsingBrokenHashAlgorithms.md
This file contains 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,48 @@ | ||
--- | ||
description: Avoid using broken hash algorithms | ||
ms.custom: PSSA v1.21.0 | ||
ms.date: 05/31/2022 | ||
ms.topic: reference | ||
title: AvoidUsingBrokenHashAlgorithms | ||
--- | ||
# AvoidUsingBrokenHashAlgorithms | ||
|
||
**Severity Level: Warning** | ||
|
||
## Description | ||
|
||
Avoid using the broken algorithms MD5 or SHA-1. | ||
|
||
## How | ||
|
||
Replace broken algorithms with secure alternatives. MD5 and SHA-1 should be replaced with SHA256, | ||
SHA384, SHA512, or other safer algorithms when possible, with MD5 and SHA-1 only being utilized by | ||
necessity for backwards compatibility. | ||
|
||
## Example 1 | ||
|
||
### Wrong | ||
|
||
```powershell | ||
Get-FileHash foo.txt -Algorithm MD5 | ||
``` | ||
|
||
### Correct | ||
|
||
```powershell | ||
Get-FileHash foo.txt -Algorithm SHA256 | ||
``` | ||
|
||
## Example 2 | ||
|
||
### Wrong | ||
|
||
```powershell | ||
Get-FileHash foo.txt -Algorithm SHA1 | ||
``` | ||
|
||
### Correct | ||
|
||
```powershell | ||
Get-FileHash foo.txt | ||
``` |
This file contains 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 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