云监控站点监控状态码说明
站点监控的每种协议在进行探测时,都会返回状态码,以下为常见状态码说明。
云监控自定义状态码含义
状态码含义备注610HTTP连接超时监测点探测您的网站时出现连接超时现象,云监控发出Http请求后5秒内没有回包,会返回610状态码。建议您设置报警规则时增加重试次数、采用组合报警等,以便优化以及提高报警准确率。611HTTP探测无法访问您的站点请检测您的服务端是否限制了云监控的探测请求,如有开启防火墙,请添加最新的云监控IP地址。613DNS无法解析查询域名解析失败,建议联系您的域名解析服务商协助检查域名解析是否不稳定。615是否包含响应内容您在新建HTTP类型的站点监测时,如果使用了GET或POST请求方式,并在高级设置中选择“包含响应内容则报警”或“不包含匹配内容则报警”时,会根据您的选择返回615状态码。631TCP 连接失败对探测点建立连接失败。635TCP 响应内容不匹配TCP的实际响应内容与设置的响应内容不匹配。641UDP 连接失败对探测点建立连接失败。645UDP响应内容不匹配UDP的实际响应内容与设置的响应内容不匹配。650DNS探测连接超时DNS探测站点超过5秒没响应。651DNS探测失败DNS探测无法连接您的站点。652DNS探测结果与预期不匹配DNS探测实际解析出的IP与期望IP不匹配。681FTP探测失败FTP探测无法连接您的站点。
HTTP协议常用标准状态码含义
状态码含义备注200请求已完成2XX状态码均为正常状态码返回。3XX3XX状态码为重定向状态码。300多种选择服务器根据请求可执行多种操作。服务器可根据请求者 (User agent) 来选择一项操作,或提供操作列表供请求者选择。301永久移动请求的网页已被永久移动到新位置。服务器返回此响应(作为对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置。您应使用此代码通知 Googlebot 某个网页或网站已被永久移动到新位置。302临时移动服务器目前正从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。此代码与响应 GET 和 HEAD 请求的 301 代码类似,会自动将请求者转到不同的位置。303查看其他位置当请求者应对不同的位置进行单独的 GET 请求以检索响应时,服务器会返回此代码。对于除 HEAD 请求之外的所有请求,服务器会自动转到其他位置。304未修改自从上次请求后,请求的网页未被修改过。服务器返回此响应时,不会返回网页内容。305使用代理请求者只能使用代理访问请求的网页。如果服务器返回此响应,那么,服务器还会指明请求者应当使用的代理。307临时重定向服务器目前正从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。此代码与响应 GET 和 HEAD 请求的 301 代码类似,会自动将请求者转到不同的位置。4XX客户端类错误。400错误请求服务器不理解请求的语法。401未授权请求要求进行身份验证。登录后,服务器可能会返回对页面的此响应。403已禁止服务器拒绝请求。404未找到服务器找不到请求的网页。例如,如果请求是针对服务器上不存在的网页进行的,那么,服务器通常会返回此代码。405方法禁用禁用请求中所指定的方法。406不接受无法使用请求的内容特性来响应请求的网页。407需要代理授权此状态代码与401(未授权)类似,但却指定了请求者应当使用代理进行授权。如果服务器返回此响应,那么,服务器还会指明请求者应当使用的代理。408请求超时服务器等候请求时超时。409冲突服务器在完成请求时发生冲突。服务器必须包含有关响应中所发生的冲突的信息。服务器在响应与前一个请求相冲突的PUT请求时可能会返回此代码,同时会提供两个请求的差异列表。410已删除如果请求的资源已被永久删除,那么,服务器会返回此响应。该代码与404(未找到)代码类似,但在资源以前有但现在已经不复存在的情况下,有时会替代。411需要有效长度服务器不会接受包含无效内容长度标头字段的请求。412未满足前提条件服务器未满足请求者在请求中设置的其中一个前提条件。413请求实体过大服务器无法处理请求,因为请求实体过大,已超出服务器的处理能力。414请求的URI过长请求的URI(通常为网址)过长,服务器无法进行处理。415不支持的媒体类型请求的格式不受请求页面的支持。416请求范围不符合要求如果请求是针对网页的无效范围进行的,那么,服务器会返回此状态代码。417未满足期望值服务器未满足[backcolor=transparent]期望请求标头字段的要求。499客户端断开连接服务端处理时间过长,导致客户端关闭了连接造成的。5XX服务器端发生错误。500服务器内部错误服务器遇到错误,无法完成请求。[tr=rgb(239, 251, 255)][td]501
尚未实施服务器不具备完成请求的功能。例如,当服务器无法识别请求方法时,服务器可能会返回此代码。
502错误网关服务器作为网关或代理,从上游服务器收到了无效的响应。
503服务不可用目前无法使用服务器(由于超载或进行停机维护)。通常,这只是一种暂时的状态。
504网关超时服务器作为网关或代理,未及时从上游服务器接收请求。
505HTTP版本不受支持服务器不支持请求中所使用的HTTP协议版本。
问答
域名解析 · 监控 · 网络协议 · 网络安全
2017-10-31
消息服务的日志导出工具是什么?
提供日志导出功能,将保存在OSS的日志导出到阿里云日志服务进行查询、分析。
环境依赖
此工具适用于Python 2.6/2.7 版本,Windows平台和Linux平台均可使用。
使用帮助
1. 准备
如果你已经充分了解阿里云日志服务,并且已创建Project、LogStore以及相关索引,请跳过此步骤。
1.1 开通日志服务
登陆阿里云官网,进入日志服务产品页;单击 [backcolor=transparent]立即开通 开通日志服务;
1.2 创建Project
进入日志服务控制台单击 [backcolor=transparent]创建Project 进行创建;
1.3 创建LogStore
单击Project右侧的 [backcolor=transparent]管理 进入管理页面;单击 [backcolor=transparent]创建 进入LogStore创建页面;单击 [backcolor=transparent]取消 关闭提示窗口,因为后面会使用工具导入日志,无需配置logtail;
1.4 创建索引
直接创建默认的索引即可支持大部分查询,如果需要进行更复杂的查询,请参考
文档设置其它索引。
2. 使用工具导出日志
此工具无需安装,下载工具包后,解压进入mnslog_export目录。
命令
[backcolor=transparent]python2[backcolor=transparent].[backcolor=transparent]7[backcolor=transparent] mnslog_export[backcolor=transparent].[backcolor=transparent]py [backcolor=transparent]--[backcolor=transparent]access_id[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]access_key[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]oss_host[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]log_bucket[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]sls_project[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]sls_logstore[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]sls_host[backcolor=transparent]=[backcolor=transparent]xxx [backcolor=transparent]--[backcolor=transparent]queue_name[backcolor=transparent]=[backcolor=transparent]xxx
参数解析
参数名解析access_id阿里云服务使用 AccessKeyID,登陆AccessKey管理页面查看access_key阿里云服务使用 AccessKeySecret,登陆AccessKey管理页面查看oss_hostOSS 接入地址,请在控制台 bucket 概览中获得这个参数, 比如杭州地区的地址是:oss-cn-hangzhou.aliyuncs.comlog_bucket保存MNS日志的 bucket 名称,请在MNS控制台的日志管理页面查看start_time导日志的起始时间,比如 201503270102, 表示从2015年3月27号1点02分的日志开始end_time导日志的截至时间,不包含该时间,比如201603270302, 表示到2016年3月27号3点02分截止sls_hostsls的接入地址,请从日志服务官网获取,比如杭州地区的地址是: cn-hangzhou.sls.aliyun.comsls_project指定日志导入的 sls project 名称,即第 1.2 步中创建的 Project 名称sls_logstore指定日志导入 的sls logsotre 名称,即第 1.3 步中创建的logstore名称queue_name指定需要导入日志的队列名称,queue_name 和 topic_name 只能选择一个topic_name指定需要导入日志的主题名称,queue_name 和 topic_name 只能选择一个
示例
注意事项
[backcolor=transparent]日志服务只支持导入 7天内的日志,如果start_time太早,工具写日志服务提示失败。
[backcolor=transparent]运行完mnslog_export.py成功上传了日志到sls之后,强烈建议等待60s之后再进入sls控制台进行查询检索,否则可能会出现新上传的数据无法检索显示!
3. 查询日志
将日志从 OSS 导入日志服务1分钟后,即可在日志服务的控制台进行查询。
单击 LogStore 右侧的的 [backcolor=transparent]查询 进入日志查询页面;选择合适的时间范围,单击 [backcolor=transparent]搜索 将展示时间范围内所有日志;单击某个MessageId,即可搜索包含该MessageId的所有日志;
下载
[backcolor=transparent]准备
此工具需安装protobuf和simplejson,详情参考链接;windows环境安装详细指导
第一阶段:安装python以及pip工具
进入python官网下载(https://www.python.org/downloads/) 2.7版本python安装包,下载完之后进行安装(例如安装到”D:\Python27”目录)。鼠标右键我的电脑 -> 属性 -> 点击高级系统设置 -> 点击环境变量 -> 点击PATH -> 在最后面加上我们的Python安装路径 -> 点击确定。进入pip官网(https://pypi.python.org/pypi/pip#downloads) 下载pip-8.1.2.tar.gz文件,下载完毕之后解压缩。进入windows命令行cmd(windows7及以上版本可以使用更加人性化的Windows PowerShell ISE)界面,进入到pip的解压所目录,运行[backcolor=transparent]python setup[backcolor=transparent].[backcolor=transparent]py install鼠标右键我的电脑 -> 属性 -> 点击高级系统设置 -> 点击环境变量 -> 点击PATH -> 在最后面加上我们的Python的Scripts目录(本例中为”D:\Python27\Scripts”) -> 点击确定。
第二阶段:使用pip安装必须protobuf和simplejson组件;
安装protobuf[backcolor=transparent]pip install protobuf
安装requests
[backcolor=transparent]pip install requests
安装simplejson
[backcolor=transparent]pip install simplejson
如果上述命令报超时,连接不上等错误,请进行如下尝试:
a. 进入当前用户的HOME路径 (C:\Users\$username)创建.pip文件夹以及pip.conf文件
b. 打开pip.conf文件输入如下内容:
[backcolor=transparent][[backcolor=transparent]global[backcolor=transparent]][backcolor=transparent]index[backcolor=transparent]-[backcolor=transparent]url [backcolor=transparent]=[backcolor=transparent] http[backcolor=transparent]:[backcolor=transparent]//pypi.v2ex.com/simple
c. 配置完上述之后,重新运行第二阶段中的安装步骤,建议在命令后带上—default-timeout 100选项。
[backcolor=transparent]Version 1.0.0
更新日期: 2016-04-20 下载功能更新支持将队列/主题的操作日志从OSS导出到阿里云日志服务进行分析查询;
特别注意
[backcolor=transparent]运行完mnslog_export.py成功上传了日志到sls之后,强烈建议等待60s之后再进入sls控制台进行查询检索,否则可能会出现新上传的数据无法检索显示!
问答
消息中间件 · 监控 · Linux · 开发工具 · 对象存储 · 索引 · Python · Windows
2017-10-24
PCI远程扫描漏洞补丁如何解决
您好:求助一下,一下问题如何解决
2018-08-07
 
Scan ID
8238876
Max CVSS
10.0
Scan State
Completed
Scan Compliance Status
Failing
Scan Start
2018-08-06 05:07:59
Duration
0:28:48
Scan Finish
2018-08-06 05:36:47
Expiration Date
2018-11-07
 
View Open Ports
10.0
FAIL
3389TCPmsrdpMS14-066: Vulnerability in Schannel Could Allow Remote Code Execution (2992611) (uncredentialed check)less...
Title
MS14-066: Vulnerability in Schannel Could Allow Remote Code Execution (2992611) (uncredentialed check)
Synopsis
The remote Windows host is affected by a remote code execution vulnerability.
Impact
The remote Windows host is affected by a remote code execution vulnerability due to improper processing of packets by the Secure Channel (Schannel) security package. An attacker can exploit this issue by sending specially crafted packets to a Windows server. Note that this plugin sends a client Certificate TLS handshake message followed by a CertificateVerify message. Some Windows hosts will close the connection upon receiving a client certificate for which it did not ask for with a CertificateRequest message. In this case, the plugin cannot proceed to detect the vulnerability as the CertificateVerify message cannot be sent. See also : https://technet.microsoft.com/library/security/ms14-066
Resolution
Microsoft has released a set of patches for Windows 2003, Vista, 2008, 7, 2008 R2, 8, 2012, 8.1, and 2012 R2.
Data Received
CVEs
CVEScoreVector
CVE-2014-632110.0(AV:N/AC:L/Au:N/C:C/I:C/A:C)
10.0
FAIL
80TCPpossible_wlsPHP Unsupported Version Detectionless...
Title
PHP Unsupported Version Detection
Synopsis
The remote host contains an unsupported version of a web application scripting language.
Impact
According to its version, the installation of PHP on the remote host is no longer supported. Lack of support implies that no new security patches for the product will be released by the vendor. As a result, it is likely to contain security vulnerabilities. See also : http://php.net/eol.php https://wiki.php.net/rfc/releaseprocess
Resolution
Upgrade to a version of PHP that is currently supported.
Data Received
Source : Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.4.45 Installed version : 5.4.45 End of support date : 2015/09/14 Announcement : http://php.net/supported-versions.php Supported versions : 7.1.x / 7.0.x / 5.6.x
6.4
FAIL
3389TCPmsrdpSSL Self-Signed Certificateless...
Title
SSL Self-Signed Certificate
Synopsis
The SSL certificate chain for this service ends in an unrecognized self-signed certificate.
Impact
The X.509 certificate chain for this service is not signed by a recognized certificate authority. If the remote host is a public host in production, this nullifies the use of SSL as anyone could establish a man-in-the-middle attack against the remote host. Note that this plugin does not check for certificate chains that end in a certificate that is not self-signed, but is signed by an unrecognized certificate authority.
Resolution
Purchase or generate a proper certificate for this service.
Data Received
The following certificate was found at the top of the certificate chain sent by the remote host, but is self-signed and was not found in the list of known certificate authorities : |-Subject : CN=iZ0fhyb9yyb8szZ
6.4
FAIL
3389TCPmsrdpMicrosoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weaknessless...
Title
Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness
Synopsis
It may be possible to get access to the remote host.
Impact
The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials. This flaw exists because the RDP server stores a hard-coded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack. See also : http://www.oxid.it/downloads/rdp-gbu.pdf http://www.nessus.org/u?8033da0d http://technet.microsoft.com/en-us/library/cc782610.aspx
Resolution
- Force the use of SSL as a transport layer for this service if supported, or/and - Select the 'Allow connections only from computers running Remote Desktop with Network Level Authentication' setting if it is available.
最新扫描详细信息下一个扫描2018-08-07 扫描 ID 8238876 最大 CVSS 10.0 扫描状态完成扫描符合性状态失败扫描开始 2018-08-06 05:07:59 持续时间0:28:48 扫描完成 2018-08-06 05:36:47 到期日期2018-11-07 查看打开端口10.0 失败
3389TCPmsrdpMS14-066: Schannel 中的漏洞可能允许远程代码执行 (2992611) (uncredentialed 检查) 减少..。
标题 MS14-066: Schannel 中的漏洞可能允许远程代码执行 (2992611) (uncredentialed 检查) 简介远程 Windows 主机受远程代码执行漏洞的影响。
由于安全通道 (Schannel) 安全包不正确处理数据包, 远程 Windows 主机受到远程代码执行漏洞的影响。攻击者可以通过向 Windows 服务器发送特制的数据包来利用此问题。请注意, 此插件发送客户端证书 TLS 握手消息, 后跟 CertificateVerify 消息。某些 Windows 主机在接收到其不要求使用 CertificateRequest 消息的客户端证书时将关闭连接。在这种情况下, 由于无法发送 CertificateVerify 消息, 插件无法继续检测该漏洞。另请参见: https://technet.microsoft.com/library/security/ms14-066 解决方案 microsoft 已发布了一组用于 Windows 2003、Vista、2008、7、2008 R2、8、2012、8.1 和 2012 R2 的补丁程序。
收到的数据 CVEs CVEScoreVector CVE 2014-632110.0 (AV: AC: i/o: c/s: c/c++: c) 10.0 失败80TCPpossible_wlsPHP 不支持的版本 Detectionless..。
标题 PHP 不支持的版本检测简介远程主机包含不受支持的 web 应用程序脚本语言版本。
根据其版本的影响, 不再支持在远程主机上安装 PHP。缺少支持意味着供应商不会发布该产品的新安全修补程序。因此, 它很可能包含安全漏洞。另请参见: http://php.net/eol.php https://wiki.php.net/rfc/releaseprocess 分辨率升级到当前支持的 php 版本。
收到的数据来源: 服务器: Apache/2.4. 23 (Win32) OpenSSL/1.0. 2 j PHP/5.4. 45 安装版本: 5.4.45 支持结束日期: 2015/09/14 公告: http://php.net/supported-versions.php 支持版本: 7.1.x/7.0.x/5.6.x 6.4 失败
3389TCPmsrdpSSL 自签名公钥..。
标题 ssl 自签名证书简介此服务的 SSL 证书链以无法识别的自签名证书结尾。
对此服务的 x 509 证书链的影响未被认可的证书颁发机构签名。如果远程主机是生产中的公用主机, 这就会使 SSL 的使用无效, 因为任何人都可以建立针对远程主机的人为中间攻击。请注意, 此插件不检查结束于未自签名的证书中的证书链, 而是由无法识别的证书颁发机构签名。
解决方案购买或生成此服务的适当证书。
收到的数据在远程主机发送的证书链的顶部找到了以下证书, 但它是自签名的, 在已知的证书颁发机构列表中找不到: |-主题: CN=iZ0fhyb9yyb8szZ 6.4 失败3389TCPmsrdpMicrosoft 窗口远程桌面协议服务器中间的 Weaknessless..。
标题 Microsoft Windows 远程桌面协议服务器中级弱势简介可能会访问远程主机。
影响远程桌面协议服务器 (终端服务) 的远程版本容易受到中端 (MiTM) 攻击。RDP 客户端在设置加密时不努力验证服务器的身份。具有拦截 RDP 服务器通信量的攻击者可以在不被检测的情况下与客户端和服务器建立加密。这种性质的 MiTM 攻击将允许攻击者获得传输的任何敏感信息, 包括身份验证凭据。存在此缺陷的原因是 RDP 服务器在 mstlsapi.dll 库中存储硬编码的 RSA 私钥。任何访问此文件 (在任何 Windows 系统上) 的本地用户都可以检索该密钥并将其用于此攻击。另请参见: http://www.oxid.it/downloads/rdp-gbu.pdf http://www.nessus.org/u?8033da0d http://technet.microsoft.com/en-us/library/cc782610.aspx 解决方案-强制使用 SSL 作为此服务的传输层 (如果支持), 或/和-选择 "仅允许在运行远程桌面的计算机上使用网络级身份验证 "设置 (如果可用) 进行连接。
 
 
4.0
FAIL
80TCPpossible_wlsWeb Server Transmits Cleartext Credentialsless...
Title
Web Server Transmits Cleartext Credentials
Synopsis
The remote web server might transmit credentials in cleartext.
Impact
The remote web server contains several HTML form fields containing an input of type 'password' which transmit their information to a remote web server in cleartext. An attacker eavesdropping the traffic between web browser and server may obtain logins and passwords of valid users.
Resolution
Make sure that every sensitive form transmits content over HTTPS.
Data Received
Page : / Destination Page: /l.php#bottom Page : /l.php Destination Page: /l.php#bottom Page : /phpmyadmin/ Destination Page: /phpmyadmin/index.php Page : /phpMyAdmin/ Destination Page: /phpMyAdmin/index.php Page : /phpmyadmin/url.php Destination Page: /phpmyadmin/index.php Page : /phpmyadmin/index.php Destination Page: /phpmyadmin/index.php Page : /phpMyAdmin/url.php Destination Page: /phpMyAdmin/index.php Page : /phpMyAdmin/index.php Destination Page: /phpMyAdmin/index.php
 
 
FTP Supports Cleartext Authenticationless...
Title
FTP Supports Cleartext Authentication
Synopsis
Authentication credentials might be intercepted.
Impact
The remote FTP server allows the user's name and password to be transmitted in cleartext, which could be intercepted by a network sniffer or a man-in-the-middle attack.
Resolution
Switch to SFTP (part of the SSH suite) or FTPS (FTP over SSL/TLS). In the latter case, configure the server so that control connections are encrypted.
Data Received
This FTP server does not support 'AUTH TLS'.
 
 
 
View Open Ports
10.0
FAIL
3389TCPmsrdpMS14-066: Vulnerability in Schannel Could Allow Remote Code Execution (2992611) (uncredentialed check)less...
Title
MS14-066: Vulnerability in Schannel Could Allow Remote Code Execution (2992611) (uncredentialed check)
Synopsis
The remote Windows host is affected by a remote code execution vulnerability.
Impact
The remote Windows host is affected by a remote code execution vulnerability due to improper processing of packets by the Secure Channel (Schannel) security package. An attacker can exploit this issue by sending specially crafted packets to a Windows server. Note that this plugin sends a client Certificate TLS handshake message followed by a CertificateVerify message. Some Windows hosts will close the connection upon receiving a client certificate for which it did not ask for with a CertificateRequest message. In this case, the plugin cannot proceed to detect the vulnerability as the CertificateVerify message cannot be sent. See also : https://technet.microsoft.com/library/security/ms14-066
Resolution
Microsoft has released a set of patches for Windows 2003, Vista, 2008, 7, 2008 R2, 8, 2012, 8.1, and 2012 R2.
Data Received
CVEs
CVEScoreVector
CVE-2014-632110.0(AV:N/AC:L/Au:N/C:C/I:C/A:C)
10.0
FAIL
80TCPpossible_wlsPHP Unsupported Version Detectionless...
Title
PHP Unsupported Version Detection
Synopsis
The remote host contains an unsupported version of a web application scripting language.
Impact
According to its version, the installation of PHP on the remote host is no longer supported. Lack of support implies that no new security patches for the product will be released by the vendor. As a result, it is likely to contain security vulnerabilities. See also : http://php.net/eol.php https://wiki.php.net/rfc/releaseprocess
Resolution
Upgrade to a version of PHP that is currently supported.
Data Received
Source : Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.4.45 Installed version : 5.4.45 End of support date : 2015/09/14 Announcement : http://php.net/supported-versions.php Supported versions : 7.1.x / 7.0.x / 5.6.x
6.4
FAIL
3389TCPmsrdpSSL Self-Signed Certificateless...
Title
SSL Self-Signed Certificate
Synopsis
The SSL certificate chain for this service ends in an unrecognized self-signed certificate.
Impact
The X.509 certificate chain for this service is not signed by a recognized certificate authority. If the remote host is a public host in production, this nullifies the use of SSL as anyone could establish a man-in-the-middle attack against the remote host. Note that this plugin does not check for certificate chains that end in a certificate that is not self-signed, but is signed by an unrecognized certificate authority.
Resolution
Purchase or generate a proper certificate for this service.
Data Received
The following certificate was found at the top of the certificate chain sent by the remote host, but is self-signed and was not found in the list of known certificate authorities : |-Subject : CN=iZ0fhyb9yyb8szZ
6.4
FAIL
3389TCPmsrdpMicrosoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weaknessless...
Title
Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness
Synopsis
It may be possible to get access to the remote host.
Impact
The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials. This flaw exists because the RDP server stores a hard-coded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack. See also : http://www.oxid.it/downloads/rdp-gbu.pdf http://www.nessus.org/u?8033da0d http://technet.microsoft.com/en-us/library/cc782610.aspx
Resolution
- Force the use of SSL as a transport layer for this service if supported, or/and - Select the 'Allow connections only from computers running Remote Desktop with Network Level Authentication' setting if it is available.
Data Received
CVEs
CVEScoreVector
CVE-2005-17946.4(AV:N/AC:L/Au:N/C:P/I:P/A:N)
5.0
FAIL
3389TCPmsrdpSSL Certificate with Wrong Hostnameless...
Title
SSL Certificate with Wrong Hostname
Synopsis
The SSL certificate for this service is for a different host.
Impact
The 'commonName' (CN) attribute of the SSL certificate presented for this service is for a different machine.
Resolution
Purchase or generate a proper certificate for this service.
Data Received
The identity known by SecurityMetrics is : 47.94.130.59 The Common Name in the certificate is : iZ0fhyb9yyb8szZ
5.0
FAIL
3389TCPmsrdpSSL Medium Strength Cipher Suites Supportedless...
Title
SSL Medium Strength Cipher Suites Supported
Synopsis
The remote service supports the use of medium strength SSL ciphers.
Impact
The remote host supports the use of SSL ciphers that offer medium strength encryption. SecurityMetrics regards medium strength as any encryption that uses key lengths at least 64 bits and less than 112 bits, or else that uses the 3DES encryption suite. Note that it is considerably easier to circumvent medium strength encryption if the attacker is on the same physical network. See also : https://www.openssl.org/blog/blog/2016/08/24/sweet32/
Resolution
Reconfigure the affected application if possible to avoid use of medium strength ciphers.
Data Received
Here is the list of medium strength SSL ciphers supported by the remote server : Medium Strength Ciphers (> 64-bit and < 112-bit key, or 3DES) DES-CBC3-SHA Kx=RSA Au=RSA Enc=3DES-CBC(168) Mac=SHA1 The fields above are : {OpenSSL ciphername} Kx={key exchange} Au={authentication} Enc={symmetric encryption method} Mac={message authentication code} {export flag}
5.0
FAIL
3389TCPmsrdpTLS Version 1.0 Protocol Detection (PCI DSS)less...
Title
TLS Version 1.0 Protocol Detection (PCI DSS)
Synopsis
The remote service encrypts traffic using a protocol with known weaknesses.
Impact
The remote service accepts connections encrypted using TLS 1.0. This version of TLS is affected by multiple cryptographic flaws. An attacker can exploit these flaws to conduct man-in-the-middle attacks or to decrypt communications between the affected service and clients.
Resolution
All processing and third party entities - including Acquirers, Processors, Gateways and Service Providers must provide a TLS 1.1 or greater service offering by June 2016. All processing and third party entities must cutover to a secure version of TLS (as defined by NIST) effective June 2018.
Data Received
TLSv1 is enabled on port 3389 and the server supports at least one cipher.
5.0
FAIL
3389TCPmsrdpSSL 64-bit Block Size Cipher Suites Supported (SWEET32)less...
Title
SSL 64-bit Block Size Cipher Suites Supported (SWEET32)
Synopsis
The remote service supports the use of 64-bit block ciphers.
Impact
The remote host supports the use of a block cipher with 64-bit blocks in one or more cipher suites. It is, therefore, affected by a vulnerability, known as SWEET32, due to the use of weak 64-bit block ciphers. A man-in-the-middle attacker who has sufficient resources can exploit this vulnerability, via a 'birthday' attack, to detect a collision that leaks the XOR between the fixed secret and a known plaintext, allowing the disclosure of the secret text, such as secure HTTPS cookies, and possibly resulting in the hijacking of an authenticated session. Proof-of-concepts have shown that attackers can recover authentication cookies from an HTTPS session in as little as 30 hours. Note that the ability to send a large number of requests over the same TLS connection between the client and server is an important requirement for carrying out this attack. If the number of requests allowed for a single connection were limited, this would mitigate the vulnerability. This plugin requires report paranoia as SecurityMetrics has not checked for such a mitigation. See also : https://sweet32.info https://www.openssl.org/blog/blog/2016/08/24/sweet32/
Resolution
Reconfigure the affected application, if possible, to avoid use of all 64-bit block ciphers. Alternatively, place limitations on the number of requests that are allowed to be processed over the same TLS connection to mitigate this vulnerability.
Data Received
List of 64-bit block cipher suites supported by the remote server : Medium Strength Ciphers (> 64-bit and < 112-bit key, or 3DES) DES-CBC3-SHA Kx=RSA Au=RSA Enc=3DES-CBC(168) Mac=SHA1 The fields above are : {OpenSSL ciphername} Kx={key exchange} Au={authentication} Enc={symmetric encryption method} Mac={message authentication code} {export flag}
CVEs
CVEScoreVector
CVE-2016-21835.0(AV:N/AC:L/Au:N/C:P/I:N/A:N)
CVE-2016-63294.3(AV:N/AC:M/Au:N/C:P/I:N/A:N)
4.3
FAIL
80TCPpossible_wlsWeb Application Potentially Vulnerable to Clickjackingless...
Title
Web Application Potentially Vulnerable to Clickjacking
Synopsis
The remote web server may fail to mitigate a class of web application vulnerabilities.
Impact
The remote web server does not set an X-Frame-Options response header or a Content-Security-Policy 'frame-ancestors' response header in all content responses. This could potentially expose the site to a clickjacking or UI redress attack, in which an attacker can trick a user into clicking an area of the vulnerable page that is different than what the user perceives the page to be. This can result in a user performing fraudulent or malicious transactions. X-Frame-Options has been proposed by Microsoft as a way to mitigate clickjacking attacks and is currently supported by all major browser vendors. Content-Security-Policy (CSP) has been proposed by the W3C Web Application Security Working Group, with increasing support among all major browser vendors, as a way to mitigate clickjacking and other attacks. The 'frame-ancestors' policy directive restricts which sources can embed the protected resource. Note that while the X-Frame-Options and Content-Security-Policy response headers are not the only mitigations for clickjacking, they are currently the most reliable methods that can be detected through automation. Therefore, this plugin may produce false positives if other mitigation strategies (e.g., frame-busting JavaScript) are deployed or if the page does not perform any security-sensitive transactions. See also : http://www.nessus.org/u?399b1f56 https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet https://en.wikipedia.org/wiki/Clickjacking
Resolution
Return the X-Frame-Options or Content-Security-Policy (with the 'frame-ancestors' directive) HTTP header with the page's response. This prevents the page's content from being rendered by another site when using the frame or iframe HTML tags.
Data Received
The following pages do not use a clickjacking mitigation response header and contain a clickable event : - http://47.94.130.59/ - http://47.94.130.59/l.php - http://47.94.130.59/phpMyAdmin/ - http://47.94.130.59/phpMyAdmin/index.php - http://47.94.130.59/phpMyAdmin/url.php - http://47.94.130.59/phpmyadmin/ - http://47.94.130.59/phpmyadmin/index.php - http://47.94.130.59/phpmyadmin/url.php
4.3
FAIL
3389TCPmsrdpSSL/TLS Services Support RC4 (PCI DSS)less...
Title
SSL/TLS Services Support RC4 (PCI DSS)
Synopsis
A service on the remote host supports RC4
Impact
At least one of the SSL or TLS services on the remote host supports the use of RC4 for encryption. RC4 does not meet the PCI definition of strong cryptography as defined by NIST Special Publication 800-57 Part 1. The RC4 cipher is flawed in its generation of a pseudo-random stream of bytes so that a wide variety of small biases are introduced into the stream, decreasing its randomness. If plaintext is repeatedly encrypted (e.g., HTTP cookies), and an attacker is able to obtain many (i.e., tens of millions) ciphertexts, the attacker may be able to derive the plaintext. See also : https://www.rc4nomore.com https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls
Resolution
Consult the software's manual and reconfigure the service to disable support for RC4.
Data Received
The SSL/TLS service on port 3389 supports the following RC4 ciphers : High Strength Ciphers (>= 112-bit key) RC4-MD5 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5 RC4-SHA Kx=RSA Au=RSA Enc=RC4(128) Mac=SHA1 The fields above are : {OpenSSL ciphername} Kx={key exchange} Au={authentication} Enc={symmetric encryption method} Mac={message authentication code} {export flag}
CVEs
CVEScoreVector
CVE-2013-25664.3(AV:N/AC:M/Au:N/C:P/I:N/A:N)
CVE-2015-28084.3(AV:N/AC:M/Au:N/C:P/I:N/A:N)
4.3
FAIL
3389TCPmsrdpSSL RC4 Cipher Suites Supported (Bar Mitzvah)less...
Title
SSL RC4 Cipher Suites Supported (Bar Mitzvah)
Synopsis
The remote service supports the use of the RC4 cipher.
Impact
The remote host supports the use of RC4 in one or more cipher suites. The RC4 cipher is flawed in its generation of a pseudo-random stream of bytes so that a wide variety of small biases are introduced into the stream, decreasing its randomness. If plaintext is repeatedly encrypted (e.g., HTTP cookies), and an attacker is able to obtain many (i.e., tens of millions) ciphertexts, the attacker may be able to derive the plaintext. See also : http://www.nessus.org/u?217a3666 http://cr.yp.to/talks/2013.03.12/slides.pdf http://www.isg.rhul.ac.uk/tls/ http://www.imperva.com/docs/HII_Attacking_SSL_when_using_RC4.pdf
Resolution
Reconfigure the affected application, if possible, to avoid use of RC4 ciphers. Consider using TLS 1.2 with AES-GCM suites subject to browser and web server support.
Data Received
List of RC4 cipher suites supported by the remote server : High Strength Ciphers (>= 112-bit key) RC4-MD5 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5 RC4-SHA Kx=RSA Au=RSA Enc=RC4(128) Mac=SHA1 The fields above are : {OpenSSL ciphername} Kx={key exchange} Au={authentication} Enc={symmetric encryption method} Mac={message authentication code} {export flag}
CVEs
CVEScoreVector
CVE-2013-25664.3(AV:N/AC:M/Au:N/C:P/I:N/A:N)
CVE-2015-28084.3(AV:N/AC:M/Au:N/C:P/I:N/A:N)
4.3
FAIL
3389TCPmsrdpTerminal Services Encryption Level is Medium or Lowless...
Title
Terminal Services Encryption Level is Medium or Low
Synopsis
The remote host is using weak cryptography.
Impact
The remote Terminal Services service is not configured to use strong cryptography. Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.
Resolution
Change RDP encryption level to one of : 3. High 4. FIPS Compliant
Data Received
The terminal services encryption level is set to : 2. Medium
4.3
FAIL
3389TCPmsrdpTerminal Services Doesn't Use Network Level Authentication (NLA) Onlyless...
Title
Terminal Services Doesn't Use Network Level Authentication (NLA) Only
Synopsis
The remote Terminal Services doesn't use Network Level Authentication only.
Impact
The remote Terminal Services is not configured to use Network Level Authentication (NLA) only. NLA uses the Credential Security Support Provider (CredSSP) protocol to perform strong server authentication either through TLS/SSL or Kerberos mechanisms, which protect against man-in-the-middle attacks. In addition to improving authentication, NLA also helps protect the remote computer from malicious users and software by completing user authentication before a full RDP connection is established. See also : http://technet.microsoft.com/en-us/library/cc732713.aspx http://www.nessus.org/u?e2628096
Resolution
Enable Network Level Authentication (NLA) on the remote RDP server. This is generally done on the 'Remote' tab of the 'System' settings on Windows.
Data Received
SecurityMetrics was able to negotiate non-NLA (Network Level Authentication) security.
4.0
FAIL
3306TCPMySQLOpen MySQL database portless...
Title
Open MySQL database port
Synopsis
An open MySQL database port was detected.
Impact
Resolution
Disable public-facing access to your MySQL database.
查看打开的端口10.0 失败 3389TCPmsrdpMS14-066: Schannel 中的漏洞可能允许远程代码执行 (2992611) (uncredentialed 检查) 减少..。
标题 MS14-066: Schannel 中的漏洞可能允许远程代码执行 (2992611) (uncredentialed 检查) 简介远程 Windows 主机受远程代码执行漏洞的影响。
由于安全通道 (Schannel) 安全包不正确处理数据包, 远程 Windows 主机受到远程代码执行漏洞的影响。攻击者可以通过向 Windows 服务器发送特制的数据包来利用此问题。请注意, 此插件发送客户端证书 TLS 握手消息, 后跟 CertificateVerify 消息。某些 Windows 主机在接收到其不要求使用 CertificateRequest 消息的客户端证书时将关闭连接。在这种情况下, 由于无法发送 CertificateVerify 消息, 插件无法继续检测该漏洞。另请参见: https://technet.microsoft.com/library/security/ms14-066 解决方案 microsoft 已发布了一组用于 Windows 2003、Vista、2008、7、2008 R2、8、2012、8.1 和 2012 R2 的补丁程序。
收到的数据 CVEs CVEScoreVector CVE 2014-632110.0 (AV: AC: i/o: c/s: c/c++: c) 10.0 失败80TCPpossible_wlsPHP 不支持的版本 Detectionless..。
标题 PHP 不支持的版本检测简介远程主机包含不受支持的 web 应用程序脚本语言版本。
根据其版本的影响, 不再支持在远程主机上安装 PHP。缺少支持意味着供应商不会发布该产品的新安全修补程序。因此, 它很可能包含安全漏洞。另请参见: http://php.net/eol.php https://wiki.php.net/rfc/releaseprocess 分辨率升级到当前支持的 php 版本。收到的数据来源: 服务器: Apache/2.4. 23 (Win32) OpenSSL/1.0. 2 j PHP/5.4. 45 安装版本: 5.4.45 支持结束日期: 2015/09/14 公告: http://php.net/supported-versions.php 支持版本: 7.1.x/7.0.x/5.6.x 6.4 失败
3389TCPmsrdpSSL 自签名公钥..。
标题 ssl 自签名证书简介此服务的 SSL 证书链以无法识别的自签名证书结尾。
对此服务的 x 509 证书链的影响未被认可的证书颁发机构签名。如果远程主机是生产中的公用主机, 这就会使 SSL 的使用无效, 因为任何人都可以建立针对远程主机的人为中间攻击。请注意, 此插件不检查结束于未自签名的证书中的证书链, 而是由无法识别的证书颁发机构签名。
解决方案购买或生成此服务的适当证书。
收到的数据在远程主机发送的证书链的顶部找到了以下证书, 但它是自签名的, 在已知的证书颁发机构列表中找不到: |-主题: CN=iZ0fhyb9yyb8szZ 6.4 失败3389TCPmsrdpMicrosoft 窗口远程桌面协议服务器中间的 Weaknessless..。
标题 Microsoft Windows 远程桌面协议服务器中级弱势简介可能会访问远程主机。
影响远程桌面协议服务器 (终端服务) 的远程版本容易受到中端 (MiTM) 攻击。RDP 客户端在设置加密时不努力验证服务器的身份。具有拦截 RDP 服务器通信量的攻击者可以在不被检测的情况下与客户端和服务器建立加密。这种性质的 MiTM 攻击将允许攻击者获得传输的任何敏感信息, 包括身份验证凭据。存在此缺陷的原因是 RDP 服务器在 mstlsapi.dll 库中存储硬编码的 RSA 私钥。任何访问此文件 (在任何 Windows 系统上) 的本地用户都可以检索该密钥并将其用于此攻击。另请参见: http://www.oxid.it/downloads/rdp-gbu.pdf http://www.nessus.org/u?8033da0d http://technet.microsoft.com/en-us/library/cc782610.aspx 解决方案-强制使用 SSL 作为此服务的传输层 (如果支持), 或/和-选择 "仅允许在运行远程桌面的计算机上使用网络级身份验证 "设置 (如果可用) 进行连接。
收到的数据 CVEs CVEScoreVector CVE-2005-17946.4 (AV: n/交: n/非: 邮编: p/: n) 5.0 失败3389TCPmsrdpSSL 证书, 错误 Hostnameless..。
标题 SSL 证书错误的主机名简介此服务的 ssl 证书用于其他主机。
影响为该服务提供的 SSL 证书的 "commonName" (CN) 属性是针对另一台计算机的。
解决方案购买或生成此服务的适当证书。
收到的数据 SecurityMetrics 已知的身份是: 47.94.130.59 证书中的公用名称是: iZ0fhyb9yyb8szZ 5.0 失败3389TCPmsrdpSSL 中等强度密码套件 Supportedless..。
标题 SSL 中等强度密码套件支持概要远程服务支持使用中等强度的 SSL 密码。
影响远程主机支持使用提供中等强度加密的 SSL 密码。SecurityMetrics 将中等强度视为使用密钥长度至少为64位和少于112位的加密, 否则使用3DES 加密套件。请注意, 如果攻击者位于同一物理网络上, 则避开中等强度加密会更容易。另请参见: 如果可能, https://www.openssl.org/blog/blog/2016/08/24/sweet32/决议重新配置受影响的应用程序, 以避免使用中等强度密码。已验证会话的 ijacking。概念证明表明攻击者可以在30小时内从 HTTPS 会话中恢复身份验证 cookie。请注意, 在客户端和服务器之间通过同一 TLS 连接发送大量请求的能力是执行此攻击的重要要求。如果单个连接所允许的请求数量有限, 则会减少此漏洞。这个插件需要报告偏执, 因为 SecurityMetrics 没有检查这样的缓解。另请参见: https://sweet32.info https://www.openssl.org/blog/blog/2016/08/24/sweet32/决议重新配置受影响的应用程序 (如果可能), 以避免使用所有64位块密码。或者, 对允许在同一 TLS 连接上处理的请求数进行限制, 以减轻此漏洞。
远程服务器支持的64位分组密码套件的数据接收列表: 中等强度密码 (>> 64 位和112位密钥, 或 3DES) DES-CBC3-SHA Kx = rsa Au Enc = 3 DES (168) Mac=SHA1 上面的字段是: {OpenSSL ciphername} Kx = {密钥交换} Au = {身份验证} Enc = {对称加密方法} Mac = {消息身份验证代码} {导出标志} CVEs CVEScoreVector CVE-2016-21835.0 (AV: n/交: CVE: n/个: n/2016-63294.3 (AV: n/ac: 不/非: n/个: n) 4.3 失败80TCPpossible_wlsWeb应用程序可能容易受到 Clickjackingless 的攻击..。
标题 Web 应用程序可能易受点击劫持简介远程 web 服务器可能无法减轻类 Web 应用程序漏洞。
影响远程 web 服务器不会在所有内容响应中设置 X 帧选项响应头或内容安全策略 "框架-祖先" 响应标头。这可能会使站点暴露在点击劫持或 UI 纠正攻击中, 攻击者可以诱使用户单击与用户感知页面不同的易受攻击页面区域。这可能导致用户执行欺诈或恶意事务。"X 帧" 选项已被 Microsoft 建议为一种减少点击劫持攻击的方法, 目前由所有主要浏览器供应商支持。内容安全策略 (CSP) 已由 W3C Web 应用程序安全工作组提出, 并在所有主要浏览器供应商中得到越来越多的支持, 以此来减轻点击劫持和其他攻击。"框架-祖先" 策略指令限制了哪些源可以嵌入受保护的资源。请注意, 虽然 X 帧选项和内容安全策略响应头不是点击劫持的唯一缓解措施, 但它们目前是可通过自动化检测到的最可靠的方法。因此, 如果部署了其他缓解策略 (例如, 帧破坏 JavaScript) 或者该页不执行任何安全敏感事务, 则此插件可能会产生误报。另请参见: http://www.nessus.org/u?399b1f56 https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet https://en.wikipedia.org/wiki/Clickjacking 分辨率返回 X 帧选项或内容安全策略 (使用 "框架-祖先的指令) HTTP 标头与页的响应。这可防止在使用框架或 iframe HTML 标记时, 其他站点呈现页面内容。
收到的数据以下页不使用点击劫持缓解响应标头并包含可单击的事件:-http://47.94.130.59/-http://47.94.130.59/l.php-http://47.94.130.59/phpMyAdmin/-http://47.94.130.59/phpMyAdmin/index.php-http://47.94.130.59/phpMyAdmin/url. php-http://47.94.130.59/phpmyadmin/-http://47.94.130.59/phpmyadmin/index.php http://47.94.130.59/phpmyadmin/url.php 4.3 失败 3389 tcpmsrdpssl/TLS 服务支持 RC4 (PCI DSS) 较少。..
标题 SSL/TLS 服务支持 RC4 (PCI DSS) 简介远程主机上的服务支持 RC4 影响远程主机上至少有一个 SSL 或 TLS 服务支持使用 RC4 进行加密。RC4 不符合 NIST 特别出版物800-57 部分1所定义的强加密的 PCI 定义。RC4 密码在其生成伪随机字节流时存在缺陷, 因此将大量的小偏差引入流中, 从而减少其随机性。如果明文被重复加密 (例如 HTTP cookie), 并且攻击者能够获得许多 (即数以百万计) 的 ciphertexts, 则攻击者可能能够派生明文。另请参见: https://www.rc4nomore.com https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls 决议查阅软件手册并重新配置服务, 以禁用对 RC4 的支持。
接收到端口3389上的 SSL/TLS 服务的数据支持以下 RC4 密码: 高强度密码 (>> = 112 位密钥) RC4-MD5 Kx = rsa Au = rsa Enc = RC4 (128) Mac=MD5 RC4-SHA Kx = rsa au = rsa Enc = RC4 (128) Mac=SHA1 上面的字段为: {OpenSSL ciphername} Kx = {键交换} Au = {身份验证} Enc = {对称加密方法} Mac = {消息身份验证代码} {导出标志} CVEs CVEScoreVector CVE-2013-25664.3 (AV: n-/交: CVE: n/位: n/2015-28084.3 (AV: n/ac: 不/非: n/个: n) 4.3 失败
3389TCPmsrdpSSL. RC4 密码套件支持 (成人礼) 少..。
标题 SSL RC4 密码套件支持 (成人礼) 简介远程服务支持使用 RC4 密码。
影响远程主机支持在一个或多个密码套件中使用 RC4。RC4 密码在其生成伪随机字节流时存在缺陷, 因此将大量的小偏差引入流中, 从而减少其随机性。如果明文被重复加密 (例如 HTTP cookie), 并且攻击者能够获得许多 (即数以百万计) 的 ciphertexts, 则攻击者可能能够派生明文。另请参见: http://www.nessus.org/u?217a3666 http://cr.yp.to/talks/2013.03.12/slides.pdf http://www.isg.rhul.ac.uk/tls/http://www.imperva.com/docs/HII_Attacking_SSL_when_using_RC4.pdf 解决方案可重新配置受影响的应用程序, 如果可能, 以避免使用 RC4 密码。考虑在浏览器和 web 服务器支持下使用 TLS 1.2 与 AES-GCM 套件。
远程服务器支持的 RC4 密码套件的数据接收列表: 高强度密码 (>> = 112 位密钥) RC4-MD5 Kx = rsa Au = rsa Enc = RC4 (128) Mac=MD5 RC4-SHA Kx = rsa au = rsa Enc = RC4 (128) Mac=SHA1 上面的字段为: {OpenSSL ciphername} Kx = {密钥交换} Au= {身份验证} Enc = {对称加密方法} Mac = {消息身份验证代码} {导出标志} CVEs CVEScoreVector CVE-2013-25664.3 (AV: n/交: CVE: n/位: n/个: 2015-28084.3 (AV: n/ac: 不/非: n/个: n) 4.3 失败3389TCPmsrdpTerminal服务加密级别为中等或 Lowless..。
标题终端服务加密级别为中或低简介远程主机使用弱加密。
影响远程终端服务服务未配置为使用强加密。使用此服务的弱加密可能使攻击者更容易窃听通信, 并获得截图和/或击键。
分辨率将 RDP 加密级别更改为: 3. 高4。收到的 FIPS 兼容数据终端服务加密级别设置为: 2. 中型4.3 故障3389TCPmsrdpTerminal 服务不使用网络级身份验证 (NLA) Onlyless..。
标题终端服务不使用网络级身份验证 (NLA) 仅简介远程终端服务不使用网络级身份验证。影响远程终端服务未配置为仅使用网络级身份验证 (NLA)。NLA 使用凭据安全支持提供程序 (CredSSP) 协议通过 TLS/SSL 或 Kerberos 机制执行强大的服务器身份验证, 这可以防止中间攻击。除了改进身份验证之外, NLA 还通过在建立完整的 RDP 连接之前完成用户身份验证, 帮助保护远程计算机免受恶意用户和软件的攻击。另请参见: http://technet.microsoft.com/en-us/library/cc732713.aspx http://www.nessus.org/u?e2628096 分辨率在远程 RDP 服务器上启用网络级别身份验证 (NLA)。这通常在 Windows 上的 "系统" 设置的 "远程" 选项卡上完成。
收到的数据 SecurityMetrics 能够协商非 NLA (网络级身份验证) 安全性。
4.0 故障 3306TCPMySQLOpen MySQL 数据库 portless..。
标题打开 mysql 数据库端口简介检测到一个打开的 mysql 数据库端口。
影响分辨率禁用对 MySQL 数据库的面向公众的访问。
某政务网站性能优化
门户类网站性能测试分析及调优
1 背景
前段时间,性能测试团队经历了一个规模较大的门户网站的性能优化工作,该网站的开发和合作涉及多个组织和部门,而且网站的重要性不言而喻,同时上线时间非常紧迫,关注度也很高,所以对于整个团队的压力也非常大。
在此,把整个经历过程给大家分享一下,包括了主要包括了如何使用性能测试的压测工具,压测前的性能问题评估,以及压测执行后的性能问题分析、瓶颈定位。
该门户网站的服务器是放在华通和阿里云的平台上的,所以对华通和阿里共建的云平台安全及应急措施方面要求非常高,需要团队给予全力的保障和配合。
性能测试(Performance Testing)是集测试机管理、测试脚本管理、测试场景管理、测试任务管理、测试结果管理为一体的性能云测试平台,可以帮助您全方位的评估云上系统性能。
本次优化主要是使用了该测试平台服务对客户搭建在ECS上的服务器进行多种类型(性能测试、负载测试、压力测试、稳定性测试、混合场景测试、异常测试等)的性能压测、调试和分析,最终达到满足期望预估的性能目标值,且上线后在高峰期满足实际的性能和稳定要求。
2 术语定义
在介绍项目经历之前,再明确一下测试当中用到的专业指标术语定义,包括但不仅限于以下:
PV: 即PageView, 即页面浏览量或点击量,用户每次刷新即被计算一次。我们可以认为,用户的一次刷新,给服务器造成了一次请求。
UV: 即UniqueVisitor,访问您网站的一台电脑客户端为一个访客。00:00-24:00内相同的客户端只被计算一次。
TPS:TPS(Transaction Per Second)每秒钟系统能够处理的交易或事务的数量,它是衡量系统处理能力的重要指标。
响应时间: 响应时间是指从客户端发一个请求开始计时,到客户端接收到从服务器端返回的响应结果结束所经历的时间,响应时间由请求发送时间、网络传输时间和服务器处理时间三部分组成。
VU: Virtual user,模拟真实业务逻辑步骤的虚拟用户,虚拟用户模拟的操作步骤都被记录在虚拟用户脚本里。一般性能测试过程中,通俗称之为并发用户数。
TPS波动: 系统性能依赖于特定的硬件、软件代码、应用服务、网络资源等,所以在性能场景执行期间,TPS可能会表现为稳定,或者波动,抑或遵循一定的上升或下降趋势。我们用TPS波动系数来记录这个指标值。
CPU: CPU资源是指性能测试场景运行的这个时间段内,应用服务系统的CPU资源占用率。CPU资源是判断系统处理能力以及应用运行是否稳定的重要参数。
Load: 系统正在干活的多少的度量,队列长度。系统平均负载,被定义为在特定时间间隔(1m,5m,15m)内运行队列中的平均进程数
。
I/O: I/O可分为磁盘IO和网卡IO。
JVM: 即java虚拟机,它拥有自己的处理器、堆栈、寄存器等,还有自己相应的指令系统。Java应用运行在JVM上面。
GC: GC是一种自动内存管理程序,它主要的职责是分配内存、保证被引用的对象始终在内存中、把不被应用的对象从内存中释放。FGC会引起JVM挂起。
网速: 网络中的数据传输速率,一般以Byte/s为单位。通过ping延时来反映网速。
流量: 性能测试中,一般指单位时间内流经网卡的总流量。分为inbound和outbound,一般以KB为单位。
3 评估
本次性能测试过程的参与人包括了阿里云应急保障小组等多部门人员,网站为外部供应商开发,阿里云提供云主机和技术支持。
该网站之前前期也由其他部门做了验收工作,进行了完整的性能测试,报告显示,性能较差,第一次测试,网站并发数没有超过35个,第二次测试,网站上做了优化后,静态页面缩小后,并发用户数100内 5s ,200内 90%响应在15s以上,随着并发用户数的增加,页面响应最高可到20多秒,而且访问明显感觉较慢,所以联系了阿里云的技术支持,希望能够帮助诊断性能问题,给出优化建议。
测试业务 并发用户数 平均响应时间(秒) 90%响应时间(秒)
首页浏览 100 12.082 15.289
200 23.949 29.092
分页浏览 100 8.973 12.343
200 18.846 24.106
经过会议讨论后,评估出最终的测试目标:带页面的所有静态资源一起,响应时间必须小于5秒,同时并发访问用户数最低500,TPS根据实际的结果来得出。
4 性能测试目标
并发用户数:>=500
业务响应时间:<5秒
5 分析
通过性能测试前端分析工具(未开放)分析,页面的响应时间88%左右都是消耗在前端资源加载上,服务器端消耗只占到了页面响应的12%左右;
一个网站的响应一般由四部分时间组成,前端、网络、服务器和数据库,前端主要是减小页面大小,减小页面请求数,优化页面js等,网络主要是使用CDN,优化连接数等,服务器主要是优化Apache,优化Tomcat,优化java代码等,数据库是优化sql语句,优化索引,优化数据存储等。<rb>
6 测试和优化
6.1 页面前端分析及优化
我们对页面的优化仍然从前端开始,首先通过性能测试的前端测试工具(未开放)进行扫描,我们发现以下问题并优化:
Js较大,无压缩,同时存在重复请求,最多一个js加载4次,已做压缩和减少。
Js位置不合理,阻碍页面加载。
外部css 考虑本地实现,减少调用
Banner 背景图片较多,无压缩,建议合并
页面1的后台.do有4个,减少为3个
页面2的后台do有 2个,减少为1个
存在加载失败链接,404失败,同时次数非常多,更换为cnzz
页面加载外部资源失败 (qq等),且不稳定
分享功能比较慢
外部资源建议异步实现,目前全部是jquery渲染,iframe嵌套,时间资源限制,后期优化
尽量减少或者不使用iframe
页面请求数太多,主要是js和css重复加载问题和图片较小导致的。 经过以上修改及配置服务器静态资源缓存后,性能提高25%,首页响应从1.5秒提高到1.1秒,并且前端优化持续进行。
6.2 服务端优化
一般核心页面都要求在300毫秒以下,非核心页面要求在500毫秒以下,同时重点关注并发时的负载和稳定,服务器端代码和响应的快速稳定是整个页面性能的重点。
6.2.1 脚本编写及场景构造
根据前期需求评估的内容,客户是一个门户网站,主要由不同功能页面组成的,各个功能页面当中又包含了静态内容和异步动态请求,所以,性能测试的脚本的编写主要涵盖了各页面的请求和相关静态资源的请求,这里存在一个串行和并行的概念:
串行:请求的页面和页面当中的静态资源、异步动态请求组成一个同步请求,每一个内容都作为一个事务(也可以共同组成一个事务,分开事务的好处是可以统计各部分的响应时间),这样压测任务执行时,线程就会根据事物的顺序分布调用执行,相当于一个页面的顺序加载,弊端是无法模拟实际IE的小范围并发,但这样测试的结果是最严格的。
并行:各个页面之前可以使用不同的任务,采用并行的混合场景执行,同时设置一定的比例(并发用户数),保证服务器承受的压力与实际用户访问相似。
场景并发用户数:经常会遇到“设置多大并发用户数合适?”的问题,因为在没有任何思考时间的时候,我们有一个简单的公式:
VU(并发压测用户数) = TPS(每秒执行事务数) × RT(响应时间)
所以,在寻找合适的并发用户数上,建议使用性能测试的“梯度模式”,逐渐增加并发用户数,这个时候压力也会越来越大,当TPS的增长率小于响应时间的增长率时,这就是性能的拐点,也就是最合理的并发用户数;当TPS不再增长或者下降时,这个时候的压力就是最大的压力,所使用的并发用户数就是最大的并发用户数。如果此时的TPS不满足你的要求,那么就需要寻找瓶颈来优化。如下图演示的一个性能曲线:
a点:性能期望值
b点:高于期望,系统安全
c点:高于期望,拐点
d点:超过负载,系统崩溃
注意:使用外网地址压测可能会造成瞬时流量较大,造成流量计费,从而产生费用,建议可以使用内网地址压测,避免损失。
6.2.2 第一阶段
在按照客户提供的4个URL请求构造场景压测以后,同时根据实际情况和客户要求,使用性能测试,构造相应的场景和脚本后,模拟用户实际访问情况,并且脚本中加上了img、js、css等各一个的最大静态资源:
条件:5台ECS机器,200并发用户数,一个后台页面加3个静态页面(共150K)
结果:静态4000TPS,动态1500TPS,服务器资源:CPU 98%
分析和优化:
服务器资源消耗较高,超过75%,存在瓶颈,分析平台显示:
分析发现原来是apache到tomcat的连接等待导致,现象是100个并发压测,就有100个tomcat的java线程,而且全部是runnable的状态,轮询很耗时间。
同时发现用户使用的是http协议,非ajp协议,不过这个改动较大,需要使用mod_jk模块,时间原因, 暂缓。
解决方法:修改了Apache和tomcat的连接协议 为nio协议,同时去除ssl 协议。Tomcat连接数据库池由30初始调整为300,减少开销
<Connectorport="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443" />
性能对比:
再进行1轮压测含动态含静态文件,TPS能够从1w达到2.7W,性能提高将近3倍,并且tomcat的线程从原来的200跑满,降到100附近并且线程没有持续跑满,2.6W TPS时候CPU在80%附近
发现机器的核数都是2核,8G内存,对于CPU达到98%的情况,CPU是瓶颈,而对于应用来说比较浪费,所以将2核统一升级为4核。
扩展机器资源,从目前的4台扩到6台,同时准备4台备份,以应对访问量较大的情况。
思考和风险:
异步请求处理:客户所提供的url都是html静态,虽然页面当中含动态数据,但分析后发现动态数据都是通过jquery执行然后iframe嵌套的,所以不会随着html文件的加载而自动加载,需要分析所有的动态页面,同时压测,这是页面存在异步请求需要关注的地方。
Iframe:Iframe嵌套页面的方式优点是静态资源调用方便、页面和程序可以分离,但是它的缺点也显而易见,包括样式、脚本额外注入,增加请求等等;还有搜索引擎搜素不到内容;iframe创建比其他元素慢1~2个数量级;资源重复加载;iframe会阻塞页面加载,阻塞onload事件;占用主页连接池;html5不再支持。所以建议尽量不要使用或者少使用。
[font='Times New Roman']: 脚本录制和模拟实际用户访问。当用户的图片、javascript、CSS等静态资源和后端代码在同一台服务器上时,需要模拟用户的实际访问请求,压测脚本涵盖所有链接和资源。那么使用脚本录制功能就可以采集更全更完整的脚本。
6.2.3 第二阶段
找到几个页面的所有动态资源后,整合成为一个事务,串行访问,同时并发压测,从而对纯服务器端进行压测,测试结果如下图:
性能分析:页面一和页面二的响应时间分别达到了5秒和2秒,性能较差,整体TPS只有11
性能分析:
分析发现响应时间高的原因主要在RDS数据库上,数据库此时的CPU已经达到100%,处理较慢,怀疑跟sql有关,分析慢sql。
优化方法:
数据库第一批优化完毕,优化了6条sql语句之前5s左右,优化后在150ms左右,数据库的QPS 从1k上升到6k。
RDS优化内容包括:
优化点主要是调整慢sql的索引,部分sql需要调整表结构和sql写法,需要应用配合才能完成优化,优化前QPS在1000左右,优化后QPS到达6000
前端响应时间从5秒降低到150毫秒,前台TPS由150提升到1500.总的TPS可以达到2000。
6.2.4 第三阶段
通过性能测试模拟用户实际访问情况,包括所有静态资源,评估出当响应时间小于5秒的时候,最大支撑的并发用户数。
测试结果:
可以看到,所有的事务RT加起来小于5秒的情况下,并发用户数可以达到3000(6个事务,6个脚本,每个脚本500),远远满足项目500个并发用户的目标。
总结:
6.2.5 第四阶段
评估其他非主站应用的性能以及含静态页面的其他5个页面内容,包括:
搜索压测
操作压测
登录压测
证书登入
针对5个常用场景进行混合压测
测试结果:
发现的风险和问题:
测试发现,流量存在非常明显的波动,不经过某模块就无此问题,发现有大量的reset连接,会诊后总结:端口复用导致的问题。FULL NAT模式和LVS存在兼容性问题。最终结果: 由于存在兼容性问题,影响到网站的稳定性和性能,暂时加载该模块,待问题解决后再加。先使用另外一个模块代替
.凌晨2点,针对单点用户登入进行了压测,发现100并发,该业务接口已宕机,分析结果:Cache缓存设置太小,1G内存容量导致内存溢出,已建议修改为4G。使用http协议性能不佳,早上4点30进行少量代码优化后,业务直接不可用,环境出现宕机无法修复,我们快速进行快照恢复,5分钟内恢复3台业务机,云产品的优势尽显。用户log日志撑满系统盘,并且一直不知这台云主机还有数据盘,产品上我们要做反思。帮助用户已进行挂盘及日志迁移至数据盘,减少单盘的IO压力。
Web服务器数据同步,发现服务器io和cpu压力过大。加入inotify机制,由文件增量同步,变更为文件系统的变化通知机制。将冷备及4台备用web机器使用该方式同步,目前,查看内容分发主机IO和CPU使用率已回复正常范围同步推送时间,根据服务器的负载,进行调整同步时间。今天已修改为2分钟。 由于备份量大,晚上进行全量同步。新增4台备用机,已关闭apache 端口 自动从slb去除,作为冷备
由于目前单点用户登入入口存在架构单点宕机风险,进行登入和未登入风险验证,确认,如用户已登入后,登入业务系统出现宕机,进行简单的页面点击切换,不受影响
内存优化
按照JVM内存管理模式,调整系统启动参数,如果一台ECS部署一台服务器,建议不要选择默认的JVM配置,应该设置内存为物理内存的一半,同时设置相应的YTC和FGC策略,观察Old区变化,避免大量Full GC,建议Full GC频率大于1小时,同时GC时间小于1秒钟。
6.3 架构优化
单点登录服务修改为SLB
检索 修改为 SLB
内容管理云平台云服务器实现行文件差异同步,同时冷备
新增4台web机器
7 总结
备注:服务器的CPU达到100% 这其实是一个好的现象,说明我们的逻辑全部已经走到了资源消耗上,而不是由外部其他逻辑限制或blocked,这种现象带来的好处就是,首先我们可以集中精力从减少代码的资源消耗上解决问题,带来性能的改善,其次,实在无法优化我们也可以增加机器台数,横向扩展来让性能成倍的提高,这也是用成本换性能的方法。当然,前提是架构上支持负载均衡的分布式架构。
总的来说就是,这种情况要不选择从纵向优化,或者选择从横向扩展,都可以增加。
8 遗留问题
时间原因,测试页面有限,有些页面没有测试覆盖到,比如后台页面。
登录系统存在内存风险,由于用户的缓存信息仍然存在单点问题,所以风险较大,同时系统压力不满足要求,并发较高存在crash风险,未来得及发现瓶颈所在。彻底解决必须使用OCS等缓存系统改造,同时优化数据库。
Iframe框架造成用户体验不好,需要改掉,换成异步js接口方式。
后台同步系统,对于资源消耗影响较大,需要持续优化。
平台应该提供开发和测试进行自主压测、分析、评估,同时提供统一的测试报告,保证各部分模块的性能,整合起来才能保障整个门户网站的性能。
CPU优化还需要继续分析跟进,目前只是增加机器资源降低风险,成本较高。
上线发布应该具备统一的回归验证机制,并且日常需要持续优化,避免由于后期代码的改动导致性能下降。
访问性能测试控制台
问答
SQL · 缓存 · 弹性计算 · 前端开发 · JavaScript · Java · 测试技术 · 应用服务中间件 · Apache · 数据库
2017-10-31
程序员报错QA大分享(1)
程序员报错QA征集第一弹来了哦~包含QA分享一期征集的部分内容,链接附带解决方案,可收藏哦~
npm install安装依赖一直报错?报错https://developer.aliyun.com/ask/301576 一个高难度的棘手的ajax处理怎么办? 报错https://developer.aliyun.com/ask/297111 shiro根据角色来进行权限验证,后台新增了一个角色后,每次都要去更新shiro.ini:报错 https://developer.aliyun.com/ask/297216 在django中,如何使用字符串作为对象名来调用model??报错https://developer.aliyun.com/ask/305768 jsf用的多吗?有什么优缺点?? 400 报错https://developer.aliyun.com/ask/294587 新项目,前台想学OSC不用Session,但验证码不知道怎么办:报错 https://developer.aliyun.com/ask/301267 weblogic 部署web应用时报错Provider com.sun.xml.?报错https://developer.aliyun.com/ask/306495 mybatis配置问题(已经解决)?报错https://developer.aliyun.com/ask/305252 tomcat redis 存放session配置报错java.lang.NoCl?报错https://developer.aliyun.com/ask/306218 shell如何自动设置mysql root密码 - shell报错https://developer.aliyun.com/ask/296991 new JSONObject(String)为什么报错?报错https://developer.aliyun.com/ask/303416 css 中的text-align: justify 文字对齐在安卓手机上无效配置报错 https://developer.aliyun.com/ask/296285 WEB项目发布,上下文路径配置问题 : 配置报错 https://developer.aliyun.com/ask/296101 [BlazeDS]Cannot create class of type 'co?400报错https://developer.aliyun.com/ask/294055 jquery 动态添加click 不请求服务器? 报错https://developer.aliyun.com/ask/297077 android studio中引入两个library的问题?报错https://developer.aliyun.com/ask/303587 银联网关支付接口开发?报错https://developer.aliyun.com/ask/302599 spring boot cache redis?报错https://developer.aliyun.com/ask/301037 print写入文件的问题 - 服务报错https://developer.aliyun.com/ask/295151 websocket中发送图片的二进制出现内容过长的错误?报错https://developer.aliyun.com/ask/301046 opencv+vs2010编译出现未识别标识符错误?报错https://developer.aliyun.com/ask/301753 最近装了一下centOS7,查了点问题:报错https://developer.aliyun.com/ask/298395 gps 模块返回的 经纬度 怎么对应上 百度或者 高德 gps经纬度 - 服务报错https://developer.aliyun.com/ask/295223 eclipse中提交git@osc报错?报错https://developer.aliyun.com/ask/305754 SpringAOP切面注释配置你是怎么运行成功的,我这边报错?报错https://developer.aliyun.com/ask/304046 linux中makefile设置路径的问题-linux报错https://developer.aliyun.com/ask/294526 firefox弹出警告报错 https://developer.aliyun.com/ask/295290 后端302触发了jquery ajax的error事件? 400 报错https://developer.aliyun.com/ask/293769 MiniDao持久层 Vs Mybatis:报错https://developer.aliyun.com/ask/303260 本人使用django1.11.16做了一个在线相册系统,现在想下载选中图片,想要?400报错https://developer.aliyun.com/ask/298179 折线图data级itemStyle设置无效的问题 - data报错https://developer.aliyun.com/ask/295748 java web邮箱开源组件的选择:报错https://developer.aliyun.com/ask/297964 使用Pyhton smtplib库发送邮件报错,ConnectionRefuse?400报错https://developer.aliyun.com/ask/301253 springMVC 表单 get方法提交正常 post提交报错HTTP Sta?报错https://developer.aliyun.com/ask/302405 ajax 请求成功后返回值问题? 400 报错https://developer.aliyun.com/ask/295984 redis 配置主从报错?报错https://developer.aliyun.com/ask/301733 shiro学习? 400 报错https://developer.aliyun.com/ask/294447 测试工具 0k 测试 1K 测试 8K 测试 64K 测试:报错https://developer.aliyun.com/ask/305063 Vue.js利用Axios请求到数据后,不能在页面上现实??报错https://developer.aliyun.com/ask/300728 JFinal用tomcat启动报错?报错https://developer.aliyun.com/ask/303450 大连沈阳源创会图文回顾及PPT分享? 400 报错https://developer.aliyun.com/ask/296773 grails最佳实践 - grails报错https://developer.aliyun.com/ask/296234 把springmvc的项目放进tomcat9运行,报错了?报错https://developer.aliyun.com/ask/300303 安装CentOS 重启后 无法输入密码:报错https://developer.aliyun.com/ask/297840 "jquery mobile 绑定监听器问题 :报错https://developer.aliyun.com/ask/305567" 求思路:线下和线上会员的设计:报错 https://developer.aliyun.com/ask/301216 anycmd所理解的rbac:报错https://developer.aliyun.com/ask/299622 sharding-jdbc分库分表疑问 SQL语句限制 : 配置报错 https://developer.aliyun.com/ask/295916 关于okHttputils gradle编译出错?报错https://developer.aliyun.com/ask/303674 Tengine concat 组合JavaScript和CSS文件问题 - 配置报错https://developer.aliyun.com/ask/296236 最近github老是push代码失败是个什么情况?!?报错https://developer.aliyun.com/ask/301613 一直往阻塞队列阻塞放数据会发生什么?? 400 报错https://developer.aliyun.com/ask/294678 mongod已停止工作??报错https://developer.aliyun.com/ask/302584 onSaveInstanceState 能保存 控件变量吗??报错https://developer.aliyun.com/ask/305452 关于netbeans7.2的配置问题!:配置报错 https://developer.aliyun.com/ask/295058 applet+jasperreport点击打印时报错,求大神指点?报错https://developer.aliyun.com/ask/305781 jquery mobile如何实现AJAX请求? 400 报错https://developer.aliyun.com/ask/295979 对数据库进行写操作的安全问题:报错https://developer.aliyun.com/ask/303211 如何有效过滤UGC社区下的垃圾信息?:配置报错 https://developer.aliyun.com/ask/294996 有 wait就必须要有synchronized,不然会报错吗???报错https://developer.aliyun.com/ask/305843 数据代码出现问题,求指教 - 代码报错https://developer.aliyun.com/ask/294528 注册时使用spring声明式事务管理? 400 报错https://developer.aliyun.com/ask/294968 从Voa网站下载图片部分图片下载不成功:报错https://developer.aliyun.com/ask/299590 VMware装了ubuntu18.04.3,安装后正常使用电脑关机再打开虚拟机就?400报错https://developer.aliyun.com/ask/297591 apk打包后安装了无法运行? 400 报错https://developer.aliyun.com/ask/296855 SpringMVC中controller如何接收ajax请求的返回值并完成跳转页面? 400 报错https://developer.aliyun.com/ask/297437 请教一个maven配置问题?:报错https://developer.aliyun.com/ask/299441 用iTextSharp读取PDF文档中文本内容:报错https://developer.aliyun.com/ask/298572 ECharts 的柱状图显示比较小,怎么放大?周围空白的地方太多了? 400 报错https://developer.aliyun.com/ask/293787 Intellij 用maven配置spring+sptingmvc项目?报错https://developer.aliyun.com/ask/303686 求各位大神看看下边的代码:报错https://developer.aliyun.com/ask/299573 CKEditor的配置 - 配置报错https://developer.aliyun.com/ask/296169 为何dubbo在tomcat启动报错??报错https://developer.aliyun.com/ask/302795 Flask-Bootstrap如何更改自带的模板? - Flask报错https://developer.aliyun.com/ask/296681 “Ceph浅析”系列之七——关于Ceph的若干想法:报错https://developer.aliyun.com/ask/299495 java.lang.NumberFormatException: For inp?400报错https://developer.aliyun.com/ask/300548 请教安装Queens版的问题?报错https://developer.aliyun.com/ask/299180 关于php验证的函数问题 - php报错https://developer.aliyun.com/ask/296930 ocs-ng和glpi想进行二次开发,可以联系我吗?? 400 报错https://developer.aliyun.com/ask/296891 Multiple Spring Data modules found, ente?400报错https://developer.aliyun.com/ask/298581 做项目是农民,做产品是艺术家 热:报错https://developer.aliyun.com/ask/302302 iis上怎么配置二级域名,类似于淘宝店铺的二级域名:报错https://developer.aliyun.com/ask/304799 geojson 遇到的诡异问题?报错https://developer.aliyun.com/ask/298135 Spring整合Struts在配置Struts过程中出现错误:Unable to?报错https://developer.aliyun.com/ask/301609 IDEA Jetty部署war包显示jar包找不到,实际war包中jar包存在?报错https://developer.aliyun.com/ask/298657 关于使用springframework.security的问题?报错https://developer.aliyun.com/ask/301880 mysql创建数据库的table时,如何加限定数量的插入?报错https://developer.aliyun.com/ask/298538 java批处理插入10w笔数据的问题:报错https://developer.aliyun.com/ask/300198 Magento安装了Multi Fees 前台不生效:报错https://developer.aliyun.com/ask/305384 已经安装了erlang20,安装rabbitmq还是报错?报错https://developer.aliyun.com/ask/298556 elasticsearch安装配置:报错https://developer.aliyun.com/ask/304603 weblogic部署报错,jpa+spring?报错https://developer.aliyun.com/ask/305499 Coevery 使用配置:配置报错 https://developer.aliyun.com/ask/295123 java项目跑不起来,CrmAdminMapper.xml出错,报错信息我是哪里?400报错https://developer.aliyun.com/ask/293694 各项配置已经配置好了还是有问题:报错https://developer.aliyun.com/ask/304653 出现Function 'printf' could not be resolved问题:报错https://developer.aliyun.com/ask/302540 PHP5.3不识别双引号的问题? 400 报错https://developer.aliyun.com/ask/294696 来晒晒配置吧:报错https://developer.aliyun.com/ask/297895 马上就要毕业了,现在心里真的有点迷茫,不知道该怎么选择?:报错https://developer.aliyun.com/ask/298430 关于iptables默认配置的说明 - 配置报错https://developer.aliyun.com/ask/296168 使用jax-rs调用resteasy服务使报错?报错https://developer.aliyun.com/ask/304344 redislive启动过程报错?报错https://developer.aliyun.com/ask/301807 kafka消费一段时间后,无法消费到数据,需要换一个groupId才可以?报错https://developer.aliyun.com/ask/300837 spring cloud bus配置rabbitmq的问题:报错https://developer.aliyun.com/ask/297894 make-kpkg日志在哪? 400 报错https://developer.aliyun.com/ask/296829 centos操作系统 ,opencv, java调用编译后的opencv动态链接库报错?报错https://developer.aliyun.com/ask/306338 activeMQ实现负载均衡加可靠性集群问题?报错https://developer.aliyun.com/ask/306304 js无法修改的style属性值?报错https://developer.aliyun.com/ask/303696 Python 使用rar命令压缩多个文件夹? 400 报错https://developer.aliyun.com/ask/294651 谁能帮我写一个sql,我写不出来。。:报错https://developer.aliyun.com/ask/303209 Ueditor配置问题:报错https://developer.aliyun.com/ask/304623 ccflow 你好,请教几个问题,关于节点删除.:报错 https://developer.aliyun.com/ask/297210 SpringMVC报错,看不懂,求解?报错https://developer.aliyun.com/ask/302482 spring aop 切日志的问题? 400 报错https://developer.aliyun.com/ask/294131 winfrom窗体的传值:报错https://developer.aliyun.com/ask/297945 spring的配置中有些配置没有id或者name属性,spring是如何注入的?:配置报错 https://developer.aliyun.com/ask/296331 Sysbench OLTP 性能测试: MySQL-5.6 vs. MariaDB-10.报错https://developer.aliyun.com/ask/302297 mysql创建数据库的table时,如何加限定数量的插入?报错https://developer.aliyun.com/ask/298542 弱弱的问一些关于网站链接支付宝时的问题?:报错https://developer.aliyun.com/ask/305225 python 模拟网页提交时候遇到下面这个怎么提交呢?? 400 报错https://developer.aliyun.com/ask/295708 hosts.allow规则无效:报错https://developer.aliyun.com/ask/299494 sfl4j 如何配置???:配置报错 https://developer.aliyun.com/ask/294878 springboot配置pom报错?报错https://developer.aliyun.com/ask/298930 Spring 启动时候报错?报错https://developer.aliyun.com/ask/302406 Php+ImageMagick+imagick API 配置指南:报错https://developer.aliyun.com/ask/298978 hibernate的实体类型问题? 400 报错https://developer.aliyun.com/ask/296938 socket.io与node.js通信问题? 400 报错https://developer.aliyun.com/ask/295769 java读取Txt文本问题:报错https://developer.aliyun.com/ask/300275 返回纯文本怎么办:报错https://developer.aliyun.com/ask/304844 Jenkins在做Android项目集成时的配置问题:配置报错 https://developer.aliyun.com/ask/296438 mongodb从库无法同步?报错https://developer.aliyun.com/ask/301736 将hbase表数据导入到hdfs上相关错误问题?报错https://developer.aliyun.com/ask/306021 socket传输问题? 400 报错https://developer.aliyun.com/ask/295555 【跪求结项挡路难题,大神施舍…】?报错https://developer.aliyun.com/ask/305819 模拟淘宝登陆验证码,下了您的代码,在我这运行有错误?报错https://developer.aliyun.com/ask/305715 [λ]你试过这样写C程序吗? 热:报错https://developer.aliyun.com/ask/303207 在vmware8下如何能让centOS5.5读取到U盘?:报错https://developer.aliyun.com/ask/298826 python post提交到服务器登陆,使用json数据,为什么不成功呢?? 400 报错https://developer.aliyun.com/ask/297403 Android手机如何设计一款类似于系统自带的“蓝牙设置”界面的App?:报错https://developer.aliyun.com/ask/298344 coreseek 安装出错 求解? 400 报错https://developer.aliyun.com/ask/296055 货邮数据通过接口传输到离港系统:报错https://developer.aliyun.com/ask/298001 JFinal 主键重复报错?报错https://developer.aliyun.com/ask/305891 sphinx配置sql_attr_multi:报错https://developer.aliyun.com/ask/297937 ###Nginx Udp代理配置问题### - 配置报错https://developer.aliyun.com/ask/296231 nginx expires 无效:配置报错 https://developer.aliyun.com/ask/296330 三星s5830i关于*##2664##*造成触摸屏失灵问题:配置报错 https://developer.aliyun.com/ask/296316 jfinal 主键更新问题?报错https://developer.aliyun.com/ask/306328 Druid监控页面404?报错https://developer.aliyun.com/ask/298196 Spring配置数据源有问题,请教。。。。? 400 报错https://developer.aliyun.com/ask/302195 jfinal中freemarker 为何能 ${user.name}? 400 报错https://developer.aliyun.com/ask/293929 写博文如何让代码可以快速复制?:报错https://developer.aliyun.com/ask/303346 HP-Socket加入到VC6.0工程后的问题?报错https://developer.aliyun.com/ask/305484 dcm4che 转JPG图片遇到问题?报错https://developer.aliyun.com/ask/299791 JFinal中有关 Model 自定义属性的问题?报错https://developer.aliyun.com/ask/306657 lua中,重写for循环迭代器的不解之处。?报错https://developer.aliyun.com/ask/301672 请问我想让setTimeout每四秒读取一次数据库,好做到实时无刷新更新,为什么不管用还报错?报错https://developer.aliyun.com/ask/300847 java 这样的正则表达式怎么写:报错https://developer.aliyun.com/ask/303332 mysql导入数据出错?报错https://developer.aliyun.com/ask/304005 Jfinal与jetty作为基础开发,运行在安装的tomcat中报错【不是jar?报错https://developer.aliyun.com/ask/305845 ssm+shiro 报错?报错https://developer.aliyun.com/ask/301392 "hudson 怎么配置就可以和svn同步了? :报错https://developer.aliyun.com/ask/305137" Gradle构建GroovyAndroid错误?报错https://developer.aliyun.com/ask/304365 jboot定时器中如何配置concurrent属性? - jboot报错https://developer.aliyun.com/ask/295790 Gradle用JUnit测试Spring框架的项目报错?报错https://developer.aliyun.com/ask/303585 SSH框架sqlServer数据库更换为oracle数据库问题?报错https://developer.aliyun.com/ask/298485 麻烦大家帮我看一下这个电脑配置怎么样:报错https://developer.aliyun.com/ask/297927 Android中如何解析json数据:报错https://developer.aliyun.com/ask/299680 Debian安装 Sphinx 支持中文检索 : 配置报错 https://developer.aliyun.com/ask/295651 PHP框架queryphp教程配置-配置报错https://developer.aliyun.com/ask/296225 MAVEN项目用eclipse启动没有问题正常运行,部署到服务器上出现下面的错误?报错https://developer.aliyun.com/ask/300520 日期格式化的问题set进对象报错?报错https://developer.aliyun.com/ask/300586 通过框架用Java代码,在jsp页面中把数据库中的数据:报错https://developer.aliyun.com/ask/303306 关于hadoop的一点看法 - 报错https://developer.aliyun.com/ask/300232 c3p0连接oracle的问题?报错https://developer.aliyun.com/ask/301902 jquery mobile ajax 请求,弹出提示框? 400 报错https://developer.aliyun.com/ask/296012 Cloud Foundry cf工具安装问题:报错https://developer.aliyun.com/ask/305172 更新了cordova 版本,执行cordova platform add and?报错https://developer.aliyun.com/ask/301750 springboot多数据源配置,我配置三个还好好的,配置4个后有一个就不工作了 - 配置报错https://developer.aliyun.com/ask/295095 springmvc 使用jackson转换 hibernate lazyload?报错https://developer.aliyun.com/ask/306056 Mopaas V2部署项目失败,项目在Mopaas V1下是可以部署成功的?报错https://developer.aliyun.com/ask/303482 eclipse中jsp页面的使用?报错https://developer.aliyun.com/ask/303472 springmvc(3.2)+hibernate(4.2)整合,报错:No Se?报错https://developer.aliyun.com/ask/306604 Nginx在64位CentOS下gzip无效 : 配置报错 https://developer.aliyun.com/ask/295685 andoird 5.0以上真机调试报错。?报错https://developer.aliyun.com/ask/302403 POST方式向服务器提交数据报错?报错https://developer.aliyun.com/ask/301115 vtiger6.0 汉化bug集:报错https://developer.aliyun.com/ask/298204 layout 布局调用的页面combobox选择失效?报错https://developer.aliyun.com/ask/305385 老问题:ajax请求跨域? 400 报错https://developer.aliyun.com/ask/294975 一个页面载加多个window.onload这种需求有法写吗:报错https://developer.aliyun.com/ask/304963 导出表数据select * from 表 into outfile 在同一个位置?400报错https://developer.aliyun.com/ask/300962 使用父类(没有表)继承model,然后使用子类去继承父类,在启动时自动注册表出错? 400 报错https://developer.aliyun.com/ask/296945 无法修订提醒邮箱 : 配置报错 https://developer.aliyun.com/ask/296608 我的mysql数据库不见了:报错 https://developer.aliyun.com/ask/297147 如何在Android上编写rocketMq的消费者??报错https://developer.aliyun.com/ask/300260 jFinal里 怎么处理跨域请求?? 400 报错https://developer.aliyun.com/ask/296892 HttpUtils 上传图片 返回500?报错https://developer.aliyun.com/ask/303029 sql like 后面怎么通配 不可见字符?:报错https://developer.aliyun.com/ask/303203 Jfinal-weixin renderJsp()报错?报错https://developer.aliyun.com/ask/303004 Java如何绕开协议读取邮件?:报错https://developer.aliyun.com/ask/298871 Spring Error creating bean,项目是好项目,但就是报错。?报错https://developer.aliyun.com/ask/302253 java项目还是跑不起来?不过报错有点变化,求大神帮忙?报错https://developer.aliyun.com/ask/300933 ES6中let报错,这是个大坑,大家怎么看待??报错https://developer.aliyun.com/ask/297553 大家帮我看看这个php网页有问题吗?为什么浏览器直接显示代码?报错https://developer.aliyun.com/ask/303419 netty的一个引用计数器释放的问题, 报异常?报错https://developer.aliyun.com/ask/303736 Servlet的url匹配问题?报错https://developer.aliyun.com/ask/302712 小弟刚学习python安装了pycharm遇到了如下问题,麻烦大神提点?报错https://developer.aliyun.com/ask/301092 mysql5.6.26版本的配置问题 - mysql报错https://developer.aliyun.com/ask/295549 关于使用oracle连接报错的问题?报错https://developer.aliyun.com/ask/304258 JSP页面好像引入不了js,css文件,需要设置什么吗?:报错https://developer.aliyun.com/ask/305089 一个库里有一个表无法selet:报错https://developer.aliyun.com/ask/301482 在哪个位置配置:配置报错 https://developer.aliyun.com/ask/294742 activemq重启时,Consumer进程必须重新加载才能收到消息?报错https://developer.aliyun.com/ask/303843 excel宏运行报错?报错https://developer.aliyun.com/ask/301726 android系统九宫格密码:报错 https://developer.aliyun.com/ask/297118 第七章 – 自定义Magento系统配置:配置报错 https://developer.aliyun.com/ask/294770 mac下sourcetree克隆git@OSC的项目一直提示“这是一个无效的源路径/URL”报错https://developer.aliyun.com/ask/297812 "关于JNI调用opencv的问题 :报错https://developer.aliyun.com/ask/306456" 关于密码盐值的存放地点报错 https://developer.aliyun.com/ask/295497 eclipse ADT new android项目的时候 ,为什么项目名是中文的?报错https://developer.aliyun.com/ask/302082 python commands 执行shell 传递的文件不完整:报错https://developer.aliyun.com/ask/299619 高手在哪里呀,高手在哪里!! 项目mac迁移到win8系统下启动报错?报错https://developer.aliyun.com/ask/305863 java.lang.IllegalArgumentException: Inva?400报错https://developer.aliyun.com/ask/300040 jackson延迟加载的对象如何处理??报错https://developer.aliyun.com/ask/306146 redis集群重启后,获取重启前持久化存储内容失败? 400 报错https://developer.aliyun.com/ask/293836 spring cloud config client 如何加载多个配置文件?:报错https://developer.aliyun.com/ask/299749 ActiveMQ链接失败,导致tomcat启动失败?报错https://developer.aliyun.com/ask/302614 有大量的js脚本需要通过java输出,但是里面的正则头痛:报错https://developer.aliyun.com/ask/304988 如何停止一个异步线程 - 服务报错https://developer.aliyun.com/ask/295252 iis上配置二级域名 - 配置报错https://developer.aliyun.com/ask/295148 spring配置mysql数据库的问题?报错https://developer.aliyun.com/ask/301793 git客户端如何记住用户名与密码呢,使用git出问题- git报错https://developer.aliyun.com/ask/296850 页面使用el表达式报错?报错https://developer.aliyun.com/ask/302938 windows+apache+mysql+php 高并发和apache异常关闭:报错https://developer.aliyun.com/ask/305015 springmvc整合shiro 会话管理时候报错?报错https://developer.aliyun.com/ask/302642 jfinal2.2加入jfina-weixin(1.9)冲突如何解决?报错https://developer.aliyun.com/ask/303183 java mybatie问题,再传map参数里面是list的时候,总是报传进去的参数为空:配置报错 https://developer.aliyun.com/ask/296290 关于python2.7和3.6 语法?报错https://developer.aliyun.com/ask/301771 vue元素赋值无效 : 配置报错https://developer.aliyun.com/ask/295970 lucene 4.2 入门的 简单 问题, 求大神们帮忙解决下吧:报错https://developer.aliyun.com/ask/299411 spring Security 中权限变更时该怎么做:配置报错 https://developer.aliyun.com/ask/296332 HttpKit 请求超时? 400 报错https://developer.aliyun.com/ask/297375 求大神们帮忙!关于xml内嵌php代码解析的问题:报错https://developer.aliyun.com/ask/300331 新建一个服务器,android客户端通过服务器和SQL Server 2005交互,:报错https://developer.aliyun.com/ask/297996 EF数据迁移报错,执行Enable-Migrations 命令出现异常?报错https://developer.aliyun.com/ask/306701 标签体外怎么获取标签变量?报错https://developer.aliyun.com/ask/305852 网站安全如何防范:报错https://developer.aliyun.com/ask/297810 我想用手头的解码器写一个专门的播放器该如何下手:报错https://developer.aliyun.com/ask/304912 新手提问 - Node.js安装express报错怎么破??报错https://developer.aliyun.com/ask/306653 maven无法获取远程仓库jar:配置报错 https://developer.aliyun.com/ask/294734 js修改class属性相关问题:报错 https://developer.aliyun.com/ask/301264 run没问题,打成apk时报错,怎么解决?报错https://developer.aliyun.com/ask/305419 请求后台数据报错?报错https://developer.aliyun.com/ask/299768 cxf 拦截器 ?报错https://developer.aliyun.com/ask/300308 如何定位Android NDK开发中遇到的错误?报错https://developer.aliyun.com/ask/306135 tomcat 与ServerSocket一起工作卡死?报错https://developer.aliyun.com/ask/301571 用easyui怎么实现其datagird导出到Excel?? 400 报错https://developer.aliyun.com/ask/295840 下面这样的写法都是啥意思啊??报错https://developer.aliyun.com/ask/300935 wget无法下载github上的软件?报错https://developer.aliyun.com/ask/306380 深入理解Magento - 第一章 - Magento强大的配置系统 - 配置报错https://developer.aliyun.com/ask/296787 使用union查询结果,返回的ActiveDataProvider分页无效 - 服务报错https://developer.aliyun.com/ask/295162 Jfinal中, 是自动关闭Connection的吗?报错https://developer.aliyun.com/ask/303593 JFinal redis报错?报错https://developer.aliyun.com/ask/303465 读硬盘会很慢吗?:报错https://developer.aliyun.com/ask/299649 波总,我有来了?报错https://developer.aliyun.com/ask/301112 wamp2.4配置虚拟目录:配置报错https://developer.aliyun.com/ask/296295 为什么往dialog里setView ,里面的View设置监听器无效:报错https://developer.aliyun.com/ask/305957 Integer.parseInt?报错https://developer.aliyun.com/ask/301816 模拟登录QQ空间求助~:报错https://developer.aliyun.com/ask/298428 mysql ROW同步问题?报错https://developer.aliyun.com/ask/306151 @Url.Content("")中怎样添加变量?? 400 报错https://developer.aliyun.com/ask/296050 mybatis查询时传递对象问题,始终报类型错误,求哪位前辈进来看看?报错https://developer.aliyun.com/ask/302630 springmvc消息进行全局加密和解密? 400 报错https://developer.aliyun.com/ask/297432 EditPlus 3.x 配置PHP开发环境:报错https://developer.aliyun.com/ask/304616 Could not get JDBC Connection?报错https://developer.aliyun.com/ask/301448 java的sql复制在数据库里能执行,但是运行还是报错啊?报错https://developer.aliyun.com/ask/298904 CMake 和 OopenCV配置问题:报错https://developer.aliyun.com/ask/305991 ONES 安装插件报错!?报错https://developer.aliyun.com/ask/306187 jpa 操作无主键的数据库?报错https://developer.aliyun.com/ask/298733 SpringBoot @EnableAutoConfiguration注解报错?报错https://developer.aliyun.com/ask/298161 求助 solr 分批索引:报错https://developer.aliyun.com/ask/299664 这种sql出来的数据为啥不对 以及mysql中的数据表示式如何写:报错https://developer.aliyun.com/ask/302392 为什么延迟加载的对象中的Mapping注解无效?:报错https://developer.aliyun.com/ask/297818 Tengine健康检测怎么检测后端https服务器啊:报错https://developer.aliyun.com/ask/305181 Direct2D绘图的问题,DrawBitmap:报错https://developer.aliyun.com/ask/301465 请教一下JAVA开发的WEB系统,JAVA 文件改动后, 是否需要重新启动WEB服务器:报错https://developer.aliyun.com/ask/304985 struts2 action中成员变量的生存周期? 400 报错https://developer.aliyun.com/ask/297414 query autocomplete请求回来的时候是render Josn数据格?400报错https://developer.aliyun.com/ask/295629 发现一个jstl的问题 :报错https://developer.aliyun.com/ask/297838 微信支付,测试官方demo 一直是无效签名 - 服务报错https://developer.aliyun.com/ask/295796 Uploadify上传视频文件出错? 400 报错https://developer.aliyun.com/ask/296726 jboot开发,更改html页面时,如何做到不重新部署就能看到修改效果:报错https://developer.aliyun.com/ask/298297 iOS开发中,遇到这样的报错 Conflicting types for ali?报错https://developer.aliyun.com/ask/304117 正常软件开发流程是什么样的? - 服务报错https://developer.aliyun.com/ask/295932 vue post请求?报错https://developer.aliyun.com/ask/300407 linux中编写自定义的python模块?报错https://developer.aliyun.com/ask/300997 flume 1.6.0 源码编译? 400 报错https://developer.aliyun.com/ask/293901 php 静态方法调用问题?报错https://developer.aliyun.com/ask/301630 "apache的Redirect不起作用 :报错https://developer.aliyun.com/ask/299058"
高级接口的使用
高级接口中的所有方法均为阻塞操作,在操作没有完成之前不会返回。所有接口都可能会抛出两种异常,分别为
OASServerError和
OASClientError,具体描述请参阅Exceptions一节。
高级接口使用Python内置模块logging输出日志,用户可根据实际需要自由配置日志输出,以下例子是输出INFO级别日志到标准输出的简单配置。
import loggingimport syshandler = logging.StreamHandler(sys.stdout)handler.setFormatter(logging.Formatter('%(asctime)s %(message)s'))handler.setLevel(logging.INFO)log = logging.getLogger('oas.ease.uploader')log.addHandler(handler)log.setLevel(logging.INFO)
Vault
类
Vault是用户所有操作的入口点。要实例化
Vault对象,需要通过
Vault的类方法,其中[backcolor=transparent]create_vault、[backcolor=transparent]get_vault_by_id和[backcolor=transparent]get_vault_by_name是简单工厂方法,返回
Vault对象,[backcolor=transparent]list_all_vaults返回
Vault list。这些类方法都需要以
OASAPI对象作为参数(参见低级接口概述部分)。
对于上传操作,可以直接调用成员方法[backcolor=transparent]upload_archive,接口内部会根据文件大小自动选择Normal Upload或Multipart Upload方式,并实现了多线程并行上传和失败重试。对于Multipart Upload任务,用户也可调用成员方法[backcolor=transparent]initiate_uploader获得
Uploader对象再进行上传(参见Uploader一节)。使用后一种方法,用户可获得时机保存Multipart Upload的任务ID,若任务没有成功完成,可在之后调用成员方法[backcolor=transparent]recover_uploader传入任务ID进行续传。用户应根据业务需要选择合适的方法。
对于下载操作,可调用成员方法[backcolor=transparent]retrieve_inventory或[backcolor=transparent]retrieve_archive获得
Job对象再进行下载(参见Job一节)。
下面按照功能分组,介绍
Vault的接口。
成员变量
Vault对象包含了Vault的JSON描述中的所有字段,其中JSON标签与变量之间的转换关系如下表所示,各个字段的具体含义请参考API文档4.1.3一节的返回体部分。
JSON标签变量名类型CreationDatecreation_datestringLastInventoryDatelast_inventory_datestringNumberOfArchivesnumber_of_archivesintSizeInBytessizeintVaultIdidstringVaultNamenamestring
构造方法
类
Vault包含了三个简单工厂方法用于构造
Vault对象,三个类方法均需
OASAPI对象作为参数,
OASAPI的构造请参阅低级接口的概述部分。
create_vault
类方法。新建指定名称的Vault。
定义
[backcolor=transparent]
def create_vault(cls, api, name)
参数
[backcolor=transparent]api:OASAPI[backcolor=transparent]name:string待新建的Vault的名称,名称应遵守API手册4.1.1节中Vault命名规范。
返回值
[backcolor=transparent]
Vault
get_vault_by_id
类方法。获取指定ID的Vault。
定义
[backcolor=transparent]
def get_vault_by_id(cls, api, vault_id)
参数
[backcolor=transparent]api:OASAPI[backcolor=transparent]vault_id:string待检索的Vault的ID。
返回值
[backcolor=transparent]
Vault
get_vault_by_name
类方法。获取指定名称的Vault。
定义
[backcolor=transparent]
def get_vault_by_name(cls, api, vault_name)
参数
[backcolor=transparent]api:OASAPI[backcolor=transparent]vault_name:string待检索的Vault的名称。
返回值
[backcolor=transparent]
Vault
Vault删除
delete_vault_by_id
类方法。删除指定ID的Vault。
定义
[backcolor=transparent]
def delete_vault_by_id(cls, api, vault_id)
参数
[backcolor=transparent]api:OASAPI[backcolor=transparent]vault_id:string待删除的Vault的ID。
返回值
[backcolor=transparent]
None
delete_vault_by_name
类方法。删除指定名称的Vault。
定义
[backcolor=transparent]
def delete_vault_by_name(cls, api, vault_name)
参数
[backcolor=transparent]api:OASAPI[backcolor=transparent]vault_name:string待删除的Vault的名称。
返回值
[backcolor=transparent]
None
delete
删除当前Vault。
定义
[backcolor=transparent]
def delete(self)
参数
[backcolor=transparent]
None
返回值
[backcolor=transparent]
None
状态查询
所有查询方法默认返回全部的检索结果,用户不需要对Marker标识进行处理。
list_all_vaults
类方法。返回用户持有的所有Vault。
定义
[backcolor=transparent]
def list_all_vaults(cls, api)
参数
[backcolor=transparent]api:OASAPI
返回值
[backcolor=transparent]
Vault list
list_all_multipart_uploads
返回Vault下的全部Multipart Upload任务。
定义
[backcolor=transparent]
def list_all_multipart_uploads(self)
参数
[backcolor=transparent]
None
返回值
[backcolor=transparent]
Uploader list
list_all_jobs
返回Vault下的所有Job任务。
定义
[backcolor=transparent]
def list_all_jobs(self)
参数
[backcolor=transparent]
None
返回值
[backcolor=transparent]
Job list
Archive操作
upload_archive
上传指定文件到当前Valut,成功上传后返回相应的Archive ID。
定义
[backcolor=transparent]
def upload_archive(self, file_path, desc=None)
参数
[backcolor=transparent]file_path:string待上传的文件路径。[backcolor=transparent]desc:string可选参数。Archive的描述字段。
返回值
[backcolor=transparent]
string:Archive ID
initiate_uploader
新建Multipart Upload任务。
定义
[backcolor=transparent]
def initiate_uploader(self, file_path, desc=None)
参数
[backcolor=transparent]file_path:string待上传的文件路径。[backcolor=transparent]desc:string可选参数。Archive的描述字段。
返回值
[backcolor=transparent]
Uploader
recover_uploader
续传指定的Multipart Upload任务。
定义
[backcolor=transparent]
def recover_uploader(self, upload_id)
参数
[backcolor=transparent]upload_id:stringMultipart Upload任务的ID。
返回值
[backcolor=transparent]
Uploader
delete_archive
删除指定ID的Archive。
定义
[backcolor=transparent]
def delete_archive(self, archive_id)
参数
[backcolor=transparent]archive_id:string待删除的Archive的ID。
返回值
[backcolor=transparent]
None
Job操作
get_job
获取指定ID的Job任务。
定义
[backcolor=transparent]
def get_job(self, job_id)
参数
[backcolor=transparent]job_id:stringJob任务的ID。
返回值
[backcolor=transparent]
Job
retrieve_archive
新建类型为[backcolor=transparent]archive-retrieval的Job任务。
定义
[backcolor=transparent]
def retrieve_archive(self, archive_id, desc=None, byte_range=None):
参数
[backcolor=transparent]archive_id:string待查询的Archive的ID。[backcolor=transparent]desc:string可选参数。Job任务的描述字段。[backcolor=transparent]byte_range:tuple可选参数。长度为2,元素分别为字节长度的起点和终点(含)。
返回值
[backcolor=transparent]
Job
retrieve_inventory
新建类型为[backcolor=transparent]inventory-retrieval的Job任务。
定义
[backcolor=transparent]
def retrieve_inventory(self, desc=None)
参数
[backcolor=transparent]desc:string可选参数。Job任务的描述字段。
返回值
[backcolor=transparent]
Job
pull_from_oss
新建类型为[backcolor=transparent]pull-from-oss的Job任务。
定义
[backcolor=transparent]
def pull_from_oss(self, osshost, bucket, object, desc=None)
参数
[backcolor=transparent]osshost:stringjob的源oss域名[backcolor=transparent]bucket:stringjob任务的oss Bucket[backcolor=transparent]object:stringjob任务的oss Object[backcolor=transparent]desc:string可选参数。Job任务的描述字段。
返回值
[backcolor=transparent]
Job
push_to_oss
新建类型为[backcolor=transparent]push-to-oss的Job任务。
定义
[backcolor=transparent]
def push_to_oss(self, archive_id, osshost, bucket, object, desc=None)
参数
[backcolor=transparent]archive_id:string
待转储的archive_id
[backcolor=transparent]osshost:stringjob的源oss域名[backcolor=transparent]bucket:stringjob任务的oss Bucket[backcolor=transparent]object:stringjob任务的oss Object[backcolor=transparent]desc:string可选参数。Job任务的描述字段。
返回值
[backcolor=transparent]
Job
Uploader
Uploader是Multipart Upload任务的抽象。
要获取
Uploader对象,可通过
Vault的三个成员方法,包括:
[backcolor=transparent]initiate_uploader[backcolor=transparent]recover_uploader[backcolor=transparent]list_all_multipart_uploads
其中,[backcolor=transparent]initiate_uploader、[backcolor=transparent]recover_uploader返回
Uploader对象。
[backcolor=transparent]list_all_multipart_uploads返回
Uploader list。
[backcolor=transparent]initiate_uploader用于新建Multipart Upload任务,可直接调用
Uploader的成员方法[backcolor=transparent]start开始上传。
[backcolor=transparent]recover_uploader和[backcolor=transparent]list_all_multipart_uploads返回的Uploader用于续传Multipart Upload任务,应调用
Uploader的成员方法[backcolor=transparent]resume继续上传。
成员变量
Uploader对象包含了Multipart Upload的JSON描述中的所有字段,其中JSON标签与变量之间的转换关系如下表所示,各个字段的具体含义请参考API文档4.3.5一节的返回体部分。
JSON标签变量名类型ArchiveDescriptiondescriptionstringCreationDatecreation_datestringMultipartUploadIdidstringPartSizeInBytespart_sizeint
Property
[backcolor=transparent]size_completed已上传的字节数。
成员方法
start
开始上传任务。
定义
[backcolor=transparent]
def start(self)
参数
[backcolor=transparent]
None
返回值
[backcolor=transparent]
String:Archive ID
resume
恢复上传任务。
定义
[backcolor=transparent]
def resume(self, file_path)
参数
[backcolor=transparent]file_path:string待上传的文件路径。
返回值
[backcolor=transparent]
String:Archive ID
cancel
取消上传任务。
定义
[backcolor=transparent]
def cancel(self)
参数
[backcolor=transparent]
None
返回值
[backcolor=transparent]
None
Job
Job是Job任务的抽象。根据下载文件的大小,
Job内部会自动进行分块并行下载,并实现了断点续传和简单的出错重试。
在使用时,用户需要注意Job任务并不是实时完成的(参见
《OAS API文档-1.1.6节》),用户应调用
Job的成员方法[backcolor=transparent]update_status更新任务状态,并通过检查成员变量completed确认任务是否完成。当任务完成时,可通过调用[backcolor=transparent]download_to_file或[backcolor=transparent]download_by_range开始下载。用户也可直接设置[backcolor=transparent]download_to_file和[backcolor=transparent]download_by_range方法的block参数,当block为True时,接口内部会循环等待至Job完成再开始下载,用户不需调用手工更新任务状态。
对于未完成的下载任务,
Job内部会自动创建一个进度存储文件,该进度文件路径为用户指定的文件保存路径加上.oas后缀。若用户希望重新下载整个文件,不进行续传,可以手动删除该进度文件,否则应保留该文件,当任务完成时,该文件会自动删除。
成员变量
Job对象包含了Job的JSON描述中的所有字段,其中JSON标签与变量之间的转换关系如下表所示,各个字段的具体含义请参考API文档4.4.4一节的返回体部分。
JSON标签变量名类型ActionactionstringArchiveContentEtagetagstringArchiveIdarchive_idstringArchiveSizeInBytesarchive_sizeintCompletedcompletedbooleanCompletionDatecompletion_datestringCreationDatecreation_datestringInventorySizeInBytesinventory_sizeintJobDescriptiondescriptionstringJobIdidstringStatusCodestatus_codestringStatusMessagestatus_messagestring
Property
[backcolor=transparent]size_completed已下载的字节数
成员方法
update_status
更新Job的任务状态。
定义
[backcolor=transparent]
def update_status(self)
参数
[backcolor=transparent]
None
返回值
[backcolor=transparent]
None
download_by_range
下载指定字节范围到文件。
定义
[backcolor=transparent]
def download_by_range(self, byte_range, file_path=None, file_obj=None, chunk_size=None, block=True)
参数
[backcolor=transparent]byte_range:tuple长度为2,两个元素分别为字节长度的起点和终点(含)。[backcolor=transparent]file_path:string[backcolor=transparent]file_obj:file object二选一参数,下载到指定的文件路径或保存到指定的文件对象。当两个参数均提供时,结果不确定。[backcolor=transparent]chunk_size:int可选参数。每次读写的块大小,默认为1048576(1MB)。[backcolor=transparent]block:boolean可选参数。当block为False时,直接开始下载,若Job未完成会抛出异常。当block为True时,循环等待至Job完成,再开始下载。默认为True。
download_to_file
下载Job任务输出到指定文件路径。
定义
[backcolor=transparent]
def download_to_file(self, file_path, chunk_size=None, block=True)
参数
[backcolor=transparent]file_path:string文件保存的路径。[backcolor=transparent]chunk_size:int可选参数。每次读写的块大小,默认为1048576(1MB)。[backcolor=transparent]block:int可选参数。当block为False时,直接开始下载,若Job未完成会抛出异常。当block为True时,循环等待至Job完成,再开始下载。默认为True。
说明
Response
OASResponse是
HttpResponse的简单抽象。
OASResponse是字典对象,
HttpResponse中的头部信息以键值对的形式存储在
OASResponse中。对于类型为JSON的响应,
OASResponse会自动解析JSON数据并保存为字典。对于类型为二进制流的响应,可通过成员方法read读取返回体中的数据。
Exceptions
根据出错原因的不同,SDK把异常分为两种不同类型,分别为
OAServerError,和
OASClientError。
OASServerError
OASServerError是指一次完整的HTTP请求中,服务器返回了错误响应。各个成员变量的含义见下表。具体错误信息请参阅API文档第5节错误响应。
成员变量类型含义headersdictHTTP响应中的头部,以键值对存储,所有键均为小写request_idstring出错的请求的ID值,见API文档2.3.3节statusintHTTP状态码codestring错误代码,见API文档2.3.3节typestring错误类型,见API文档2.3.3节messagestring错误信息,见API文档2.3.3节
OASClientErrror
OASClientError表示客户端异常,可能原因包括网络连接出错、文件读写出错等,具体出错原因可通过查看成员变量message获得。异常仅作为标记错误类型,没有实现额外的方法。此外,
UploadArchiveError、
DownloadArchiveError和
HashDoesNotMatchError均继承于
OASClientError,作为更细一级的异常分类,分别代表上传出错、下载出错和校验出错。
Utils
utils中包含的是高级接口所使用的公共工具方法,用户在开发时可直接使用这些方法。
文件操作
is_file_like
判断指定对象是否支持read操作。
定义
[backcolor=transparent]
def is_file_like(obj)
参数
[backcolor=transparent]obj:object
返回值
[backcolor=transparent]
boolean
content_length
根据输入类型的不同,自动获取目标的长度。对于无法处理的类型,抛出
ValueError异常。
定义
[backcolor=transparent]
def content_length(content)
参数
[backcolor=transparent]content
返回值
[backcolor=transparent]
int
open_file
当提供file_obj参数时,返回file_obj;否则以mode默认打开file_path。
定义
[backcolor=transparent]
def open_file(file_path=None, file_obj=None, mode='r')
参数
[backcolor=transparent]file_path:string[backcolor=transparent]file_obj:file object[backcolor=transparent]mode:string可选参数。打开模式,默认为'rb'。
返回值
[backcolor=transparent]
file object
Range操作
range_size
计算指定字节范围的长度。
定义
[backcolor=transparent]
def range_size(byte_range)
参数
[backcolor=transparent]byte_range:tuple长度为2,元素分别为字节长度的起点和终点(含)。
返回值
[backcolor=transparent]
int
calc_num_part
计算长度为size_total的文件,以part_size长度进行分块的总分块数。
定义
[backcolor=transparent]
def calc_num_part(part_size, size_total)
参数
[backcolor=transparent]part_size:intPart的字节长度。[backcolor=transparent]size_total:int文件总字节长度。
返回值
[backcolor=transparent]
int
calc_ranges
计算长度为size_total的文件,以part_size长度进行分块的所有分块字节范围。
定义
[backcolor=transparent]
def calc_ranges(part_size, size_total)
参数
[backcolor=transparent]part_size:intPart的字节长度。[backcolor=transparent]size_total:int文件总字节长度。
返回值
[backcolor=transparent]
tuple list:每个元组长度为2,分别为分块的字节起点和终点(含)。
校验码计算
校验码是归档存储用于判断archive完整性的手段,etag与tree-etag是校验码的两种方式。本节中compute_etag_from_string、compute_etag_from_file、compute_etag_from_file、compute_etag_from_file_obj三个函数中的任何一个函数可以用来计算etag校验码,、compute_tree_etag_from_file、compute_tree_etag_from_file_obj、compute_combine_tree_etag_from_list几个函数都是用来计算tree-etag校验码的。
compute_hash_from_file、compute_hash_from_file_obj可以同时计算出etag、tree-etag两个校验码,并通过数组返回。
compute_etag_from_string
计算指定字符串的etag。
定义
[backcolor=transparent]
def compute_etag_from_string(content)
参数
[backcolor=transparent]content:string待计算的字符串。
返回值
[backcolor=transparent]
string
说明
compute_etag_from_file
计算指定文件的etag。
定义
[backcolor=transparent]
def compute_etag_from_file(file_path, offset=0, size=None, chunk_size=1048576)
参数
[backcolor=transparent]file_path:string待计算的文件路径。[backcolor=transparent]offset:int可选参数。计算的字节起始点(含),默认为0。[backcolor=transparent]size:int可选参数。待计算的字节长度,默认为offset起的所有字节的长度。[backcolor=transparent]chunk_size:int可选参数。每次读取的块大小,默认为1048576(1MB)。
返回值
[backcolor=transparent]
string
compute_etag_from_file_obj
计算指定文件对象的etag。
定义
[backcolor=transparent]
def compute_etag_from_file_obj(file_obj, offset=0, size=None, chunk_size=1048576)
参数
[backcolor=transparent]file_obj:file object待计算的文件对象。[backcolor=transparent]offset:int可选参数。计算的字节起始点(含),默认为0。[backcolor=transparent]size:int可选参数。待计算的字节长度,默认为offset起的所有字节的长度。[backcolor=transparent]chunk_size:int可选参数。每次读取的块大小,默认为1048576(1MB)。
返回值
[backcolor=transparent]
string
compute_tree_etag_from_file
计算指定文件的tree-etag校验码。
定义
[backcolor=transparent]
def compute_tree_etag_from_file(file_path, offset=0, size=None, chunk_size=1048576)
参数
[backcolor=transparent]file_path:string待计算的文件路径。[backcolor=transparent]offset:int可选参数。计算的字节起始点(含),默认为0。[backcolor=transparent]size:int可选参数。待计算的字节长度,默认为offset起的所有字节的长度。[backcolor=transparent]chunk_size:int可选参数。每次读取的块大小,默认为1048576(1MB)。
返回值
[backcolor=transparent]
string
compute_tree_etag_from_file_obj
计算指定文件对象的tree-etag。
定义
[backcolor=transparent]
def compute_tree_etag_from_file_obj(file_obj, offset=0, size=None, chunk_size=1048576)
参数
[backcolor=transparent]file_obj:file object待计算的文件对象。[backcolor=transparent]offset:int可选参数。计算的字节起始点(含),默认为0。[backcolor=transparent]size:int可选参数。待计算的字节长度,默认为offset起的所有字节的长度。[backcolor=transparent]chunk_size:int可选参数。每次读取的块大小,默认为1048576(1MB)。
返回值
[backcolor=transparent]
string
compute_combine_tree_etag_from_list
根据各个分块的tree-etag所组成的list,计算整个文件的校验码。
定义
[backcolor=transparent]
def compute_combine_tree_etag_from_list(tree_etag_list)
参数
[backcolor=transparent]tree_etag_list:list列表元素为每个分块的tree-etag。
返回值
[backcolor=transparent]
string
compute_hash_from_file
计算指定文件的etag及tree-etag校验码。
定义
[backcolor=transparent]
def compute_hash_from_file(file_path, offset=0, size=None, chunk_size=1048576)
参数
[backcolor=transparent]file_path:string待计算的文件路径。[backcolor=transparent]offset:int可选参数。计算的字节起始点(含),默认为0。[backcolor=transparent]size:int可选参数。待计算的字节长度,默认为offset起的所有字节的长度。[backcolor=transparent]chunk_size:int可选参数。每次读取的块大小,默认为1048576(1MB)。
返回值
[backcolor=transparent]
(string,string)
返回的是两个校验码数组:(etag,tree-etag)
compute_hash_from_file_obj
计算指定文件对象的etag及tree-etag校验码。
定义
[backcolor=transparent]
def compute_hash_from_file_obj(file_obj, offset=0, size=None, chunk_size=1048576)
参数
[backcolor=transparent]file_obj:file object待计算的文件对象。[backcolor=transparent]offset:int可选参数。计算的字节起始点(含),默认为0。[backcolor=transparent]size:int可选参数。待计算的字节长度,默认为offset起的所有字节的长度。[backcolor=transparent]chunk_size:int可选参数。每次读取的块大小,默认为1048576(1MB)。
返回值
[backcolor=transparent]
(string, string)
返回的是两个校验码数组:(etag,tree-etag)
问答
存储 · JSON · API · 开发工具 · 对象存储 · 数据格式 · Python
2017-10-26