This file contains 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
# Check if McAfee is installed | |
$mcAfeeInstalled = Get-WmiObject -Query "SELECT * FROM Win32_Product WHERE Name LIKE '%McAfee%'" | Select-Object -ExpandProperty Name | |
if ($mcAfeeInstalled) { | |
Write-Output "McAfee found: $mcAfeeInstalled" | |
exit 1 # Non-zero exit code means remediation is needed | |
} else { | |
Write-Output "McAfee not found" | |
exit 0 # Zero exit code means compliance | |
} |
This file contains 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
#!/bin/bash | |
# Description: | |
# This script retrieves the kubeconfig files for all Linode Kubernetes Engine (LKE) clusters | |
# associated with the user's Linode account and merges them into a single kubeconfig file. | |
# The resulting kubeconfig file is saved as ~/.kube/config. | |
# | |
# Usage: | |
# ./lke_kubeconfig_merge.sh [--debug] [--op] | |
# | |
# Options: |
This file contains 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
#!/bin/bash | |
# Location | |
location=/mnt/data | |
# Start size in MB | |
start_size=100 | |
# End size in GB - Note: Bash does not support floating point arithmetic, so we'll work with MB | |
end_size=$((100 * 1024)) # 100GB in MB | |
# Increment size in MB | |
increment=1024 # 1GB increment |
This file contains 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
#!/bin/bash | |
################################################################################################ | |
# Usage # | |
################################################################################################ | |
# Add this to /etc/profile.d/autologout-tty.sh | |
################################################################################################ | |
# Auto-logout for tty sessions after a period of inactivity | |
if [[ "$(tty)" =~ /dev/tty[0-9]+ ]] || [[ "$(tty)" =~ /dev/ttyS[0-9]+ ]]; then | |
# Set TMOUT to 600 seconds (10 minutes) for tty and ttyS sessions | |
export TMOUT=600 |
This file contains 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
#!/bin/bash | |
################################################################################################ | |
# Usage # | |
################################################################################################ | |
# Ensure a tag is created in the form: "tld: yourdomain.com" and applied to the Linode | |
# Add this to /usr/bin/local/acc-set-hostname.sh | |
# Call this file during the cloud-init <runcmd> block | |
################################################################################################ | |
METADATA_TOKEN="$(curl -s -X PUT -H 'Metadata-Token-Expiry-Seconds: 3600' 'http://169.254.169.254/v1/token')" | |
METADATA_URL="http://169.254.169.254/v1/instance" |
This file contains 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
#!/bin/bash | |
# Prune all unattached volumes | |
linode-cli volumes list --json | jq -r '.[] | select(.linode_id == null) | .id' | xargs -I {} linode-cli volumes delete {} |
This file contains 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
ConfigurationData | |
| where ConfigDataType == "Software" | |
| where SoftwareName contains "Java" or SoftwareName contains "Oracle" | |
| summarize SoftwareInstalled = strcat(iif(countif(SoftwareName contains "Java") > 0, "Java, ", ""), iif(countif(SoftwareName contains "Oracle") > 0, "Oracle", "")) by Computer | |
| order by SoftwareInstalled desc |
This file contains 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
Resources | |
| where type in ('microsoft.sql/servers', 'microsoft.dbformysql/servers', 'microsoft.dbforpostgresql/servers', 'microsoft.documentdb/databaseaccounts', 'microsoft.cache/redis', 'microsoft.web/sites', 'microsoft.compute/virtualmachines', 'microsoft.containerinstance/containergroups' ) | |
| extend resourceType = case( | |
type == 'microsoft.compute/virtualmachines', 'Virtual Machines', | |
type == 'microsoft.containerinstance/containergroups', 'Containers', | |
type in ('microsoft.sql/servers', 'microsoft.dbformysql/servers', 'microsoft.dbforpostgresql/servers', 'microsoft.documentdb/databaseaccounts', | |
'microsoft.cache/redis', 'microsoft.web/sites', 'Unknown' ), 'PaaS', | |
'Unknown' | |
) | |
| summarize count() by resourceType |
This file contains 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
# Google Asset Query (https://console.cloud.google.com/iam-admin/asset-inventory/query) | |
# This extracts all components for licensing in Wiz | |
SELECT | |
assetType, | |
COUNT(*) AS cnt | |
FROM | |
STANDARD_METADATA | |
WHERE | |
assetType IN | |
('compute.googleapis.com/Instance', |
This file contains 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
# KQL query to output the resource counts for Wiz to price against | |
Resources | |
| where type in ( | |
"microsoft.compute/virtualmachines", | |
"microsoft.containerservice/managedclusters", | |
"microsoft.web/sites", | |
"microsoft.storage/storageaccounts", | |
"microsoft.classicstorage/storageaccounts", | |
"microsoft.dbformysql/servers", | |
"microsoft.dbformysql/flexibleservers") |
NewerOlder