Skip to content

Instantly share code, notes, and snippets.

@kgilpin
kgilpin / README.md
Last active February 11, 2016 22:23
Conjur Traffic Auth for the Truly Paranoid

Approach

Create distinct roles with specific permissions to call untrusted web services.

Client services authenticate as one of these roles when calling an untrusted web service.

Discussion

When using an externalized (Nginx) forwarder and gatekeeper, a webservice client can send a Conjur access token for its own identity. The client doesn't have to worry about the gatekeeper misusing the access token,

@kgilpin
kgilpin / myapp.yml
Created September 1, 2017 13:53
AnsibleFest Policy Refactor
- !policy
id: myapp
body:
- &variables
- !variable
id: database/username
annotations:
description: Application database username
- !variable
id: database/password
@kgilpin
kgilpin / authn_k8s.yml
Last active December 5, 2017 14:18
authn-k8s
- !policy
id: conjur/authn-k8s/minikube/default
owner: !group /k8s_admin
body:
- !webservice
annotations:
kubernetes/namespace: default
- !host client
@kgilpin
kgilpin / policy-2.yml
Created February 2, 2018 16:15
User management bug
root@3935c7d86a07:/# cat policy-2.yml
- !user alice
- !group developers
- !grant
role: !group developers
member: !user alice
@kgilpin
kgilpin / test.md
Created June 4, 2018 18:07
Test JS

hi

<script> alert('hi') </script>
@kgilpin
kgilpin / Rails Sample App 6th Ed - Microposts interface test URL
Last active October 15, 2020 18:10
Rails Sample App 6th Ed - Microposts interface test
https://app.land/applications/219?mapset=1970
@kgilpin
kgilpin / README.md
Last active February 10, 2021 21:11
VSCode project with Rails gem paths

Usage

  1. Save rails_gem_paths.rb to your local directory

  2. Run this command to open a VSCode project containing the local directory and all "active*" and "action*" gems. The script also prints out the gem names in appmap.yml form.

code . $(bundle exec ruby rails_gem_paths.rb)
# - gem: actioncable
# - gem: actionmailbox
@kgilpin
kgilpin / appmap.yml
Created February 12, 2021 14:56
appmap.yml for Rails Sample App 6th Edition
name: sample_app_6th_ed
packages:
- path: app/mailers
- path: app/models
- path: app/jobs
- path: app/controllers
- path: app/helpers
- gem: actioncable
- gem: actionmailbox
- gem: actionmailer
@kgilpin
kgilpin / main.py
Last active March 2, 2021 17:54
SSH connection from Python
import sys
import os
import appmap
#start the recorder
r = appmap.Recording()
with r:
#run the SSH demo code
import sshdemo
sshdemo.Demo().runDemo()
{
"$schema": "https://aka.ms/codetour-schema",
"title": "Install AppMap for RSpec",
"steps": [
{
"file": "spec/spec_helper.rb",
"description": "You'll now install the AppMap RSpec helper.\n\n```ruby\nrequire 'appmap/rspec'\n```\n\nThis line should be placed **before** any other `require` statements.\n",
"line": 2,
"contents": "require 'appmap/rspec'"
},