elastic / SWAT

Simple Workspace Attack Tool (SWAT) is a tool for simulating malicious behavior against Google Workspace in reference to the MITRE ATT&CK framework.
Apache License 2.0
160 stars 7 forks source link

[Emulation Tuning] Adjusts `Add Admin Roles to User(s)` emulation #72

Closed terrancedejesus closed 1 year ago

terrancedejesus commented 1 year ago

Overview

This pull request adjusts the emulation Add Admin Roles to User(s). Previously, this emulation served as a hello world for examples of running emulations. This emulation is now fully operational.

Emulation workflow

  1. create a user in google workspace
  2. dynamically generate a 12 character password for user
  3. get a list of pre-built administrator roles from Google Workspace
  4. for every admin role, assign it to the new user
  5. delete the created user
Screenshot 2023-08-28 at 1 20 10 PM

Additional Information

Mikaayenson commented 1 year ago

Are you generating an alert or some event data to validate that the emulation works as expected, or do you have a screenshot to show that the automation works?

terrancedejesus commented 1 year ago

Are you generating an alert or some event data to validate that the emulation works as expected, or do you have a screenshot to show that the automation works?

@Mikaayenson For sure. The audit command allows us to pull logs from Google Workspace and output to console in a tabular format. Command: audit admin 24h --export --export-format=csv Results: admin_24h.csv

Command: audit admin 24h --interactive Results: Below

Screenshot 2023-08-29 at 10 00 25 AM

Also, SWAT has a global and emulation specific logger for both console and file, so here is the log file for this emulation. Starting at line 135 reflects the existing code changes for this pull request. Before this are logs captured during dev and troubleshooting.

persistence_admin_add_admin_roles_to_users.log - User has been deleted.