forked from CrowdStrike/cloud-resource-estimator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
executable file
·59 lines (52 loc) · 1.35 KB
/
benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Universal cloud provider provisioning calculator
# Identifies the current cloud provider, then downloads the necessary scripts
# to perform a sizing calculation.
#
# Creation date: 03.25.21, Joshua Hiller @ CrowdStrike
#
audit_AWS(){
# AWS audit
curl -o aws_count.py https://raw.githubusercontent.com/rasa-jmac/Cloud-Benchmark/main/AWS/aws_cspm_benchmark.py
pip3 install --user tabulate
python3 aws_count.py
rm aws_count.py
}
audit_Azure(){
# Azure audit
curl -o azure_count.py https://raw.githubusercontent.com/CrowdStrike/Cloud-Benchmark/main/Azure/azure_cspm_benchmark.py
python3 -m pip install azure-mgmt-resource azure-identity # azure-mgmt-subscription
python3 azure_count.py
rm azure_count.py
}
audit_GCP(){
# GCP audit
curl https://raw.githubusercontent.com/CrowdStrike/Cloud-Benchmark/main/GCP/gcp-cspm-benchmark.sh | /bin/bash
}
# MAIN ROUTINE
echo "Determining cloud provider"
if type aws >/dev/null 2>&1; then
echo "This is AWS"
audit_AWS
fi
if type az >/dev/null 2>&1; then
echo "This is Azure"
audit_Azure
fi
if type gcloud >/dev/null 2>&1; then
echo "This is GCP"
audit_GCP
fi
# END
#
# -''--.
# _`> `\.-'<
# _.' _ '._
# .' _.=' '=._ '.
# >_ / /_\ /_\ \ _< - jgs
# / ( \o/\\o/ ) \
# >._\ .-,_)-. /_.<
# /__/ \__\
# '---' E=mc^2
#
#