This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """Build a Jira v2 create-issue JSON body from createmeta. | |
| Reads classic createmeta or /issue/createmeta/{project}/issuetypes/{id}. | |
| Prints a usable POST /rest/api/2/issue payload to STDOUT. | |
| Prints field id, required flag, and datatype to STDERR. | |
| Usage: | |
| python3 createmeta_to_payload.py createmeta.json | |
| python3 createmeta_to_payload.py < createmeta.json |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """Create a Jira issue with v2 API, then update it with extra custom fields. | |
| HTTP transport matches the ssl + urllib3.PoolManager approach used internally. | |
| """ | |
| from __future__ import annotations | |
| import json | |
| import ssl |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """Extract required fields from Jira createmeta JSON. Prints to STDOUT. | |
| Usage: | |
| python3 required_fields.py < createmeta.json | |
| python3 required_fields.py createmeta.json | |
| curl ... | python3 required_fields.py | |
| """ | |
| from __future__ import annotations |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| Diagnose a OneDrive refresh-token grant without uploading anything. | |
| #> | |
| [CmdletBinding()] | |
| param( | |
| [string]$ClientId = $(if ($env:OD_CLIENT_ID) { $env:OD_CLIENT_ID } else { $null }), | |
| [string]$Tenant = $(if ($env:OD_TENANT_ID) { $env:OD_TENANT_ID } else { 'consumers' }), | |
| [string]$RefreshToken = $(if ($env:OD_REFRESH_TOKEN) { $env:OD_REFRESH_TOKEN } else { $null }), | |
| [string]$CachePath = (Join-Path $PSScriptRoot 'onedrive-token-cache.json') |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| Upload a local file to Microsoft OneDrive using Microsoft Graph. | |
| .DESCRIPTION | |
| Supports: | |
| - Delegated OAuth (device code + refresh token) — works for personal | |
| Microsoft accounts AND work/school OneDrive | |
| - App-only client credentials — work/school only; uploads into a | |
| specific user's drive (requires admin-consented application permission) |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """Find MITRE ATT&CK techniques that do not yet have Jira epics. | |
| Python 3.9+; standard library only. Inputs: Jira CSV/TSV and local ATT&CK JSON. | |
| python jira_attack_gap.py jira_epics.csv --stix-file enterprise-attack.json | |
| python jira_attack_gap.py jira_epics.csv --stix-file /path/to/enterprise-attack.json --scope all | |
| Defaults: CIBETHICAL, Enterprise ATT&CK, top-level techniques only. | |
| MITRE IDs are read from Summary and Epic Name, or explicit --id-columns. |
This file contains hidden or 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
| function ConvertTo-VectrOutcome { | |
| param( | |
| $StatusValue, | |
| $Finding, | |
| [string] $FindingName, | |
| [string] $DetectedPath = 'Alerted.Alerted_Priority_Medium', | |
| [string] $DetectedHighPath = 'Alerted.Alerted_Priority_High', | |
| [string] $DetectedBlockedPath = 'Blocked.Blocked_Alerted_Yes', | |
| [string] $NotDetectedPath = 'TBD' | |
| ) |
This file contains hidden or 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
| function Get-CymulateLaunchedAssessment { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory = $true)] [string] $BaseUrl, | |
| [Parameter(Mandatory = $true)] [string] $Token, | |
| [Parameter(Mandatory = $true)] [string] $AssessmentId, | |
| [string] $LaunchedAssessmentsPath = '/v2/assessments/launched', | |
| [int] $TimeoutSec = 100, | |
| [bool] $SkipCertificateCheck = $false | |
| ) |
This file contains hidden or 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
| function Get-CymulateLaunchedAssessment { | |
| param( | |
| [string] $BaseUrl, | |
| [string] $LaunchedAssessmentsPath, | |
| [string] $Token,function Get-CymulateLaunchedAssessment { | |
| param( | |
| [string] $BaseUrl, | |
| [string] $LaunchedAssessmentsPath, | |
| [string] $Token, | |
| [string] $AssessmentId, |
This file contains hidden or 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
| $cymulateScenarioId = '' | |
| $argsProp = $SiemFinding.PSObject.Properties['scenarioInputArguments'] | |
| if ($null -ne $argsProp -and $null -ne $argsProp.Value) { | |
| $first = @($argsProp.Value)[0] | |
| if ($null -ne $first) { | |
| $sid = $first.PSObject.Properties['scenarioId'] | |
| if ($null -ne $sid -and $null -ne $sid.Value) { | |
| $cymulateScenarioId = ([string]$sid.Value).Trim() | |
| } | |
| } |
NewerOlder