Skip to content

Instantly share code, notes, and snippets.

View felickz's full-sized avatar
:octocat:
ALL YOUR REBASE ARE BELONG TO US.

Chad Bentz felickz

:octocat:
ALL YOUR REBASE ARE BELONG TO US.
View GitHub Profile
@felickz
felickz / Count-SecretScanningPatterns.ps1
Last active April 30, 2024 18:12
Count the secret scanning patterns from GHAS
# Install the PowerShell-yaml module if not already installed
if (-not (Get-Module -Name PowerShell-yaml -ListAvailable)) {
Install-Module -Name PowerShell-yaml -Scope CurrentUser
}
# Read the YAML file from https://github.com/github/docs/blob/main/data/secret-scanning.yml
$url = 'https://raw.githubusercontent.com/github/docs/main/data/secret-scanning.yml'
$data = Invoke-RestMethod -Uri $url | ConvertFrom-Yaml
$inventory = @()
@felickz
felickz / codeql-nightlies.yml
Last active April 29, 2024 14:55
CodeQL Nightlies
env:
#Controls whether to check the responsiveness of NuGet feeds.
CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK: 'true'
...more yaml steps here...
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
@felickz
felickz / ghazdo-conditional-task.md
Last active April 17, 2024 08:37
GHAzDO conditionally run tasks based on enablement

To conditionally run the GHAzDO tasks in a pipeline:

image

Use the following steps:

steps:
- bash: az devops configure --defaults organization='$(System.TeamFoundationCollectionUri)' project='$(System.TeamProject)' --use-git-aliases true
  displayName: 'Set default Azure DevOps organization and project'
@felickz
felickz / ghazdo-codeql-synthetic.md
Last active March 7, 2024 18:03
GHAzDO CodeQL custom configuration for security scan of synthetic applications

This file is intended to be used for analyzing synthetic code samples. This configuration uses all possible queries from the CodeQL built in packs along with additional OSS queries and data extensions. It includes more queries than the standard security-experimental suite, providing a more thorough analysis at the cost of longer analysis times and potential false positives. It includes:

  • queries marked as @precision: low or missing a precision
  • queries marked as @problem.severity: recommendation
  • queries in \experimental\ folders
- pwsh: |
      Invoke-WebRequest -Uri "https://raw.githubusercontent.com/GitHubSecurityLab/CodeQL-Community-Packs/main/configs/synthetics.yml" -OutFile "$(Agent.TempDirectory)/synthetics.yml"
    displayName: Copy down CodeQL Config for synthetic applications
@felickz
felickz / GitHubDependencyInsightsCopyLeft.url
Created December 21, 2022 20:33
GitHub Org Insights Dependencies - CopyLeft License Filter
javascript:window.location.href=window.location.href+'?query=license%3AGPL-2.0+license%3AGPL-3.0+license%3ALGPL-2.0+license%3ALGPL-3.0+license%3AAGPL-1.0+license%3AAGPL-1.0-only+license%3AAGPL-1.0-or-later+license%3AAGPL-3.0+license%3AAGPL-3.0-only+license%3AAGPL-3.0-or-later+license%3ARPL-1.1+license%3ARPL-1.5+license%3ARPSL-1.0+license%3AOCLC-2.0+license%3ANGPL+license%3AODbL-1.0+license%3AMS-RL+license%3AOSL-1.0+license%3AOSL-1.1+license%3AOSL-2.0+license%3AOSL-2.1+license%3AOSL-3.0+license%3AMPL-2.0+license%3AMPL-1.0+license%3AMPL-1.1+license%3AMPL-2.0-no-copyleft-exception+license%3AEPL-1.0+license%3AEPL-2.0%27;
@felickz
felickz / PrintOdd.ps1
Created October 25, 2021 20:38
Write script that prints out odd numbers between 1 and 10
1..10 | %{ $_ % 2 -eq 0 ? $null : (Write-Host "$_") }
@felickz
felickz / logman-iis-dotnet-cf.txt
Created June 21, 2021 15:28
.NET Perfmon Counters
\.NET CLR Exceptions(w3wp)\# of Exceps Thrown
\.NET CLR Exceptions(w3wp)\# of Exceps Thrown / sec
\.NET CLR Exceptions(w3wp)\# of Filters / sec
\.NET CLR Exceptions(w3wp)\# of Finallys / sec
\.NET CLR Exceptions(w3wp)\Throw To Catch Depth / sec
\.NET CLR LocksAndThreads(w3wp)\# of current logical Threads
\.NET CLR LocksAndThreads(w3wp)\# of current physical Threads
\.NET CLR LocksAndThreads(w3wp)\# of current recognized threads
\.NET CLR LocksAndThreads(w3wp)\# of total recognized threads
\.NET CLR LocksAndThreads(w3wp)\Contention Rate / sec
$symbols = '!@#$%^&*'.ToCharArray()
$characterList = 'a'..'z' + 'A'..'Z' + '0'..'9' + $symbols
function GeneratePassword {
param(
[Parameter(Mandatory = $false)]
[ValidateRange(12, 256)]
[int]
$length = 14
)
$breakTimeMin = 10; 0..($breakTimeMin-1)|%{ Write-Progress -Activity "<Conference Name Goes Here>" -Status "next session begins in: $($breakTimeMin - $_) minutes" -PercentComplete ($_ / $breakTimeMin * 100); sleep 60; }
@felickz
felickz / PresentationTemplate.md
Last active March 18, 2021 17:27
PresentationTemplate
  1. Problem Statement
  2. Goal
  3. Industry Standards
  4. How to fix