From 2678356764ad3e52573c1cbbf702a56dce2715b9 Mon Sep 17 00:00:00 2001 From: A-Katopodis Date: Thu, 22 Apr 2021 01:41:31 +0300 Subject: [PATCH 1/3] Add psscriptanalyzer code scanning --- code-scanning/powershell.yml | 42 +++++++++++++++++++ .../properties/powershell.properties.json | 7 ++++ icons/powershell.svg | 30 +++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 code-scanning/powershell.yml create mode 100644 code-scanning/properties/powershell.properties.json create mode 100644 icons/powershell.svg diff --git a/code-scanning/powershell.yml b/code-scanning/powershell.yml new file mode 100644 index 0000000..dfbf452 --- /dev/null +++ b/code-scanning/powershell.yml @@ -0,0 +1,42 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# +# https://github.com/microsoft/action-psscriptanalyzer +# For more information on PSScriptAnalyzer in general, see +# https://github.com/PowerShell/PSScriptAnalyzer + +name: PSScriptAnalyzer + +on: + push: + branches: [ $default-branch, $protected-branches ] + pull_request: + branches: [ $default-branch ] + schedule: + - cron: $cron-weekly + +jobs: + build: + name: PSScriptAnalyzer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Run PSScriptAnalyzer + uses: microsoft/psscriptanalyzer-action@2044ae068e37d0161fa2127de04c19633882f061 + with: + # Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options. + # The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules. + path: .\ + recurse: true + # Include your own basic security rules. Removing this option will run all the rules + includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"' + output: results.sarif + + # Upload the SARIF file generated in the previous step + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: results.sarif diff --git a/code-scanning/properties/powershell.properties.json b/code-scanning/properties/powershell.properties.json new file mode 100644 index 0000000..98a5a78 --- /dev/null +++ b/code-scanning/properties/powershell.properties.json @@ -0,0 +1,7 @@ +{ + "name": "PSScriptAnalyzer", + "creator": "Microsoft", + "description": "A static code checker for PowerShell modules and scripts. PSScriptAnalyzer checks the quality of PowerShell code by running a set of rules.", + "iconName": "powershell", + "categories": ["Code Scanning", "PowerShell"] +} \ No newline at end of file diff --git a/icons/powershell.svg b/icons/powershell.svg new file mode 100644 index 0000000..54c4d89 --- /dev/null +++ b/icons/powershell.svg @@ -0,0 +1,30 @@ + + + Artboard 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ccfd55f9c81f7a10066689e83526d0a2ddcde722 Mon Sep 17 00:00:00 2001 From: A-Katopodis Date: Thu, 22 Apr 2021 01:51:14 +0300 Subject: [PATCH 2/3] Updated creator field --- code-scanning/properties/powershell.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-scanning/properties/powershell.properties.json b/code-scanning/properties/powershell.properties.json index 98a5a78..95420ae 100644 --- a/code-scanning/properties/powershell.properties.json +++ b/code-scanning/properties/powershell.properties.json @@ -1,6 +1,6 @@ { "name": "PSScriptAnalyzer", - "creator": "Microsoft", + "creator": "Microsoft Corporation", "description": "A static code checker for PowerShell modules and scripts. PSScriptAnalyzer checks the quality of PowerShell code by running a set of rules.", "iconName": "powershell", "categories": ["Code Scanning", "PowerShell"] From 120036944ad5188becaf77cd54042838d290aeb2 Mon Sep 17 00:00:00 2001 From: A-Katopodis Date: Mon, 26 Apr 2021 11:04:15 +0300 Subject: [PATCH 3/3] Updated Powershell Icon --- icons/powershell.svg | 57 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/icons/powershell.svg b/icons/powershell.svg index 54c4d89..ec01c8c 100644 --- a/icons/powershell.svg +++ b/icons/powershell.svg @@ -1,30 +1,29 @@ - - - Artboard 1 - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + \ No newline at end of file