12/13(土) 第1回 Scala 関西勉強会.次の (1) か (2) のどちらかを予定.
前回の
| #!/bin/sh | |
| # Launch a Pod ab-using a hostPath mount to land on a Kubernetes node cluster as root | |
| # without requiring `privileged: true`, in particular can abuse `DenyExecOnPrivileged` | |
| # admission controller. | |
| # Pod command in turn runs a privileged container using node's /var/run/docker.sock. | |
| node=${1} | |
| case "${node}" in | |
| "") | |
| nodeSelector='' | |
| podName=${USER+${USER}-}docker-any |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "os" | |
| "strings" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "fmt" | |
| "os/signal" | |
| "syscall" | |
| "time" |
| /* | |
| The code below shows how to encrypt and then decrypt some plaintext into a cyphertext using | |
| KMS's Encrypt/Decrypt functions and secretbox (https://godoc.org/golang.org/x/crypto/nacl/secretbox). | |
| The plaintext message is sealed into a secretbox using a key that is generated by kmsClient.GenerateDataKey(). | |
| Note that this procedure reuquires that a master key would *already exist in KMS* and that its arn/alias is specified. | |
| The aws library assumes that the proper credentials can be found in the shared file (~/.aws/credentials) | |
| and opts for the 'default' role. | |
| Once sealed, the cyphertext is then unboxed, again by first getting the key from kms (kmsClient.Decrypt), |
| require 'socket' | |
| require 'logger' | |
| STDOUT.sync = true | |
| logger = Logger.new(STDOUT) | |
| watchdog_timeout = (ENV['WATCHDOG_USEC'].to_i / 1_000_000) | |
| sd_notify_socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM) | |
| sd_notify_socket.connect(Addrinfo.unix(ENV['NOTIFY_SOCKET'])) | |
| loop do |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| ) | |
| type items []string |
| #!/bin/bash | |
| usage () | |
| { | |
| cat <<UsageHERE | |
| boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host | |
| Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT | |
| or boot2docker-fwd -d RULE_NAME | |
| or boot2docker-fwd -l | |
| or boot2docker-fwd -A |