arn:<aws_parition>:<aws_service>:[<aws_region>]:<account_id>:<root | resource_type>:/<resource_name>[/<sub_resource_names>...]
Regex: (aws|aws-us-gov|aws-cn)
#! /usr/bin/env python3 | |
''' | |
Needs Requests (pip3 install requests) | |
Author: Marcello Salvati, Twitter: @byt3bl33d3r | |
License: DWTFUWANTWTL (Do What Ever the Fuck You Want With This License) | |
This should allow you to detect if something is potentially exploitable to the log4j 0day dropped on December 9th 2021. |
# code to load the JWT token in PowerShell | |
# Call teh Get-JWTToken method with the App ID and the App Private Key (normal string from env var or file contents, make sure there is no extra line ending at the end of it!). | |
function Build-Payload { | |
Param ( | |
[string] $app_id | |
) | |
$iat = [Math]::Floor([decimal](Get-Date(Get-Date) -UFormat %s)) | |
$payload = @{ | |
"iat" = [int]$iat # issues at = now |
# MIT No Attribution | |
# | |
# Copyright 2022 Ben Kehoe | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
# software and associated documentation files (the "Software"), to deal in the Software | |
# without restriction, including without limitation the rights to use, copy, modify, | |
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so. | |
# |
import * as cdk from '@aws-cdk/core'; | |
import * as ec2 from '@aws-cdk/aws-ec2'; | |
export class CdkSsmEc2Stack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
// import the default VPC | |
const vpc = ec2.Vpc.fromLookup(this, 'VPC', { |
#!/bin/bash | |
# Source: https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html | |
[[ -n "${AWS_ACCESS_KEY_ID}" ]] || { echo "AWS_ACCESS_KEY_ID required" >&2; exit 1; } | |
[[ -n "${AWS_SECRET_ACCESS_KEY}" ]] || { echo "AWS_SECRET_ACCESS_KEY required" >&2; exit 1; } | |
readonly parameterName="SlawekTestParam" | |
readonly method="POST" |
#!/usr/bin/env ts-node | |
// This script uploads your assets to the CDK staging bucket in S3 (just as cdk deploy would) | |
// and writes out two files: | |
// - parameters.ini to use in CLI deployments (see instructions below) | |
// - parameters.json to use in AWS CodePipeline for CloudFormation deployments | |
// | |
// Installation instructions: | |
// - Save this script cdk-package.ts to the root of your CDK repo (i.e. next to cdk.json) and make it executable | |
// - Install script dependencies: npm install jsonpath aws-sdk adm-zip @types/jsonpath @types/adm-zip |
AWSChatbotRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: AWSChatbotRole | |
AssumeRolePolicyDocument: | |
Version: 2012-10-17 | |
Statement: | |
- Effect: Allow | |
Principal: | |
Service: 'chatbot.amazonaws.com' |
FROM debian:10-slim | |
RUN apt-get update -y && \ | |
apt-get install -y awscli curl gnupg && \ | |
apt-key adv --fetch-keys "https://nginx.org/keys/nginx_signing.key" && \ | |
echo "deb http://nginx.org/packages/debian buster nginx" > /etc/apt/sources.list.d/nginx.list | |
RUN curl --silent --show-error --location --output /tmp/amazon-ssm-agent.deb "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb" && \ | |
dpkg -i /tmp/amazon-ssm-agent.deb |