AWS Tag Creation From Uptycs Saved Queries

AWS Tag Creation From Uptycs Saved Queries

This script applies AWS tags to resources based on an Uptycs saved query.

It uses the AWS Python SDK (boto3). 

Usage:   python3 <uptycs_apikey_file> [-q <"query name"> | --all] -k <key> [-v <value>] -ec2 -s3 -efs -vpc -user -role [--domainsuffix <domain>]

Example 1: python3 john_apikey.json -q "My Instance Query" -k environment -v production -ec2

Example 2: python3 john_apikey.json -q "My S3 Query" -k region -v europe -s3

Example 3: python3 no_need_for_uptapikey --all -k ubiquitous -ec2 -efs -s3 -user -role

Required query columns for each resource type:  ec2  - instance_id  

                                                efs  - file_system_id  

                                                role - role_name  

                                                user - user_name  

                                                vpc  - vpc_id

The --domainsuffix flag is only needed for domains others than ''

The --all flag can be used instead of a query (-q flag) to tag all resources of the specified type(s).

The resource type flags that can be used are: -ec2 -s3 -efs -user -role -vpc.

Only one resource type flag can be used with a query (-q flag).

One or more resource type flags can be used with the --all flag.

AWS credentials can be setup with 'aws configure'

    • Related Articles

    • Export/Import Event,Alert Rules or Saved Queries

      The attached python3 code can be used to export one, several, or all event rules, alert rules, or saved queries.  1. Download the attached zip, unzip it 2. Install requirements: python3 -m pip install requirements.txt 3. Export desired objects to ...
    • Create Jira Tickets from Uptycs Alerts

      This python module allows you to create Jira tickets from Uptycs alerts.  Usage: ./ <uptycs_apikey_file> [--domainsuffix <uptycs_domain>] The --domainsuffix flag is only required for uptycs domains other than '' This python script ...
    • Uptycs alert integration with Rocket Chat

      Following is a step by step ReadMe for integration of Uptycs alert with Rocket Chat
    • Demisto - Security Orchestration

      Integrate Uptycs into your Security Orchestration, Automation, and Response architecture using Demisto. Access a full repertoire of Uptycs "actions" directly from within Demisto, and integrate Uptycs actions into your playbooks with simple drag and ...
    • usql

      usql is a command line SQL client for Uptycs with auto-complete and syntax highlighting features. Pre-requisites for installation Python 2.7 or higher For complete details, refer to the article below ...