turbot/alicloud

GitHub
steampipe plugin install alicloudsteampipe plugin install alicloud
alicloud_accountalicloud_action_trailalicloud_cas_certificatealicloud_cms_monitor_hostalicloud_cs_kubernetes_clusteralicloud_cs_kubernetes_cluster_nodealicloud_ecs_auto_provisioning_groupalicloud_ecs_autoscaling_groupalicloud_ecs_diskalicloud_ecs_disk_metric_read_iopsalicloud_ecs_disk_metric_read_iops_dailyalicloud_ecs_disk_metric_read_iops_hourlyalicloud_ecs_disk_metric_write_iopsalicloud_ecs_disk_metric_write_iops_dailyalicloud_ecs_disk_metric_write_iops_hourlyalicloud_ecs_imagealicloud_ecs_instancealicloud_ecs_instance_metric_cpu_utilization_dailyalicloud_ecs_instance_metric_cpu_utilization_hourlyalicloud_ecs_key_pairalicloud_ecs_launch_templatealicloud_ecs_network_interfacealicloud_ecs_regionalicloud_ecs_security_groupalicloud_ecs_snapshotalicloud_ecs_zonealicloud_kms_keyalicloud_kms_secretalicloud_oss_bucketalicloud_ram_access_keyalicloud_ram_credential_reportalicloud_ram_groupalicloud_ram_password_policyalicloud_ram_policyalicloud_ram_rolealicloud_ram_security_preferencealicloud_ram_useralicloud_rds_backupalicloud_rds_databasealicloud_rds_instancealicloud_rds_instance_metric_connectionsalicloud_rds_instance_metric_connections_dailyalicloud_rds_instance_metric_cpu_utilizationalicloud_rds_instance_metric_cpu_utilization_dailyalicloud_rds_instance_metric_cpu_utilization_hourlyalicloud_security_center_field_statisticsalicloud_security_center_versionalicloud_slb_load_balanceralicloud_vpcalicloud_vpc_dhcp_options_setalicloud_vpc_eipalicloud_vpc_flow_logalicloud_vpc_nat_gatewayalicloud_vpc_network_aclalicloud_vpc_route_entryalicloud_vpc_route_tablealicloud_vpc_ssl_vpn_client_certalicloud_vpc_ssl_vpn_serveralicloud_vpc_vpn_connectionalicloud_vpc_vpn_customer_gatewayalicloud_vpc_vpn_gatewayalicloud_vpc_vswitch

Table: alicloud_oss_bucket

An OSS bucket is the container used to store objects. All objects are contained in buckets. You can configure a variety of bucket properties such as the region, ACL, and storage class. You can create buckets of different storage classes to store data based on your requirements.

Examples

List of buckets where versioning is not enabled

select
name,
arn,
region,
account_id,
versioning
from
alicloud_oss_bucket
where
versioning <> 'Enabled';

List of buckets which do not have default encryption enabled

select
name,
server_side_encryption
from
alicloud_oss_bucket
where
server_side_encryption ->> 'SSEAlgorithm' = '';

List of buckets where public access to bucket is not blocked

select
name,
acl
from
alicloud_oss_bucket
where
acl <> 'private';

List of buckets where server access logging destination is same as the source bucket

select
name,
logging ->> 'TargetBucket' as target_bucket
from
alicloud_oss_bucket
where
logging ->> 'TargetBucket' = name;

List of buckets without owner tag key

select
name,
tags
from
alicloud_oss_bucket
where
tags ->> 'owner' is null;

List of Bucket policy statements that grant external access

select
title,
p as principal,
a as action,
s ->> 'Effect' as effect,
s -> 'Condition' as conditions
from
alicloud_oss_bucket,
jsonb_array_elements(policy -> 'Statement') as s,
jsonb_array_elements_text(s -> 'Principal') as p,
jsonb_array_elements_text(s -> 'Action') as a
where
s ->> 'Effect' = 'Allow'
and (
p != account_id
or p = '*'
);

List of buckets with no lifecycle policy

select
name,
arn,
region,
account_id,
lifecycle_rules
from
alicloud_oss_bucket
where
lifecycle_rules is null;

Query examples

Control examples

.inspect alicloud_oss_bucket

Object Storage Bucket

NameTypeDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe Alicloud Account ID in which the resource is located.
acltextThe access control list setting for bucket. Valid values: public-read-write, public-read, and private. public-read-write: Any users, including anonymous users can read and write objects in the bucket. Exercise caution when you set the ACL of a bucket to public-read-write. public-read: Only the owner or authorized users of this bucket can write objects in the bucket. Other users, including anonymous users can only read objects in the bucket. Exercise caution when you set the ACL of a bucket to public-read. private: Only the owner or authorized users of this bucket can read and write objects in the bucket. Other users, including anonymous users cannot access the objects in the bucket without authorization.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Alibaba Cloud Resource Name (ARN) of the OSS bucket.
creation_datetimestamp with time zoneDate when the bucket was created.
lifecycle_rulesjsonbA list of lifecycle rules for a bucket.
locationtextLocation of the Bucket.
loggingjsonbIndicates the container used to store access logging configuration of a bucket.
nametextName of the Bucket.
policyjsonbAllows you to grant permissions on OSS resources to RAM users from your Alibaba Cloud and other Alibaba Cloud accounts. You can also control access based on the request source.
redundancy_typetextThe type of disaster recovery for a bucket. Valid values: LRS and ZRS
regiontextThe Alicloud region in which the resource is located.
server_side_encryptionjsonbThe server-side encryption configuration for bucket
storage_classtextThe storage class of objects in the bucket.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags assigned to bucket
titletextTitle of the resource.
versioningtextThe status of versioning for the bucket. Valid values: Enabled and Suspended.