Skip to content

AWS security hub findings#13

Draft
saurabh3460 wants to merge 50 commits intorunwhen-contrib:mainfrom
infracloudio:f/security-hub
Draft

AWS security hub findings#13
saurabh3460 wants to merge 50 commits intorunwhen-contrib:mainfrom
infracloudio:f/security-hub

Conversation

@saurabh3460
Copy link
Copy Markdown
Contributor

No description provided.

saurabh3460 and others added 30 commits November 20, 2024 17:14
@saurabh3460 saurabh3460 force-pushed the f/security-hub branch 2 times, most recently from ee34095 to efcc70a Compare January 19, 2025 16:50
@saurabh3460 saurabh3460 changed the title security hub findings AWS security hub findings Jan 20, 2025
@saurabh3460 saurabh3460 marked this pull request as ready for review January 20, 2025 09:01
@saurabh3460
Copy link
Copy Markdown
Contributor Author

This is ready for review @stewartshea

@stewartshea stewartshea self-assigned this Jan 22, 2025
@stewartshea
Copy link
Copy Markdown
Contributor

I'm not quite sure on the implementation of this yet - first I think we need to figure out which regions have security hub enabled, and then which products are enabled, see the example simple script for this type of thing (not yet at all integrated for our codebundles).

#!/bin/bash

echo "Fetching AWS Security Hub status across regions..."
for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); do
  echo -e "\nChecking $region..."
  hub_status=$(aws securityhub describe-hub --region $region --query "HubArn" --output text 2>/dev/null)
  
  if [ -n "$hub_status" ]; then
    echo "✅ Security Hub is enabled in $region"
    echo "🔍 Enabled Products:"
    aws securityhub list-enabled-products-for-import --region $region --query "ProductSubscriptions" --output text 2>/dev/null
  else
    echo "❌ Security Hub is NOT enabled in $region"
  fi
done

I also think we need to address two other things:

  1. are we matching on the right resource (there is a cloudquery resource, but we have to fix/investigate the ARN issue - I will look into this)
  2. What other tasks should we add - this one is collecting findings, but what about cost control or improper configuration, we could also have a task that just lists the enabled products and regions, etc.

We can chat more live.

@stewartshea stewartshea marked this pull request as draft February 3, 2025 12:28
@stewartshea
Copy link
Copy Markdown
Contributor

Converted to draft until it is ready for review again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants