Skip to content

Instantly share code, notes, and snippets.

Avatar

Alain O'Dea AlainODea

View GitHub Profile
@AlainODea
AlainODea / README.md
Created Dec 18, 2020
Salesforce Flow InvocableMethod plugin for sending Lightning Email Templates
View README.md

Salesforce Flow InvocableMethod plugin for sending Lightning Email Templates

This is an example implementation of supporting sending Lightning Email Templates from a Flow using @InvocableMethod.

Notes

Example__c won't necessarily exist or have matching fields. It is in here to inspire what you might do.

If you want to try this unmodified, you'll need to create a custom Object with an API name of Example. It will need to have fields with API names Email__c (Lookup(Contact)) and ExampleEmail__c (String or Email).

@AlainODea
AlainODea / alienvault.py
Created Jul 23, 2020
Example of connecting to AlienVault API using Python Requests 2 and Requests-OAuthlib
View alienvault.py
import json
from requests.auth import HTTPBasicAuth
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from getpass import getpass
domain = "alienvault.cloud"
subdomain = "example" # use your actual subdomain
@AlainODea
AlainODea / README.md
Last active Jun 15, 2020
Allowing Microsoft Update through a transparent Squid TLS proxy
View README.md

Allowing Microsoft Update through a transparent Squid TLS proxy

Using Squid and getting TAG_NONE on sls.update.microsoft.com and several other domains?

Root Cause

The problem is certificate related. These domains use Microsoft Root Certificate Authority 2011 which is not publicly trusted. It is trusted by Windows, but not in general.

Remedy

@AlainODea
AlainODea / README.md
Last active Sep 3, 2020
An Amazon Linux 2 Squid web proxy with a SASL-authenticated Postfix Implicit TLS for SMTP Submission relay to Amazon SES built with Packer and Terraform
View README.md

Squid and Postfix SES Relay

A Squid transparent proxy server with Postfix configured as a SASL-authenticated SMTP relay to Amazon Simple Email Service (SES).

How do you use this module?

  • See the root README for instructions on using Terraform modules.
  • See variables.tf for all the variables you can set on this module.
  • See outputs.tf for all outputs you can get from this module in a terraform_remote_state data source.
@AlainODea
AlainODea / legal_fargate_configurations.md
Last active May 13, 2020
No Fargate configuration exists for given values
View legal_fargate_configurations.md
@AlainODea
AlainODea / Dockerfile
Created Apr 8, 2020
Circle CI multi-version Terraform Dockerfile with Gruntwork tools (you need a Gruntwork subscription to use them)
View Dockerfile
# The CircleCi builds will run in the Docker image built from this Dockerfile. To build a new image:
#
# 1. docker build -t <ACCOUNT_ID>.dkr.ecr.ca-central-1.amazonaws.com/circle-ci-build:<VERSION> --build-arg GITHUB_OAUTH_TOKEN=<YOUR_TOKEN> .
# 2. eval "$(aws ecr get-login --region ca-central-1 --no-include-email)"
# 3. docker push <ACCOUNT_ID>.dkr.ecr.ca-central-1.amazonaws.com/circle-ci-build:<VERSION>
# 4. Update the image setting in config.yml to your new VERSION.
#
# Note that we use a multi-stage build. This allows us to pass in the GITHUB_OAUTH_TOKEN secret (which we use to access
# the private gruntwork-io repos) as a build arg without it being stored in the build history. For more info, see:
#
@AlainODea
AlainODea / README.md
Created Feb 27, 2020
Terragrunt config to auto-generate provider and backend config so you can apply library modules directly in infrastructure-live without an adapter module in infrastructure-modules
View README.md

Using Terragrunt generate for extra DRY Terraform

Terragrunt config to auto-generate provider and backend config so you can apply library modules directly in infrastructure-live without an adapter module in infrastructure-modules.

@AlainODea
AlainODea / lambda_function.py
Created Oct 30, 2019
Providing encrypted environment variables to a Lambda decrypted on boot
View lambda_function.py
from lib.secret_config import load_secret_config_from_env
def lambda_handler(event, context):
"""
The Handler function, which receives the lambda event and orchestrates the
response. It is called and passed args by Lambda.
Args:
event: The lambda event, which includes arguments from API Gateway.
context: Info about the execution context of the lambda.
"""
@AlainODea
AlainODea / DocumentBuilderFactory_XXE_mitigation.md
Last active May 17, 2021
DocumentBuilderFactory that mitigates XXE using OWASP guidance
View DocumentBuilderFactory_XXE_mitigation.md

Recommended mitigation:

Replace this dangerous code:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.isIgnoringElementContentWhitespace();
DocumentBuilder builder = factory.newDocumentBuilder();
@AlainODea
AlainODea / w.tf
Created Dec 18, 2018
A Terraform module that cannot be constructed (Error: module "WTF": missing required argument "version")
View w.tf
variable "version" {}