Skip to content

Commit

Permalink
Merge pull request #1 from cisagov/develop
Browse files Browse the repository at this point in the history
v0.1.0
  • Loading branch information
ethanb-cisa authored Oct 20, 2022
2 parents ed267ba + 4718fe2 commit bdbbe55
Show file tree
Hide file tree
Showing 132 changed files with 27,484 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/run_opa_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run OPA Tests
on:
# Run tests on each commit, newly opened/reopened PR, and
# PR review submission (e.g. approval)
push:
paths:
- "**.rego"
pull_request:
types: [opened, reopened]
branches:
- "main"
paths:
- "**.rego"
pull_request_review:
types: [submitted]
branches:
- "main"

jobs:
Run-OPA-Tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Setup OPA
uses: open-policy-agent/setup-opa@v1
with:
version: latest

- name: Run OPA Tests
run: opa test Rego/*.rego Testing/**/*.rego -v
34 changes: 34 additions & 0 deletions .github/workflows/run_psscriptanalyzer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run PS Linter
on:
push:
paths:
- "**.ps1"
- "**.psm1"
pull_request:
types: [opened, reopened]
branches:
- "main"
paths:
- "**.ps1"
- "**.psm1"
workflow_dispatch:

jobs:
lint:
name: Run PS Linter
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: lint
uses: docker://devblackops/github-action-psscriptanalyzer:2.4.0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
settingsPath: PSScriptAnalyzerSettings.psd1
failOnErrors: true
failOnWarnings: true
failOnInfos: true
sendComment: true
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# dependencies

# testing

# production

# msc
*.xml
*.cer
/M365/*.xml
/PowerShell/output
/PowerShell/example
/PowerShell/M365Baseline*
/output
/example
/M365Baseline*
/Reports*
29 changes: 29 additions & 0 deletions AllowBasicAuthentication.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#Requires -RunAsAdministrator

# Run this script to enable basic authentication on your local desktop if you get an error when connecting to Exchange Online.
# See README file Troubleshooting section for details.
#
# This script requires administrative privileges on your local desktop and updates a registry key.
#
$regPath = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client'
$regKey = 'AllowBasic'

if (Test-Path -LiteralPath $regPath){
try {
$allowBasic = Get-ItemPropertyValue -Path $regPath -Name $regKey -ErrorAction Stop
}
catch [System.Management.Automation.PSArgumentException]{
Write-Error -Message "Key, $regKey, was not found"
}
catch{
Write-Error -Message "Unexpected error occured attempting to get registry key, $regKey."
}

if ($allowBasic -ne '1'){
Set-ItemProperty -Path $regPath -Name $regKey -Type DWord -Value '1'
}
}
else {
Write-Error -Message "Registry path not found: $regPath"
}

Loading

0 comments on commit bdbbe55

Please sign in to comment.