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
{ | |
"gcp_image_family": "rhel-7", | |
"gcp_zone": "asia-southeast1-a", | |
"gcp_ssh_user": "gce-user", | |
"aws_region": "ap-southeast-1", | |
"aws_ami_filter_name": "RHEL-7.7*x86*", | |
"aws_base_ami_owner": "309956199498", | |
"aws_ami_name": "RHEL-7.7", | |
"aws_instance_type": "t2.medium", | |
"aws_ssh_user": "ec2-user" |
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
--- | |
- name: Harden the image | |
hosts: all | |
become: true | |
roles: | |
- dev-sec.os-hardening | |
- dev-sec.ssh-hardening | |
vars: | |
ssh_use_pam: true # to allow access with our key on ec2 |
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
{ | |
"variables": { | |
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}", | |
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}", | |
"aws_instance_type": "{{env `AWS_INSTANCE_TYPE`}}", | |
"aws_ami_name": "{{env `AWS_AMI_NAME`}}", | |
"aws_region": "{{env `AWS_REGION`}}", | |
"aws_ami_filter_name": "{{env `AWS_AMI_FILTER_NAME`}}", | |
"aws_base_ami_owner": "{{env `AWS_BASE_AMI_OWNER`}}" | |
}, |
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
ARG ALPINE_VERSION=3.11 | |
FROM alpine:${ALPINE_VERSION} | |
# packages version | |
ARG PACKER_VERSION=1.6.0 | |
# PARAMETERS | |
ARG PACKER_URL="https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.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
{ | |
"Statement": [ | |
{ | |
"Sid": "PackerSecurityGroupAccess", | |
"Action": [ | |
"ec2:CreateSecurityGroup", | |
"ec2:DeleteSecurityGroup", | |
"ec2:DescribeSecurityGroups", | |
"ec2:AuthorizeSecurityGroupIngress", | |
"ec2:RevokeSecurityGroupIngress" |
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 | |
ALL_RESOURCES=$(kubectl api-resources | awk 'NR>1' | awk '{print $1}' | xargs echo) | |
for i in $ALL_RESOURCES | |
do | |
echo -e "$i\n------------------------------------------------------------------" | |
kubectl get $i --all-namespaces | |
echo -e "\n" | |
done |
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
jobs: | |
should_run: | |
name: should run the next job | |
runs-on: ubuntu-latest | |
steps: | |
- name: check if vb is the commiter | |
if: github.event.pusher.name != 'vibou' | |
run: exit 1 # the job fails if not vibou | |
perform_action: | |
name: should run the next job |
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
module "networking" { | |
source = "../modules/networking" | |
environment = "${var.environment}" | |
vpc_cidr = "${var.vpc_cidr}" | |
public_subnet_cidr = "${var.public_subnet_cidr}" | |
private_subnet_cidr = "${var.private_subnet_cidr}" | |
region = "${var.region}" | |
availability_zone = "${var.availability_zone}" | |
key_name = "${var.key_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
# dump build stage | |
FROM postgres:11-alpine as dumper | |
COPY test_dump.sql /docker-entrypoint-initdb.d/ | |
RUN ["sed", "-i", "s/exec \"$@\"/echo \"skipping...\"/", "/usr/local/bin/docker-entrypoint.sh"] | |
ENV PG_USER=postgres | |
ENV PGDATA=/data |
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 | |
aws ecr describe-repositories | jq -r '.repositories[].repositoryName' |