This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-04
Channels
- # announcements (30)
- # aws (7)
- # babashka (7)
- # beginners (64)
- # calva (39)
- # cherry (17)
- # cider (1)
- # clj-on-windows (6)
- # clojure (30)
- # clojure-austin (12)
- # clojure-europe (25)
- # clojure-nl (2)
- # clojure-norway (23)
- # clojure-spec (23)
- # clojure-uk (6)
- # clojurescript (20)
- # cursive (18)
- # datahike (3)
- # datalevin (12)
- # datomic (9)
- # etaoin (5)
- # graalvm (45)
- # instaparse (2)
- # interceptors (11)
- # kaocha (1)
- # lsp (102)
- # meander (6)
- # nbb (16)
- # off-topic (30)
- # pathom (83)
- # pedestal (6)
- # portal (5)
- # re-frame (12)
- # reitit (5)
- # rewrite-clj (10)
- # scittle (35)
- # shadow-cljs (49)
- # spacemacs (10)
- # vim (14)
Here is some example code of querying ssm using datalog.
;; get all the ssm parameters
(get-all-ssm-params!)
;; => [{:LastModifiedDate #inst "2022-11-04T03:57:44.000-00:00",
;; :Value "mi-woot",
;; :ARN
;; "arn:aws:ssm:us-east-1:595680822218:parameter/state/michigan/zip/123/password",
;; :Name "/state/michigan/zip/123/password",
;; :Type "String",
;; :Version 1,
;; :DataType "text"}
;; {:LastModifiedDate #inst "2022-11-04T03:58:12.000-00:00",
;; :Value "mi-nope",
;; :ARN
;; "arn:aws:ssm:us-east-1:595680822218:parameter/state/michigan/zip/981/password",
;; :Name "/state/michigan/zip/981/password",
;; :Type "String",
;; :Version 1,
;; :DataType "text"}]
;; are all our params with a zip code in the 981 area secure?
(let [ssm-params (get-all-ssm-params!)
schema (ssm-params->schema ssm-params)
conn (d/create-conn schema)]
(d/transact! conn (mapcat param->txts ssm-params))
(d/q '[:find ?type
:where
[?e :zip "981"]
[?e :password ?v]
[?v :Type ?type]]
@conn))
;; => #{["String"]}
;; oh no, there all strings! Not SecureStings!
I have found that a lot of places i have worked at use ssm and end up copying a set param keys per something (sometimes customer or env). And it quickly becomes really hard to get views over various parts of the trees. E.g all the passwords for a common thing all the customers have. Idk let me know if you think this sounds useful or if you see some issue with it. I'll try to get the rest of the code in a git hub repo if ppl are interested.
I heard a story from a customer that they do this kind of data extraction from client AWS accounts, by extracting bunch of data from the AWS account, tucking it into Datahike (I think?) and then making all sorts of queries to analyse security aspects
Does anyone have a work around for invoking lambdas using ARNs with cognitect/aws lib see (https://github.com/cognitect-labs/aws-api/issues/193) ?
Never ran into it :(
I ended up just biting the bullet and using the aws java sdk package (not nearly as good UX wise as the cognitect package unfortunately). It looks like the issue with ARN is not restricted to just invocation but really all uses (for example I tried just retrieving the function using the ARN in Getfunction op and failed for same reason). Which makes sense given the underlying problem.