Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/aliyun/alibaba-cloud-sdk-go
Alibaba Cloud SDK for Go allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.
This document introduces how to obtain and call Alibaba Cloud SDK for Go.
Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through RequestID
or error message
.
Alibaba Cloud OpenAPI Developer Portal provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API.
Use go get
to install SDK:
go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk
Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your Credentials.
package main
import "github.com/aliyun/alibaba-cloud-sdk-go/sdk"
func main() {
client, err := sdk.NewClientWithAccessKey("REGION_ID", "ACCESS_KEY_ID", "ACCESS_KEY_SECRET")
if err != nil {
// Handle exceptions
panic(err)
}
}
package main
import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
func main() {
request := requests.NewCommonRequest() // Make a common request
request.Method = "GET" // Set request method
request.Product = "CS" // Specify product
request.Domain = "cs.aliyuncs.com" // Location Service will not be enabled if the host is specified. For example, service with aCertification type-Bearer Token should be specified
request.Version = "2015-12-15" // Specify product version
request.PathPattern = "/clusters/[ClusterId]" // Specify path rule with ROA-style
request.Scheme = "https" // Set request scheme. Default: http
request.ApiName = "DescribeCluster" // Specify product interface
request.QueryParams["ClusterId"] = "123456" // Assign values to parameters in the path
request.QueryParams["RegionId"] = "region_id" // Specify the requested regionId, if not specified, use the client regionId, then default regionId
request.TransToAcsRequest() // Trans commonrequest to acsRequest, which is used by client.
}
package main
import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
func main() {
request := requests.NewCommonRequest() // Make a common request
request.Method = "POST" // Set request method
request.Product = "Ecs" // Specify product
request.Domain = "ecs.aliyuncs.com" // Location Service will not be enabled if the host is specified. For example, service with a Certification type-Bearer Token should be specified
request.Version = "2014-05-26" // Specify product version
request.Scheme = "https" // Set request scheme. Default: http
request.ApiName = "CreateInstance" // Specify product interface
request.QueryParams["InstanceType"] = "ecs.g5.large" // Assign values to parameters in the path
request.QueryParams["RegionId"] = "region_id" // Specify the requested regionId, if not specified, use the client regionId, then default regionId
request.TransToAcsRequest() // Trans commonrequest to acsRequest, which is used by client.
}
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Please make sure to read the Contributing Guide before making a pull request.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.