Skip to content

Instantly share code, notes, and snippets.

View devops-adeel's full-sized avatar
🎯
Focusing

Adeel Ahmad devops-adeel

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am adeelahmad84 on github.
  • I am adeelahmad (https://keybase.io/adeelahmad) on keybase.
  • I have a public key ASBtCsSJa2qo8UeTY4rGmIKinM2ogrOU4lWHMaAxDCsYpwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am devops-adeel on github.
  • I am devops_adeel (https://keybase.io/devops_adeel) on keybase.
  • I have a public key ASB4CR6QVZ3DpLsjF0xMnIFCm8huRq4_u9sEoEZdYY-OSgo

To claim this, I am signing this object:

@devops-adeel
devops-adeel / aws_user_vault.tf
Last active April 22, 2022 16:28
Vault AWS Auth Method - with Rotate Root Credentials invoked.
data "aws_iam_policy_document" "default" {
version = "2012-10-17"
statement {
sid = "AllowVaultAuth"
effect = "Allow"
resources = ["*"]
actions = [
"ec2:DescribeInstances",
@devops-adeel
devops-adeel / registry.tf
Last active March 25, 2022 19:23
MVP TF module for TF-Module Registry for every TFE/C org.
variable "tfe_org" {}
data "vault_generic_secret" "default" {
path = "secret/github_auth"
}
data "tfe_organization" "default" {
name = var.tfe_org
}
@devops-adeel
devops-adeel / audit.tf
Last active November 15, 2022 10:20
Vault Baseline Configuration
resource "vault_audit" "file" {
type = "file"
description = "Vault Audit to File"
options = {
file_path = "/var/log/vault_audit.log"
format = "json"
mode = "0000"
prefix = "vault"
}
@devops-adeel
devops-adeel / ldap.tf
Created February 24, 2022 14:25
vault ldap configuration
resource "vault_ldap_auth_backend" "default" {
path = "ldap"
url = "ldaps://dc-01.example.org"
userdn = "OU=Users,OU=Accounts,DC=example,DC=org"
userattr = "sAMAccountName"
upndomain = "EXAMPLE.ORG"
discoverdn = false
groupdn = "OU=Groups,DC=example,DC=org"
groupfilter = "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))"
}
@devops-adeel
devops-adeel / kubernetes.tf
Last active March 21, 2022 14:21
Vault Auth for Kubernetes
locals {
namespace = format(
"{{identity.entity.aliases.%s.metadata.service_account_namespace}}",
vault_auth_backend.default.accessor
)
}
data "kubernetes_service_account_v1" "default" {
metadata {
name = "vault-auth"
@devops-adeel
devops-adeel / aad_oidc_grp.tf
Last active October 11, 2023 15:30
Terraform snippet to setup AzureAD Auth Method.
locals {
aad_group = var.aad_group
application = var.application_name
mount_accessor = var.mount_accessor
}
data "azuread_group" "default" {
display_name = local.aad_group
}
@devops-adeel
devops-adeel / github_actions_snippet.yaml
Last active April 20, 2022 17:51
Github Actions OIDC Auth Method For Vault.
jobs:
build:
permissions:
contents: read
id-token: write
steps:
- name: Retrieve secret from Vault
uses: hashicorp/vault-action@v2.4.0
with:
url: https://vault-cluster-private-url.aws.hashicorp.cloud:8200
@devops-adeel
devops-adeel / aws_kms_auto_unseal.tf
Last active April 20, 2022 18:00
Minimal AWS IAM permissions on S3 for raft auto-snapshot
data "aws_kms_key" "auto_unseal" {
key_id = "alias/my-key"
}
data "aws_iam_policy_document" "auto_unseal" {
version = "2012-10-17"
statement {
effect = "Allow"
actions = [
"kms:DescribeKey",