Skip to content

Instantly share code, notes, and snippets.

View allenmichael's full-sized avatar

Allen-Michael Grobelny allenmichael

  • Amazon Web Services
  • Austin, TX
  • X @amsxbg
View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: esoteric-api
labels:
app: esoteric-api
namespace: default
spec:
replicas: 1
selector:
import * as cdk from '@aws-cdk/core';
import * as ec2 from "@aws-cdk/aws-ec2";
import * as ecs from "@aws-cdk/aws-ecs";
import * as secrets from "@aws-cdk/aws-secretsmanager";
import * as ecs_patterns from "@aws-cdk/aws-ecs-patterns";
import { Aws } from '@aws-cdk/core';
export class CdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
import csv
def detect_type(t, s):
if s is '':
print(f'{t} is unknown type')
return {t: 'null'}
if s.isdigit():
print(f'{t} is an int')
return {t: 'int'}
else:
openssl genrsa 2048 > private.pem
openssl req -x509 -new -key private.pem -out public.pem
openssl pkcs12 -export -in public.pem -inkey private.pem -out cert.pfx
cat cert.pfx | base64
# Creating and adding key to Cloud9 environment
ssh-keygen -f ~/path/to/store/key
cat key.pub | pbcopy
# Restarting an environment
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag-key,Values=Environment" "Name=tag-value,Values=Testing" --query Reservations[0].Instances[0].[InstanceId] --output text)
aws ec2 describe-instance-status --instance-ids $INSTANCE_ID
aws ec2 start-instances --instance-ids $INSTANCE_ID
aws ec2 describe-instances --filters "Name=tag-key,Values=Environment" "Name=tag-value,Values=Testing" --query Reservations[].Instances[].[PublicDnsName,InstanceId,Status]
def orchestrator_function(context: df.DurableOrchestrationContext):
logging.info('starting orchestrator')
# Persistent state stored with a Durable Entity
entityId = df.EntityId("TenableExportJob", "currentJobInfo")
state = yield context.call_entity(entityId, "get")
state = json.loads(state)
logging.info('got current state')
logging.info(state)
#!/bin/bash
UBUNTU_64='13147'
UBUNTU_64_NAME='NessusAgent-8.3.0-ubuntu1110_amd64.deb'
WHICH_OS=$(awk -F= '$1=="ID" { print $2 ;}' /etc/os-release)
WHICH_CHIP=$(uname -m)
if [ "$WHICH_OS" = "ubuntu" ]; then
echo 'using ubuntu'
curl -v https://www.tenable.com/downloads/api/v1/public/pages/nessus-agents/downloads/$UBUNTU_64/download?i_agree_to_tenable_license_agreement=true --output $UBUNTU_64_NAME
dpkg -i $UBUNTU_64_NAME
FROM amazonlinux:2.0.20210721.2
RUN touch $HOME/.bashrc
RUN yum -y update
RUN yum -y install tar gzip unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
import boto3
from botocore.exceptions import ClientError
import json
from pprint import pprint
from tenable.dl import Downloads
from zipfile import ZipFile
import re
import hashlib
import logging
Write-Host "Install command has been executed. Nessus Agent will be installed"
$serviceName = 'Tenable Nessus Agent'
$nameE = "Enable Nessus Agent"
$operationE = "Starting Nessus Agent"
$messageE = "Enable Nessus agent"
function DownloadFile {
Param(
[Parameter(Mandatory = $True)]
[hashtable]$Params,