Documentation
¶
Overview ¶
Package exec is the entry point for security automation Cloud Functions.
Index ¶
- func CloseBucket(ctx context.Context, m pubsub.Message) error
- func CloseCloudSQL(ctx context.Context, m pubsub.Message) error
- func ClosePublicDataset(ctx context.Context, m pubsub.Message) error
- func CloudSQLRequireSSL(ctx context.Context, m pubsub.Message) error
- func DisableDashboard(ctx context.Context, m pubsub.Message) error
- func EnableAuditLogs(ctx context.Context, m pubsub.Message) error
- func EnableBucketOnlyPolicy(ctx context.Context, m pubsub.Message) error
- func IAMRevoke(ctx context.Context, m pubsub.Message) error
- func OpenFirewall(ctx context.Context, m pubsub.Message) error
- func RemoveNonOrganizationMembers(ctx context.Context, m pubsub.Message) error
- func RemovePublicIP(ctx context.Context, m pubsub.Message) error
- func Router(ctx context.Context, m pubsub.Message) error
- func SnapshotDisk(ctx context.Context, m pubsub.Message) error
- func UpdatePassword(ctx context.Context, m pubsub.Message) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseBucket ¶
CloseBucket will remove any public users from buckets found within the provided folders.
Permissions required
- roles/viewer to retrieve ancestry.
- roles/storeage.admin to modify buckets.
func CloseCloudSQL ¶
CloseCloudSQL removes public IP 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.
func ClosePublicDataset ¶
ClosePublicDataset removes public access of a BigQuery dataset.
This Cloud Function will respond to Security Health Analytics **Public Dataset** findings from **Dataset Scanner**. All public access of the affected dataset will be removed when this function is activated.
Permissions required
- roles/bigquery.dataOwner to get and update dataset metadata.
func CloudSQLRequireSSL ¶
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.
func DisableDashboard ¶
DisableDashboard will disable the Kubernetes dashboard addon.
This Cloud Function will respond to Security Health Analytics **Web UI Enabled** findings from **Container Scanner**. The Kubernetes dashboard addon will be disabled when this function is activated.
Permissions required
- roles/container.clusterAdmin update cluster addon.
func EnableAuditLogs ¶
EnableAuditLogs enables the Audit Logs to specific project
This Cloud Function will respond to Security Health Analytics **AUDIT_LOGGING_DISABLED** findings from **LOGGING_SCANNER**.
Permissions required
- roles/resourcemanager.folderAdmin to get/update resource policy from projects in folder.
- roles/editor to get/update resource policy to specific project.
func EnableBucketOnlyPolicy ¶
EnableBucketOnlyPolicy Enable bucket only policy on a GCS bucket.
This Cloud Function will respond to Security Health Analytics **BUCKET_POLICY_ONLY_DISABLED** findings from **STORAGE_SCANNER**. Bucket only IAM policy will be enforced on the bucket.
Permissions required
- roles/storage.admin to change the Bucket policy mode.
func IAMRevoke ¶
IAMRevoke is the entry point for the IAM revoker Cloud Function.
This function will attempt to revoke the external members added to the policy if they match the provided list of disallowed domains. Additionally this method will only remove members if the project they were added to is within the specified folders. This configuration allows you to take a remediation action only on specific members and folders. For example, you may have a folder "development" where users can experiment without strict policies. However in your "production" folder you may want to revoke any grants that ETD finds as long as they match the domains you specify.
Permissions required
- roles/resourcemanager.folderAdmin to revoke IAM grants.
- roles/viewer to verify the affected project is within the enforced folder.
func OpenFirewall ¶
OpenFirewall will remediate an open firewall.
Permissions required
- roles/viewer to retrieve ancestry.
- roles/compute.securityAdmin to modify firewall rules.
func RemoveNonOrganizationMembers ¶
RemoveNonOrganizationMembers removes all members that do not match the organization domain.
This Cloud Function will respond to Security Health Analytics **NON_ORG_IAM_MEMBER** findings from **IAM Scanner**. All user member types (user:) that do not correspond to the organization will be removed from policy binding.
Permissions required
- roles/resourcemanager.organizationAdmin to get org info and policies and set policies.
func RemovePublicIP ¶
RemovePublicIP removes all the external IP addresses of a GCE instance.
This Cloud Function will respond to Security Health Analytics **Public IP Address** findings from **Compute Instance Scanner**. All public IP addresses of the affected instance will be deleted when this function is activated.
Permissions required
- roles/compute.instanceAdmin.v1 to get instance data and delete access config.
func Router ¶ added in v0.0.2
Router is the entry point for the router Cloud Function.
This Cloud Function will receive all findings and route them to configured automation.
func SnapshotDisk ¶
SnapshotDisk is the entry point for the auto creation of GCE snapshots Cloud Function.
Once a supported finding is received this Cloud Function will look for any existing disk snapshots for the affected instance. If there are recent snapshots then no action is taken. This is so we do not overwrite a recent snapshot. If we have not taken a snapshot recently, take a new snapshot for each disk within the instance.
Permissions required
- roles/compute.instanceAdmin.v1 to manage disk snapshots.
func UpdatePassword ¶
UpdatePassword updates the root password for a Cloud SQL instance.
This Cloud Function will respond to Security Health Analytics **SQL No Root Password** findings from **SQL Scanner**. The root user of the affected instance will be updated with a new password when this function is activated.
Permissions required
- roles/cloudsql.admin to update a user password.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package clients holds client libraries used by security automation Cloud Functions.
|
Package clients holds client libraries used by security automation Cloud Functions. |
cscc/apiv1p1alpha1
Package securitycenter is an auto-generated package for the Cloud Security Command Center API.
|
Package securitycenter is an auto-generated package for the Cloud Security Command Center API. |
stubs
Package stubs provides testable stubs for clients.
|
Package stubs provides testable stubs for clients. |
cloudfunctions
|
|
iam/revoke
Package revoke provides the implementation of automated actions.
|
Package revoke provides the implementation of automated actions. |
compiled
|
|
sha
Package protos is a generated protocol buffer package.
|
Package protos is a generated protocol buffer package. |
sha/protos
Package sha is a generated protocol buffer package.
|
Package sha is a generated protocol buffer package. |
local
|
|
cli
This package will create a CSCC notification config that sends all active findings to the specified Pub/Sub topic.
|
This package will create a CSCC notification config that sends all active findings to the specified Pub/Sub topic. |
debug
Package main runs a Cloud Function locally.
|
Package main runs a Cloud Function locally. |
providers
|
|
etd/anomalousiam
Package anomalousiam represents the anomalous IAM grant finding.
|
Package anomalousiam represents the anomalous IAM grant finding. |
etd/badip
Package badip represents the bad IP finding.
|
Package badip represents the bad IP finding. |
sha
Package sha holds Security Health Analytics finding entities and functions
|
Package sha holds Security Health Analytics finding entities and functions |
Package services holds commonly used methods used in security automation.
|
Package services holds commonly used methods used in security automation. |