Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update T1580.yaml AWS - EC2 Security Group Enumeration #2659

Merged
merged 27 commits into from
Mar 13, 2024

Conversation

prashanthpulisetti
Copy link
Contributor

Simulate Attacker Action for Enumerating EC2 Security Groups

Details

This update introduces an Atomic Test designed to simulate an attacker's actions in enumerating EC2 Security Groups within a compromised AWS environment. The test leverages the AWS CLI to query and list all security groups, revealing details like group IDs, names, and associated rules. This simulation helps in understanding potential reconnaissance steps an attacker might take after gaining initial access to AWS resources.

Implementation

  • The test uses the aws ec2 describe-security-groups command.
  • Input parameters include the AWS profile (aws_profile) and the desired output format (output_format).
  • This atomic test is compatible with Linux, macOS, Windows, and AWS as an IaaS platform.
  • Prerequisites include the installation and configuration of the AWS CLI, with appropriate permissions to access EC2 Security Group information.

Testing

  • The test was executed in a controlled AWS environment using different profiles with varying permission levels to ensure accurate response based on IAM roles.
  • Tested on various platforms including Linux, macOS, and Windows to ensure compatibility and correct execution of commands.
  • Validation checks were performed to ensure no configuration changes are made in the AWS environment, confirming the test's read-only nature.

Associated Issues

  • There are no known issues associated with this test. However, users should be aware that running this test in a production environment can potentially reveal sensitive security configuration details. It's recommended to execute this in a test or sandbox AWS environment.
  • Care should be taken with the AWS CLI profile used, as profiles with extensive permissions might inadvertently expose more information than intended.

  Simulate an attacker's action to enumerate EC2 Security Groups in a compromised AWS environment.
updated supported_platforms:
iass:aws
updated :

supported_platforms:
  - windows
  - macos
  - linux
  - iaas:aws
updated with 
dependencies:
  - description: AWS CLI installed and configured with the necessary access rights.
    prereq_command: type aws || aws --version
    get_prereq_command: |
      if [ "$(uname)" = "Darwin" ] || [ "$(expr substr $(uname) 1 5)" = "Linux" ]; then
        curl "https://aws.amazon.com/cli/" -o "Install-AWSCLI.sh" && sh Install-AWSCLI.sh
      elif [ "$(expr substr $(uname) 1 5)" = "MINGW" ]; then
        Invoke-WebRequest -Uri "https://aws.amazon.com/cli/" -OutFile "Install-AWSCLI.ps1"; .\Install-AWSCLI.ps1
      fi
atomics/T1580/T1580.yaml Outdated Show resolved Hide resolved
 removed un supported formats
@cyberbuff cyberbuff removed the linux label Jan 20, 2024
@patel-bhavin
Copy link
Collaborator

The PR is updated based on @cyberbuff 's comments ! thank you for the atomic @prashanthpulisetti

@prashanthpulisetti
Copy link
Contributor Author

@patel-bhavin can you confirm if this PR is still open? or can be closed?

@patel-bhavin
Copy link
Collaborator

Yes, the PR is good! Thanks for contributing this test !

@patel-bhavin patel-bhavin merged commit 8fef682 into redcanaryco:master Mar 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants