Skip to content

Instantly share code, notes, and snippets.

View ardeshir's full-sized avatar
🎯
Focusing

sepahsalar ardeshir

🎯
Focusing
View GitHub Profile
Lab 1, step 8
argocd app create roar-deploy-k8s --repo https://github.com/brentlaster/roar-deploy-k8s --path . --dest-server $CLUSTER_IP --dest-namespace roar
Lab 3, step 3
argocd repo add git@10.0.2.15:/git/repos/roar-k8s-helm.git --ssh-private-key-path ~/.ssh/id_rsa
Lab 4, step 9
argocd proj create jenkins-proj -d https://10.0.2.15:8443,* -s git@10.0.2.15:/git/repos/roar-min-deploy.git
Lab 4, step 11
@ardeshir
ardeshir / audit-on-push.yml
Created January 30, 2023 00:35 — forked from LukeMathWalker/audit.yml
GitHub Actions - Rust setup
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
@ardeshir
ardeshir / Force_MFA
Created December 30, 2022 15:23 — forked from TJM/Force_MFA
Force Multi-Factor Authentication (MFA) on AWS IAM Accounts
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"iam:ListUsers",
"iam:GetAccountSummary"
@ardeshir
ardeshir / azure-pipelines.yml
Created September 16, 2022 20:09
Azure Infra with Terraform
trigger:
- devel
pool:
vmImage: ubuntu-latest
variables:
- group: TerraformConfiguration
- group: TerraformVariables
parameters:
- name: ENVIRONMENT
default: DEV
@ardeshir
ardeshir / azure-pipelines.yml
Created September 16, 2022 20:06
AWS Infra with Terraform
trigger:
- main
pool:
vmImage: ubuntu-latest
variables:
- group: TerraformConfiguration
- group: TerraformVariables
parameters:
- name: ENVIRONMENT
@ardeshir
ardeshir / encrypt.sh
Created September 10, 2022 15:19
encrypt your files
#!/bin/bash
set -e
if [[ "$#" -ne 4 ]]; then
echo "Usage: encrypt.sh <CMK_ID> <AWS_REGION> <INPUT_FILE> <OUTPUT_FILE>"
exit
fi
CMK_ID="$1"
#!/usr/bin/env bash
# terraform-security1-app builds the security1 site envs
# usage execute terraform code using the "terraform-envs.sh" script. This script is invoked as follows:
# ./terraform-envs.sh dev
# env is a reference to one of the subfolders in the env directory.
# variable files and terraform code in these directories will be included upon the execution of the script.
@ardeshir
ardeshir / ssm_parameter.go
Created December 13, 2019 04:43 — forked from miguelmota/ssm_parameter.go
AWS SSM Go SDK parameter store example
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ssm"
)
@ardeshir
ardeshir / clean_old_lambda_versions.py
Created October 9, 2019 16:27 — forked from tobywf/clean_old_lambda_versions.py
A quick script to remove old AWS Lambda function versions
from __future__ import absolute_import, print_function, unicode_literals
import boto3
def clean_old_lambda_versions():
client = boto3.client('lambda')
functions = client.list_functions()['Functions']
for function in functions:
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions']
for version in versions:
@ardeshir
ardeshir / lambda-basic-auth.js
Created June 11, 2019 19:25 — forked from lmakarov/lambda-basic-auth.js
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';