mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
Fix listing configurations if default output format is not JSON check119,extra742,extra75 and extra772 @anthirian
Fix listing configurations if default output format is not JSON
This commit is contained in:
@@ -18,7 +18,7 @@ CHECK_ALTERNATE_check119="check119"
|
|||||||
|
|
||||||
check119(){
|
check119(){
|
||||||
for regx in $REGIONS; do
|
for regx in $REGIONS; do
|
||||||
EC2_DATA=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[].Instances[].[InstanceId, IamInstanceProfile.Arn, State.Name]')
|
EC2_DATA=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[].Instances[].[InstanceId, IamInstanceProfile.Arn, State.Name]' --output json)
|
||||||
EC2_DATA=$(echo $EC2_DATA | jq '.[]|{InstanceId: .[0], ProfileArn: .[1], StateName: .[2]}')
|
EC2_DATA=$(echo $EC2_DATA | jq '.[]|{InstanceId: .[0], ProfileArn: .[1], StateName: .[2]}')
|
||||||
INSTANCE_LIST=$(echo $EC2_DATA | jq -r '.InstanceId')
|
INSTANCE_LIST=$(echo $EC2_DATA | jq -r '.InstanceId')
|
||||||
if [[ $INSTANCE_LIST ]]; then
|
if [[ $INSTANCE_LIST ]]; then
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ extra742(){
|
|||||||
|
|
||||||
textInfo "Looking for secrets in CloudFormation output across all regions... "
|
textInfo "Looking for secrets in CloudFormation output across all regions... "
|
||||||
for regx in $REGIONS; do
|
for regx in $REGIONS; do
|
||||||
CFN_STACKS=$($AWSCLI cloudformation describe-stacks $PROFILE_OPT --region $regx)
|
CFN_STACKS=$($AWSCLI cloudformation describe-stacks $PROFILE_OPT --region $regx --output json)
|
||||||
LIST_OF_CFN_STACKS=$(echo $CFN_STACKS | jq -r '.Stacks[].StackName')
|
LIST_OF_CFN_STACKS=$(echo $CFN_STACKS | jq -r '.Stacks[].StackName')
|
||||||
if [[ $LIST_OF_CFN_STACKS ]];then
|
if [[ $LIST_OF_CFN_STACKS ]];then
|
||||||
for stack in $LIST_OF_CFN_STACKS; do
|
for stack in $LIST_OF_CFN_STACKS; do
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ extra75(){
|
|||||||
textInfo "Looking for Security Groups in all regions... "
|
textInfo "Looking for Security Groups in all regions... "
|
||||||
|
|
||||||
for regx in $REGIONS; do
|
for regx in $REGIONS; do
|
||||||
SECURITYGROUPS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --max-items $MAXITEMS | jq '.SecurityGroups|map({(.GroupId): (.GroupName)})|add')
|
SECURITYGROUPS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --max-items $MAXITEMS --output json | jq '.SecurityGroups|map({(.GroupId): (.GroupName)})|add')
|
||||||
if [[ $SECURITYGROUPS == "null" ]];
|
if [[ $SECURITYGROUPS == "null" ]];
|
||||||
then
|
then
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ CHECK_ALTERNATE_check772="extra772"
|
|||||||
|
|
||||||
extra772(){
|
extra772(){
|
||||||
for region in $REGIONS; do
|
for region in $REGIONS; do
|
||||||
EIP_DUMP=$($AWSCLI ec2 describe-addresses ${PROFILE_OPT} --region $region)
|
EIP_DUMP=$($AWSCLI ec2 describe-addresses ${PROFILE_OPT} --region $region --output json)
|
||||||
EIP_LIST=$(echo $EIP_DUMP | jq -r '.Addresses[].AllocationId')
|
EIP_LIST=$(echo $EIP_DUMP | jq -r '.Addresses[].AllocationId')
|
||||||
if [[ $EIP_LIST ]]; then
|
if [[ $EIP_LIST ]]; then
|
||||||
for eip in $EIP_LIST; do
|
for eip in $EIP_LIST; do
|
||||||
|
|||||||
Reference in New Issue
Block a user