func CloudSQLRequireSSL(ctx context.Context, m pubsub.Message) error {
	var values requiressl.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return requiressl.Execute(ctx, &values, &requiressl.Services{
			CloudSQL: svcs.CloudSQL,
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}
CloudSQLRequireSSL enables the SSL requirement for a Cloud SQL instance.

This Cloud Function will respond to Security Health Analytics **Public SQL Instance** findings
from **SQL Scanner**. All public IP addresses of the affected instance will be
deleted when this function is activated.

Permissions required
- roles/cloudsql.editor to get instance data and delete access config.
package exec
import (
	"context"
	"encoding/json"
	"log"
	"os"
	"cloud.google.com/go/pubsub"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/bigquery/closepublicdataset"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/cloud-sql/removepublic"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/cloud-sql/requiressl"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/cloud-sql/updatepassword"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/filter"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/gce/createsnapshot"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/gce/openfirewall"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/gce/removepublicip"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/gcs/closebucket"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/gcs/enablebucketonlypolicy"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/gke/disabledashboard"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/iam/enableauditlogs"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/iam/removenonorgmembers"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/iam/revoke"
	"github.com/googlecloudplatform/security-response-automation/cloudfunctions/router"
	"github.com/googlecloudplatform/security-response-automation/services"
)
var (
	svcs      *services.Global
	projectID = os.Getenv("GCP_PROJECT")
)
func init() {
	log.SetFlags(log.LstdFlags | log.Llongfile)
	ctx := context.Background()
	var err error
	if projectID == "" {
		log.Fatalf("GCP_PROJECT environment variable not set")
	}
	svcs, err = services.New(ctx)
	if err != nil {
		log.Fatalf("failed to initialize services: %q", err)
	}
}
func Filter(ctx context.Context, m pubsub.Message) error {
	ps, err := services.InitPubSub(ctx, projectID)
	if err != nil {
		return err
	}
	return filter.Execute(ctx, m, &filter.Services{
		PubSub:                ps,
		Logger:                svcs.Logger,
		SecurityCommandCenter: svcs.SecurityCommandCenter,
	})
}
func Router(ctx context.Context, m pubsub.Message) error {
	ps, err := services.InitPubSub(ctx, projectID)
	if err != nil {
		return err
	}
	conf, err := router.Config()
	if err != nil {
		return err
	}
	return router.Execute(ctx, &router.Values{
		Finding: m.Data,
	}, &router.Services{
		PubSub:                ps,
		Configuration:         conf,
		Logger:                svcs.Logger,
		Resource:              svcs.Resource,
		SecurityCommandCenter: svcs.SecurityCommandCenter,
	})
}
func IAMRevoke(ctx context.Context, m pubsub.Message) error {
	var values revoke.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return revoke.Execute(ctx, &values, &revoke.Services{
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}
func SnapshotDisk(ctx context.Context, m pubsub.Message) error {
	var values createsnapshot.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		output, err := createsnapshot.Execute(ctx, &values, &createsnapshot.Services{
			Host:   svcs.Host,
			Logger: svcs.Logger,
		})
		if err != nil {
			return err
		}
		for _, dest := range values.Output {
			switch dest {
			case "turbinia":
				log.Println("turbinia output is enabled, sending each copied disk to turbinia")
				turbiniaProjectID := values.Turbinia.ProjectID
				turbiniaTopicName := values.Turbinia.Topic
				turbiniaZone := values.Turbinia.Zone
				diskNames := output.DiskNames
				if err := services.SendTurbinia(ctx, turbiniaProjectID, turbiniaTopicName, turbiniaZone, diskNames); err != nil {
					return err
				}
				svcs.Logger.Info("sent %d disks to turbinia", len(diskNames))
			}
		}
		return nil
	default:
		return err
	}
}
func CloseBucket(ctx context.Context, m pubsub.Message) error {
	var values closebucket.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return closebucket.Execute(ctx, &values, &closebucket.Services{
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}
func OpenFirewall(ctx context.Context, m pubsub.Message) error {
	var values openfirewall.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		err := openfirewall.Execute(ctx, &values, &openfirewall.Services{
			Firewall: svcs.Firewall,
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
		if err != nil {
			return err
		}
		return nil
	default:
		return err
	}
}
func RemoveNonOrganizationMembers(ctx context.Context, m pubsub.Message) error {
	var values removenonorgmembers.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return removenonorgmembers.Execute(ctx, &values, &removenonorgmembers.Services{
			Logger:   svcs.Logger,
			Resource: svcs.Resource,
		})
	default:
		return err
	}
}
func RemovePublicIP(ctx context.Context, m pubsub.Message) error {
	var values removepublicip.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return removepublicip.Execute(ctx, &values, &removepublicip.Services{
			Host:     svcs.Host,
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}
func ClosePublicDataset(ctx context.Context, m pubsub.Message) error {
	var values closepublicdataset.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		bigquery, err := services.InitBigQuery(ctx, values.ProjectID)
		if err != nil {
			return err
		}
		return closepublicdataset.Execute(ctx, &values, &closepublicdataset.Services{
			BigQuery: bigquery,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}
func EnableBucketOnlyPolicy(ctx context.Context, m pubsub.Message) error {
	var values enablebucketonlypolicy.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return enablebucketonlypolicy.Execute(ctx, &values, &enablebucketonlypolicy.Services{
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}
func CloseCloudSQL(ctx context.Context, m pubsub.Message) error {
	var values removepublic.Values
	switch err := json.Unmarshal(m.Data, &values); err {
	case nil:
		return removepublic.Execute(ctx, &values, &removepublic.Services{
			CloudSQL: svcs.CloudSQL,
			Resource: svcs.Resource,
			Logger:   svcs.Logger,
		})
	default:
		return err
	}
}