diff --git a/OWASPGlobalDC.md b/OWASPGlobalDC.md index 4069697..5bbcc36 100644 --- a/OWASPGlobalDC.md +++ b/OWASPGlobalDC.md @@ -27,6 +27,15 @@ WARNING: Noo Yawk --- + + # outline 1. intro 1. outline @@ -159,6 +168,13 @@ sidebar if I had to again: # the how: threat modeling FLOSS? + + - what do we need in threat modeling? - ~~defined users~~ distributed user base - ~~responsible devs~~ distributed, unpaid dev base @@ -217,7 +233,8 @@ sidebar if I had to again: - Unsigned to Signed - Wrong Width: `$GO_ARCH`-specific width to 16/32/64 bits - Both: many flows of `strconv.Atoi` => `int16` -- devs may not have background on machine-width ints +- devs may not have background on machine-width ints +- TOB-K8S-015 & Appendix B --- @@ -240,15 +257,120 @@ parsed, err := strconv.ParseInt(string(s[1:]), 10, 64) # the what: devs -logging things that shouldn't be logged, missing logging, log rotation +- a wide range of audit/logging backgrounds +- high security vs standard applications +- end result? + - TOB-K8S-001: Bearer tokens are revealed in logs + - TOB-K8S-026: Directory traversal of host logs running kube-apiserver and kubelet + - TOB-K8S-007: Log rotation is not atomic + - TOB-K8S-TM05: Credentials exposed in environment variables and command-line + - TOB-K8S-TM06: Names of secrets are leaked in logs + + + +--- + +# the what: devs + + + +- devs often do not have context between items +- diff components have diff devs +- innocuous code leads to problems + +``` +if rt.levels[debugCurlCommand] { + klog.Infof("%s", regInfo.toCurl()) +} + +if rt.levels[debugRequestHeaders] { + // ... +} +``` + +--- + +# the what: devs + +- we need logs! +- logs are hard coded to go to "/var/log" +- we need to see & display logs +- what else lives in /var/log? + +--- + +# the what: devs + +- innocuous code: + +``` +func logFileListHandler(req *restful.Request, +resp *restful.Response) { + logdir := "/var/log" + http.ServeFile(resp.ResponseWriter, + req.Request, logdir) + } +``` + +--- + + + +![log leak](log-leak.png) --- # the what: devs + +- k8s uses many files +- k8s **does not** have standard routines for permissions nor a model +- TOB-K8S-004: Pervasive world-accessible file permissions + +--- + +# the what: devs + + + +``` +cluster/images/etcd/migrate/data_dir.go:49: +err := os.MkdirAll(path, 0777) +cluster/images/etcd/migrate/data_dir.go:87: +err := os.MkdirAll(backupDir, 0777) +``` + +--- + +# the what: devs +- not picking on etcd + - logs + - credentials + - other info +- you **must** pay attention to operational concerns + - no on is coming, it's up to us + --- # the what: linux diff --git a/log-leak.png b/log-leak.png new file mode 100644 index 0000000..3dd4c68 Binary files /dev/null and b/log-leak.png differ