Skip to content

Instantly share code, notes, and snippets.

var mlSliderLevels = []string{"DISABLED", "CAUTIOUS", "MODERATE", "AGGRESSIVE", "EXTRA_AGGRESSIVE"}
var mapMlSliderLevels = map[string]int{
"DISABLED": 0,
"CAUTIOUS": 1,
"MODERATE": 2,
"AGGRESSIVE": 3,
"EXTRA_AGGRESSIVE": 4,
}
detectionLevel := slider.Detection.String()
package prevention_policy
import (
"context"
"fmt"
"time"
"github.com/crowdstrike/gofalcon/falcon/client"
"github.com/crowdstrike/gofalcon/falcon/client/prevention_policies"
"github.com/crowdstrike/gofalcon/falcon/models"
"schedule": schema.SingleNestedAttribute{
Optional: true,
Description: "Prohibit sensor updates during a set of time blocks.",
Attributes: map[string]schema.Attribute{
"timezone": schema.SetAttribute{
Required: true,
Description: "The time zones that will be used for the time blocks.",
},
"time_block": schema.SetNestedAttribute{
Required: true,
"host_groups.UpdateGroupReqV1": {
"description": "A specific group to be updated",
"required": [
"id"
],
"properties": {
"assignment_rule": {
"description": "The new assignment rule of the group. Note: If the group type is static, this field cannot be updated manually",
"x-nullable": true,
"type": "string"
type osResource struct {
Bucket string
Object string
Generation int64
}
type Policy struct {
Cid string
LinuxInstallParams string
WindowsInstallParams string
if ! _resp="$(curl --retry 15 --retry-delay 10 -sf -H "Authorization: Bearer ${SSM_CS_AUTH_TOKEN}" -H "User-Agent: $userAgent" "$URL")" ; then
errcho "Failed getting url (exit status $?)..."
"$@"
echo "${_resp}"
echo _resp
fi
@ffalor
ffalor / CreateMonoDscLayerZero.py
Last active October 20, 2020 15:12
Create a mono baseline file for Powershell Dsc
import csv
from pytablewriter import MarkdownTableWriter
DSC_FILE_NAME = "w2019MonoLayerZero.ps1"
CSV_FILE_NAME = "DSCResources.csv"
def mdtable(value_matrix):
"""
Generate Markdown table for resource.
@ffalor
ffalor / bolt_inventory.ps1
Created July 12, 2020 17:00
Powershell script to convert CSV to Bolt Inventory
$user = Read-Host -Prompt 'Input username'
$password = Read-Host -Prompt 'Input password'
$csv_path = Read-Host -Prompt 'Input path to inventory CSV'
$yaml_module = "powershell-yaml"
if ($null -eq (Get-InstalledModule -Name $yaml_module -ErrorAction SilentlyContinue)) {
Install-Module $yaml_module
}