code: def public_ami(rec):
      """
      author:       airbnb_csirt
      description:  Identifies creation of an AMI with a non encrypted volume
      reference:    https://amzn.to/2rQilUn
      playbook:     (a) Reach out to the user who created the volume
                    (b) Set the AMI to private
      """
      if rec["detail"]["eventName"] != "ModifyImageAttribute":
          # check the event type early to avoid unnecessary performance impact
          return False
  
      if rec["detail"]["requestParameters"] is None:
          # requestParameters can be defined with a value of null
          return False
  
      req_params = rec["detail"]["requestParameters"]
      permission_items = (
          req_params.get("launchPermission", {})
          .get("add", {})
          .get("items", [])
      )
      for item in permission_items:
          if item["group"] == "all":
              return True
  
      return False
  
label_desc: Use image node_id 2 for calling a global function with example usage: public_ami(rec) and returns: False, False, False, True