---

inputType: "CA10__CaGoogleSqlInstance__c"
testData:
  - file: test-data.json
importExtracts:
  - file: /types/CA10__CaGoogleSqlInstance__c/object.extracts.yaml
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "Authorized networks apply only to instances with public IPs"
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__ipv4Enabled__c"
        right:
          BOOLEAN: true
  - status: "INCOMPLIANT"
    currentStateMessage: "Cloud SQL Database Instance do not implicitly Whitelist all public IP addresses."
    remediationMessage: "Update the authorized network list."
    check:
          CONTAINS:
            arg:
              EXTRACT: "caJsonFrom_authorizedNetworksJson_value__c"
            substring:
              TEXT: "0.0.0.0/0"
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "Cloud SQL database instances are not open to the world."