-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DOC: Add topic about best practices for writing secure PowerShell code. #12475
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
Conversation
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit a6e093e:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/docs-conceptual/about_SecureCode.md | View (>=powershell-5.1) | Details |
reference/docs-conceptual/about_SecureCode.md
- Line 0, Column 0: [Warning: h1-missing - See documentation]
H1 is required. Use a single hash (#) followed by a space to create your top-level heading. - Line 0, Column 0: [Warning: filename-invalid-character - See documentation]
Only lowercase letters, numbers, and hyphens are allowed in filenames. - Line 1, Column 1: [Warning: title-missing - See documentation]
Missing required attribute: 'title'. Add a title string to show in search engine results. - Line 0, Column 0: [Suggestion: filename-incomplete - See documentation]
The filename contains an incomplete word, misspelled word, acronym, or abbreviation that is disallowed. - Line 1, Column 1: [Suggestion: ms-date-missing - See documentation]
Missing required attribute: 'ms.date'. - Line 1, Column 1: [Suggestion: description-missing - See documentation]
Missing required attribute: 'description'.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
|
Hi team 👋 I came across Issue #10099 about adding a topic on secure PowerShell coding practices, so I created a new about_SecureCode article. It covers key points like safe module loading, proper credential handling, and writing scripts that work well with Constrained Language Mode ,all based on Microsoft’s existing security guidelines and blogs. I’ve done my best to follow the repo’s structure and tone, but since I’m still learning, I’d really appreciate any feedback or suggestions you might have Thank you so much for keeping this project open to new contributors,it means a lot to learners like me who are just starting out.😊 |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 8aab623:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/docs-conceptual/about-secure-code.md | View (>=powershell-5.1) | Details |
reference/docs-conceptual/about-secure-code.md
- Line 35, Column 1: [Warning: code-block-unclosed - See documentation]
Unclosed code block. Code blocks must begin and end with triple backticks (```).
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
@microsoft-github-policy-service agree |
|
Learn Build status updates of commit 698b3d8:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/docs-conceptual/about-secure-code.md | View (>=powershell-5.1) | Details |
reference/docs-conceptual/about-secure-code.md
- Line 37, Column 1: [Warning: code-block-unclosed - See documentation]
Unclosed code block. Code blocks must begin and end with triple backticks (```).
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit afd2b40:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/docs-conceptual/about-secure-code.md | View (>=powershell-5.1) | Details |
reference/docs-conceptual/about-secure-code.md
- Line 37, Column 1: [Warning: code-block-unclosed - See documentation]
Unclosed code block. Code blocks must begin and end with triple backticks (```).
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 2a5ba3e: ❌ Validation status: errorsPlease follow instructions here which may help to resolve issue.
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. |
|
Hi maintainers As this is one of my first contributions here, I truly appreciate your patience and guidance throughout the process. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 2a5ba3e:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/docs-conceptual/about-secure-code.md | View (>=powershell-5.1) | Details |
reference/docs-conceptual/about-secure-code.md
- Line 37, Column 1: [Warning: code-block-unclosed - See documentation]
Unclosed code block. Code blocks must begin and end with triple backticks (```).
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
|
Thanks for your contribution. However, we already have many documents on using PowerShell securely. See https://learn.microsoft.com/powershell/scripting/security/overview. In the future, before you start writing a new article, open an Issue so we can discuss the ideas provide guidance. |
Adds a new conceptual article: about_SecureCode.
This PR documents best practices for writing secure PowerShell code, including module importing, least privilege, and Constrained Language Mode.
Fixes #10099
Summary
This PR adds a new conceptual article —
about_SecureCode— that provides best practices for writing secure PowerShell code and scripts.Related Issue
Fixes #10099
Details
Testing
Contributed by: @Shriya-23