Skip to content

Instantly share code, notes, and snippets.

View SyCode7's full-sized avatar

SyCode7

View GitHub Profile
@SyCode7
SyCode7 / gpt.py
Created February 5, 2023 16:07 — forked from ustayready/gpt.py
CloudGPT - Use ChatGPT to analyze AWS policies for vulnerabilities
import openai
import boto3
import json
import time
from typing import Dict, List
openai.api_key = '### SET YOUR OPENAPI API KEY HERE ###'
session = boto3.session.Session()
client = session.client('iam')
@ustayready
ustayready / gpt.py
Created January 16, 2023 23:49
CloudGPT - Use ChatGPT to analyze AWS policies for vulnerabilities
import openai
import boto3
import json
import time
from typing import Dict, List
openai.api_key = '### SET YOUR OPENAPI API KEY HERE ###'
session = boto3.session.Session()
client = session.client('iam')
@iann0036
iann0036 / gist:b473bbb3097c5f4c656ed3d07b4d2222
Last active April 28, 2024 11:47
List of expensive / long-term effect AWS IAM actions
route53domains:RegisterDomain
route53domains:RenewDomain
route53domains:TransferDomain
ec2:ModifyReservedInstances
ec2:PurchaseHostReservation
ec2:PurchaseReservedInstancesOffering
ec2:PurchaseScheduledInstances
rds:PurchaseReservedDBInstancesOffering
dynamodb:PurchaseReservedCapacityOfferings
s3:PutObjectRetention
@azarzar15
azarzar15 / gist:10651cee08ba7bff9948bd9c520eacf8
Created April 1, 2021 16:47
AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy_PE
aws ec2 create-launch-template \
--launch-template-name TemplateForWebServer1 \
--version-description WebVersion1 \
--launch-template-data '{"NetworkInterfaces":[{"AssociatePublicIpAddress":true,"DeviceIndex":0,"Ipv6AddressCount":1,"SubnetId":"<REPLACE_WITH_SUBNET_ID>"}],"ImageId":"ami-05d72852800cbf29e","InstanceType":"t2.small","TagSpecifications":[{"ResourceType":"instance","Tags":[{"Key":"purpose","Value":"webserver"}]}]}' --region us-east-2
aws ec2 run-instances \
--launch-template LaunchTemplateId=<REPLACE_WITH_LT_OUTPUT>,Version=1 --iam-instance-profile '{"Arn": "<REPLACE_WITH_INSTANCE_PROFILE_ARN>"}' --region us-east-2
AWSTemplateFormatVersion: 2010-09-09
Description: >-
AWS CloudFormer Beta - template creation prototype application. This tool
allows you to create an AWS CloudFormation template from the AWS resources in
your AWS account. **Warning** This template creates a single EC2 instance in
your account to run the application - you will be billed for the instance at
normal AWS EC2 rates.
Parameters:
Username:
Description: Username to log in to CloudFormer
provider "aws" {
version = "~> 2.0"
region = "eu-west-2"
}
# Providing a reference to our default VPC
resource "aws_default_vpc" "default_vpc" {
}
# Providing a reference to our default subnets
@namishelex01
namishelex01 / Security Engineer - Interview Questions.md
Last active February 28, 2024 03:47
Cyber security engineer, Security Engineer, Security Analyst, Information Security Analyst and many more names

Core Information Security

  • What is information security and how is it achieved?

  • What are the core principles of information security?

  • What is the CIA triangle?

  • What is non-repudiation (as it applies to IT security)?

@robnolen
robnolen / auditor.yaml
Created January 11, 2018 23:57
CloudFormation template to create Security auditor role
AWSTemplateFormatVersion: 2010-09-09
Description: This template creates a role that provides permissions to a specific account/iam user to access audit features
Parameters:
UserARNS:
Type: CommaDelimitedList
Default: "arn1,arn2,arn3"
Description: "Provide a comma delimited list of ARNs for users that you want to assume the role. (arn:aws:iam::123456789012:user/testuser)"
Resources:
@JohnTroony
JohnTroony / DropBoxLoot.py
Created October 3, 2017 17:58
Python Script Post Exploitation Activities (Data Exfiltration where network bandwidth is limited but Dropbox is allowed).
# -*- coding: utf-8 -*-
"""
@author: John Ombagi
"""
import os
import sys
import base64
import dropbox
import time
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}