This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: esoteric-api | |
| labels: | |
| app: esoteric-api | |
| namespace: default | |
| spec: | |
| replicas: 1 | |
| selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, |