Skip to content

Scripts and resources for multi-cloud (AWS, Azure, GCP + Mac) security tooling running on Linux.

Notifications You must be signed in to change notification settings

mikaelvesavuori/multi-cloud-security-tooling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-cloud security tooling (Linux)

Scripts and resources for multi-cloud (AWS, Azure, GCP) security tooling running on Linux. There's also a script for getting similar results on a Mac.

This repository contains:

  • Scripts for various environments to setup a multi-cloud security Linux testing machine with tooling
  • Example snippets to demonstrate how to run most of the services
  • An example of a recommended networking setup
  • Scripts to generate a virtual machine and network
  • Scripts to tear down cloud resources
  • Some external resources that might be of interest when working with security and pentesting

You should create and use a relevant pentesting IAM profile when using these tools so results are realistic.

Scripts support the following environments

  • Amazon Web Services EC2 (RHEL Linux 2)
  • Azure VM (Ubuntu 18.04)
  • Google Cloud Platform Compute Engine (Debian GNU 9)
  • Mac OS X

Tooling

The script installs:

AWS-specific tooling

Prowler IAM role (AWS-only)

For Prowler to work, you should ideally create (and use) an IAM user based on the SecurityAuditor managed role. Read more at Prowler: IAM policy or Prowler: Bootstrap script.

Another solution: Kali Linux

If you want to run an extra setup (or just don't like CLIs) here's how you can get Kali Linux going on VirtualBox:

Cloud pentesting compliance

Make sure to check how and when you need to make a pentesting request with any of the clouds. Usually you don't need to do that anymore, since at least the multi-cloud tools should just use the respective API to pull data and then analyze it.

Always ensure that you only attempt to affect your own projects, resources and infrastructure. Also make sure that people in your organization that need to be informed of these activities know about the pentesting.

AWS

Excerpt of the linked resources:

AWS customers are welcome to carry out security assessments or penetration tests against their AWS infrastructure without prior approval for 8 services [...] Customers are not permitted to conduct any security assessments of AWS infrastructure, or the AWS services themselves.

Those eight permitted services are:

  • Amazon EC2 instances, NAT Gateways, and Elastic Load Balancers
  • Amazon RDS
  • Amazon CloudFront
  • Amazon Aurora
  • Amazon API Gateways
  • AWS Lambda and Lambda Edge functions
  • Amazon Lightsail resources
  • Amazon Elastic Beanstalk environments

Prohibited activities are:

  • DNS zone walking via Amazon Route 53 Hosted Zones
  • Denial of Service (DoS), Distributed Denial of Service (DDoS), Simulated DoS, Simulated DDoS
  • Port flooding
  • Protocol flooding
  • Request flooding (login request flooding, API request flooding)

In case of "Other Simulated Events" should be emailed to an email address viewable in the below resources.

Resources

Azure

Excerpt of the linked resources:

Acceptable testing includes

  • Tests on your endpoints to uncover the Open Web Application Security Project (OWASP) top 10 vulnerabilities
  • Fuzz testing of your endpoints
  • Port scanning of your endpoints

One type of test that you can’t perform is any kind of Denial of Service (DoS) attack. This includes initiating a DoS attack itself, or performing related tests that might determine, demonstrate or simulate any type of DoS attack.

References

Google Cloud Platform

References

Suggested network configuration

I will use an example for how to set up the suggested networking for AWS. The settings and concepts are essentially the same for GCP and Azure.

AWS example

VPC

Create or host the machine in its own secure VPC.

Suggested name: PentestingMachines-VPC Suggested CIDR: 192.168.0.0/24

Subnets

Create one subnet per Availability Zone in your new VPC.

Suggested name: PentestingMachines-Subnet1a Suggested CIDR: 192.168.100.0/27

Suggested name: PentestingMachines-Subnet1b Suggested CIDR: 192.168.100.32/27

Suggested name: PentestingMachines-Subnet1c Suggested CIDR: 192.168.100.64/27

Security Groups

Create a Security Group. Get your IP from http://whatismyip.host or a similar service.

Suggested name: PentestingMachines-SG

Inbound Rules:

  • HTTP, Protocol: TCP, Port Range: 80, Source: 0.0.0.0/0
  • HTTP, Protocol: TCP, Port Range: 80, Source: ::/0
  • SSH, Protocol: TCP, Port Range: 22, Source: XXX.XXX.XXX.XXX/32
  • HTTPS, Protocol: TCP, Port Range: 443, Source: 0.0.0.0/0
  • HTTPS, Protocol: TCP, Port Range: 443, Source: ::/0

Outbound Rules:

  • All Traffic, Protocol: All, Port Range: All, 0.0.0.0/0

Network Access Control List (NACL)

Create a new Network Access Control List. Associate your NACL explicitly with your subnets. Get your IP from http://whatismyip.host or a similar service.

Suggested name: PentestingMachines-NACL

Inbound rules:

  • Rule #100: SSH (22), Port Range: 22, Source: XXX.XXX.XXX.XXX/32, ALLOW
  • Rule #200: All ICMP - IPv4, Port Range: ALL, Source: 0.0.0.0/0, ALLOW
  • Rule #300: All TCP, Port Range: 0-65535, Source: 0.0.0.0/0, ALLOW
  • Rule *: All Traffic, Port Range: ALL, Source: 0.0.0.0/0, DENY

Outbound rules:

  • Rule *: All Traffic, Port Range: ALL, Source: 0.0.0.0/0, DENY

Internet Gateway

Create a new Internet Gateway.

Suggested name: PentestingMachines-IGW

Route Table

If you need a new route table, then create one. Associate your new (above) subnets explicitly with this route table.

Add a new route for 0.0.0.0/0 to point to your new Internet Gateway, so regular internet traffic can work correctly.

Suggested name: PenPentestingMachines-RT

Elastic IP

Allocate a new Elastic IP. Allow it to be reassociated. Associate your instance with this IP.

Launch the machine

Ensure that it uses your new security group and VPC!

About

Scripts and resources for multi-cloud (AWS, Azure, GCP + Mac) security tooling running on Linux.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages