Skip to content

Instantly share code, notes, and snippets.

View avishayil's full-sized avatar

Avishay Bar avishayil

View GitHub Profile
@avishayil
avishayil / vouch.log
Created November 29, 2022 07:13
Vouch logs
{"level":"debug","ts":1669705807.9557645,"msg":"/validate"}
{"level":"warn","ts":1669705807.9558208,"msg":"no jwt found in request"}
{"level":"debug","ts":1669705807.955828,"msg":"domain vouch.xxxxxxxx-xxxxxxxx-xxx.com matched array value at [0]=xxxxxxxx-xxxxxxxx-xxx.com"}
{"level":"debug","ts":1669705807.955846,"msg":"CaptureWriter.Write set w.StatusCode 401"}
{"level":"info","ts":1669705807.955945,"msg":"|401| 107.511µs /validate","statusCode":401,"request":84,"latency":0.000107511,"avgLatency":0.000041799,"ipPort":"10.0.1.27:45214","method":"GET","host":"vouch.xxxxxxxx-xxxxxxxx-xxx.com","path":"/validate","referer":""}
{"level":"debug","ts":1669705808.6687164,"msg":"/login"}
{"level":"debug","ts":1669705808.6688216,"msg":"domain vouch.xxxxxxxx-xxxxxxxx-xxx.com matched array value at [0]=xxxxxxxx-xxxxxxxx-xxx.com"}
{"level":"debug","ts":1669705808.668937,"msg":"session state set to bEdJmhNtER4c0ClSoVss2yqyBlHd396"}
{"level":"debug","ts":1669705808.6690376,"msg":"Login url param normalized to 'https://k8sda
@avishayil
avishayil / decode_cookie.py
Created November 21, 2022 10:48
Python tool that takes vouch-proxy cookie as input and returns decoded and decompressed, parsed JWT token
main.yml
dev/
identity_providers/
main.yml # `iam_saml_federation` module tasks
idp_metadata.xml # idp metadata document
groups/
main.yml # `iam_group` module tasks
users/
main.yml # `iam_user` module tasks
roles/
---
- iam_policy:
iam_type: role
iam_name: Developer
policy_name: DeveloperAccess
policy_document: dev/policies/DeveloperAccess.json
state: present
- iam_policy:
---
- iam_role:
name: Admin
assume_role_policy_document: "{{ lookup('file','trust-okta.json') }}"
managed_policy:
- arn:aws:iam::aws:policy/AdministratorAccess
state: present
- iam_role:
@avishayil
avishayil / deny-policy-not-matches-ip.json
Created September 21, 2019 08:18
This IAM Policy denies any request if it doesn't originate from the explicitly mentioned IP address.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [
@avishayil
avishayil / .kitchen.yml
Created December 6, 2018 22:41
Test-Kitchen .kitchen.yml for AWS environments
---
driver:
name: ec2
platforms:
- name: windows-2016
driver_plugin: ec2
driver_config:
tags:
created-by: test-kitchen
@avishayil
avishayil / route53.sh
Created October 14, 2018 17:00
Update Route53 Record With Machine IP Address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
# PATH=PATH
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="ZONEID"
# The CNAME you want to update e.g. hello.example.com
@avishayil
avishayil / bitbucket-pipelines.yml
Created January 19, 2018 00:37
Pipelines YAML to Elastic Beanstalk Deployment
image: python:3.5.1
pipelines:
branches:
master:
- step:
script:
- apt-get update # required to install zip
- apt-get install -y zip # required for packaging up the application
- pip install boto3==1.3.0 # required for beanstalk_deploy.py
@avishayil
avishayil / beanstalk_deploy.py
Created January 19, 2018 00:36
Python deployment script to Elastic Beanstalk Application
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on an "AS IS"
# BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under the License.