0x00 產(chǎn)品定位
目前越來(lái)越多的初創(chuàng)企業(yè)把自己的業(yè)務(wù)系統(tǒng)架設(shè)在公有云上,包含:阿里云、Ucloud、青云、華為云和AWS。在云上的安全怎么保證,是目前擺在我們面前的最大問(wèn)題,因?yàn)?,互?lián)網(wǎng)公司業(yè)務(wù)系統(tǒng)在不斷迭代,迭代周期最少的有3天,而且架構(gòu)也不斷在改變。在這種頻繁改變的過(guò)程中,云安全應(yīng)該怎么保證?,云主機(jī)安全服務(wù)平臺(tái)(Cloud security as a service),為多租戶提供云主機(jī)安全服務(wù)的產(chǎn)品,減少用戶業(yè)務(wù)系統(tǒng)攻擊面,防止惡意的定向攻擊(APT)。造成企業(yè)敏感信息泄露等,避免影響企業(yè)業(yè)務(wù)的安全事件的發(fā)生。
0x01 國(guó)外競(jìng)爭(zhēng)產(chǎn)品分析
目前在云主機(jī)安全ToB的國(guó)外廠商歸納總結(jié)有以下幾家:
技術(shù)方向 | 廠商 |
---|---|
云安全信息和事件管理產(chǎn)品 | Splunk、AlienVault |
云主機(jī)安全產(chǎn)品 | CloudPassage、Illumio、vArmour、FortyCloud |
私有云服務(wù)器安全 | TrendMicro、Symantec、McAfee |
廠家 | 描述 |
---|---|
Illumio | 自適應(yīng)安全 |
FortyCloud | Cloud Network Firewall as a Service |
vArmour | 利用大數(shù)據(jù)分析技術(shù),通過(guò)掃描進(jìn)入網(wǎng)絡(luò)的每一塊數(shù)據(jù)來(lái)篩查疑似非法數(shù)據(jù)并對(duì)其進(jìn)行標(biāo)記,跟蹤。 |
CloudPassage | 服務(wù)器的安全配置管理、托管防火墻管理、入侵檢測(cè)、服務(wù)器賬號(hào)審計(jì)、事件報(bào)告與告警 |
Splunk | 從海量機(jī)器數(shù)據(jù)中提取有價(jià)值的信息,并進(jìn)行實(shí)時(shí)分析和展現(xiàn) |
AlienVault | 為客戶提供SIEM解決方案。同時(shí),AlienVault結(jié)合眾包威脅情報(bào)平臺(tái)提供了一個(gè)混合威脅管理解決方案。 |
TrendMicro,McAfee,Symantec | VMware、Hyper-v、Linux KVM私有云虛擬機(jī)安全解決方案 |
0x02 產(chǎn)品目標(biāo)
針對(duì)互聯(lián)網(wǎng)金融中小企業(yè)用戶。獲取用戶改進(jìn)產(chǎn)品,互聯(lián)網(wǎng)金融目標(biāo)用戶行業(yè)分析如下:
業(yè)務(wù)模式名稱 | 業(yè)務(wù)模式詳細(xì)描述 | 代表企業(yè):安全業(yè)務(wù)需求 |
---|---|---|
第三方支付企業(yè)模式 | 第三方支付企業(yè)指在收付款人之間作為中介機(jī)構(gòu)提供網(wǎng)絡(luò)支付、預(yù)付卡發(fā)行預(yù)受理、銀行卡收單以及其他支付服務(wù)的非金融機(jī)構(gòu) | 支付寶、易寶支付、拉卡拉、財(cái)付通為代表的互聯(lián)網(wǎng)支付企業(yè),快錢、匯付天下為代表的金融型支付企業(yè)。 |
P2P網(wǎng)絡(luò)小額信貸模式 | 通過(guò)P2P網(wǎng)絡(luò)融資平臺(tái),借款人直接發(fā)布借款信息,出借人了解對(duì)方的身份信息、信用信息后,可以直接與借款人簽署借貸合同,提供小額貸款,并能及時(shí)獲知借款人的還款進(jìn)度,獲得投資回報(bào)。 | 代表企業(yè):美國(guó)的prosper和lendingclubP2P公司,國(guó)內(nèi)的人人貸、拍拍貸、紅嶺創(chuàng)投等 陸金所 |
眾籌融資模式 | 所謂眾籌平臺(tái),是指創(chuàng)意人向公眾募集小額資金或其他支持,再將創(chuàng)意實(shí)施結(jié)果反饋給出資人的平臺(tái)。網(wǎng)站為網(wǎng)友提供發(fā)起籌資創(chuàng)意,整理出資人信息,公開(kāi)創(chuàng)意實(shí)施結(jié)果的平臺(tái),以與籌資人分成為主要贏利模式 | 代表企業(yè):國(guó)外最早和最知名的平臺(tái)是kickstarter,國(guó)內(nèi)有點(diǎn)名時(shí)間、眾籌網(wǎng)、淘夢(mèng)網(wǎng)等 京東眾籌、人人投、追夢(mèng)網(wǎng)、大家投 |
虛擬電子貨幣模式 | 虛擬貨幣是一種計(jì)算機(jī)運(yùn)算產(chǎn)生或者網(wǎng)絡(luò)社區(qū)發(fā)行管理的網(wǎng)絡(luò)虛擬貨幣,可以用來(lái)購(gòu)買一些虛擬的物品,比如網(wǎng)絡(luò)游戲當(dāng)中的衣服、帽子、裝備等,只要有人接受,也可以使用像比特幣這樣的虛擬貨幣購(gòu)買現(xiàn)實(shí)生活當(dāng)中的物品。 | 代表企業(yè):國(guó)外的比特幣、亞馬遜幣、Facebook幣,國(guó)內(nèi)的Q幣等。 |
基于大數(shù)據(jù)的金融服務(wù)平臺(tái)模式 | 通過(guò)打造類似去哪兒這樣的金融產(chǎn)品垂直搜索引擎的方式,把有借款需求的個(gè)人和有放款需要的中小銀行和小貸機(jī)構(gòu)在一個(gè)平臺(tái)上進(jìn)行對(duì)接;然后通過(guò)廣告費(fèi)或者交易傭金的方式獲得收入。 | 代表企業(yè):國(guó)外的Bankrate(銀率網(wǎng)),國(guó)內(nèi)的融360、好貸網(wǎng)、金融界理財(cái)?shù)?/td> |
互聯(lián)網(wǎng)銀行模式(Internet bank or E-bank) | 借助現(xiàn)代數(shù)字通信、互聯(lián)網(wǎng)、移動(dòng)通信及物聯(lián)網(wǎng)技術(shù),通過(guò)云計(jì)算、大數(shù)據(jù)等方式在線實(shí)現(xiàn)為客戶提供存款、貸款、支付、結(jié)算、匯轉(zhuǎn)、電子票證、電子信用、賬戶管理、貨幣互換、P2P金融、投資理財(cái)、金融信息等全方位無(wú)縫、快捷、安全和高效的互聯(lián)網(wǎng)金融服務(wù)機(jī)構(gòu)?;ヂ?lián)網(wǎng)銀行的便利性、高效性將給傳統(tǒng)銀行帶來(lái)較大的挑戰(zhàn) | |
互聯(lián)網(wǎng)理財(cái) | 通過(guò)互聯(lián)網(wǎng)進(jìn)行更高效的更便捷的錢生錢的事業(yè) | 銅板街、格上理財(cái)、招財(cái)寶 - 螞蟻金服、積木盒子、火球 |
0x03 市場(chǎng)機(jī)會(huì)
3.1 我們的機(jī)會(huì)在哪里
國(guó)內(nèi)云主機(jī)安全服務(wù)平臺(tái)有以下幾家:
廠商名稱 | 產(chǎn)品介紹 |
---|---|
烏云唐朝巡航 | 借助眾測(cè)試等社區(qū)運(yùn)營(yíng)模式產(chǎn)生的云主機(jī)安全解決方案,主要是及時(shí)響應(yīng)服務(wù)器安全漏洞。 |
阿里云盾 | DDoS防護(hù),主機(jī)入侵防護(hù),以及漏洞檢測(cè)、木馬檢測(cè)等一整套安全服務(wù) |
安全狗 | 基于主機(jī)WAF 和anti-DDoS功能 |
知道創(chuàng)宇 | 加速樂(lè)、云安全監(jiān)控平臺(tái)、ZoomEye大數(shù)據(jù)安全掃描平臺(tái) |
百度安全寶 | 云WAF企業(yè)版、DDoS云防護(hù)、應(yīng)急響應(yīng) |
青藤云安全 | 自適應(yīng)安全理念的產(chǎn)品化的國(guó)內(nèi)第一家廠商 |
面對(duì)這些公司的競(jìng)爭(zhēng),我們的競(jìng)爭(zhēng)力在于獲得種子用戶,完全開(kāi)源的策略。提供安全運(yùn)維服務(wù)。二次開(kāi)發(fā)等服務(wù)。
3.2 如何成功?
支持云方式部署方式,快速獲取用戶。免費(fèi)安裝模式。
如果用戶打算使用我們的解決方案,可以獨(dú)立部署或者開(kāi)放源代碼。
KPI考核
統(tǒng)計(jì)安裝用戶數(shù)量、留存率,月付費(fèi)用戶轉(zhuǎn)化率。免費(fèi)用戶
3.3 項(xiàng)目里程碑
0x04 產(chǎn)品功能詳細(xì)架構(gòu)設(shè)計(jì)(Product Proposal)
4.1 產(chǎn)品定位
通過(guò)以上國(guó)內(nèi)外云安全公司產(chǎn)品分析,我認(rèn)為云主機(jī)安全平臺(tái)需要具備以下四個(gè)大功能模塊。
開(kāi)發(fā)的優(yōu)先級(jí)如下:
- 基于日志大數(shù)據(jù)收集分析平臺(tái)(P1)
- 基于基于Agent收集云主機(jī)相關(guān)精確的安全信息 (P2) 本模塊需要大量的開(kāi)發(fā)人員完成,如果獲得天使輪融資后可以開(kāi)發(fā)。
- 威脅情報(bào)模塊(P2) 威脅情報(bào)這部分可以對(duì)接國(guó)內(nèi)的威脅情報(bào)系統(tǒng) 例如:微步等。
- SDN網(wǎng)絡(luò)安全防火墻模塊(P2)防火墻模塊目前還需要做更多的研究才能集成,建議使用linux主機(jī)上自帶iptable實(shí)現(xiàn)。
4.2、產(chǎn)品功能詳細(xì)設(shè)計(jì)
針對(duì)P1需要完成的功能,建立基于大數(shù)據(jù)分析平臺(tái),防范APT攻擊。產(chǎn)品概念設(shè)計(jì)可以 為:基于日志的態(tài)勢(shì)感知功能。
處理Web日志數(shù)據(jù)結(jié)構(gòu)如下:
所選擇的實(shí)現(xiàn)技術(shù)手段:
由于前期數(shù)據(jù)量沒(méi)有到達(dá)一定的數(shù)量級(jí),可以使用傳統(tǒng)的關(guān)系型數(shù)據(jù)實(shí)現(xiàn)。當(dāng)然如果本系統(tǒng)應(yīng)用到大公司的時(shí)候可以迭代技術(shù)架構(gòu)、hadoop或者storm來(lái)解決問(wèn)題。
業(yè)務(wù)流程圖:
核心界面設(shè)計(jì):通過(guò)visio原型圖表現(xiàn)。
核心界面首先,要畫出原型圖,那么,和用戶接觸最多的是web前端,所以,設(shè)計(jì)要精致。
(1)Web前端
Web前端分為四大功能模塊
- Dashboard:顯示攻擊類型和攻擊源
- Analysis:圖形化分析詳細(xì)的攻擊方式
- Reporting: 以數(shù)據(jù)形式展示攻擊類型、攻擊源和詳細(xì)攻擊方式
- Configuration:參數(shù)配置(非核心模塊就不展示了)
(2)Web管理后臺(tái)
交互流程設(shè)計(jì):正常應(yīng)該通過(guò)Axure動(dòng)畫表現(xiàn),由于本次設(shè)計(jì)不是特別復(fù)雜,只是幾個(gè)功能模塊的切換就不畫交換流程圖了。
0x05 產(chǎn)品技術(shù)架構(gòu)設(shè)計(jì)
由于目前產(chǎn)品設(shè)計(jì)需要考慮高擴(kuò)展性,所以技術(shù)選型大致如下:
0x06 Demo搭建
根據(jù)技術(shù)選型后,需要建立Demo 環(huán)境技術(shù)難點(diǎn)集中在服務(wù)器端和Web后端。那么下面說(shuō)明一下這兩部分搭建:
6.1 服務(wù)器端
組件名稱 | 詳細(xì)描述 |
---|---|
操作系統(tǒng) | Centos 6.7 Final |
Web前端服務(wù)器 | Nginx/1.8.1 |
Web服務(wù)器 | Django/1.7 |
Python解析器 | uwsgi |
Python語(yǔ)言 | Python 2.7.10 |
Restful API架構(gòu) | Tastypie |
看到這個(gè)架構(gòu)其實(shí)很多小朋友會(huì)問(wèn)為啥要這么設(shè)計(jì),太繁瑣了?其實(shí)設(shè)計(jì)原則主要是為了將來(lái)的擴(kuò)展性。Web前端服務(wù)器:本系統(tǒng)是一個(gè)公有云安全平臺(tái),用戶量將來(lái)要不斷的增加,使用Nginx可以做到橫向擴(kuò)展。
6.1.1 Nginx安裝部署
Nginx部署過(guò)程:
- rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
- yum -y install nginx
- service nginx restart
- chkconfig nginx on
配置nginx在/etc/nginx/conf.d/中增加MyPythonServer.conf,內(nèi)容如下:
#!bashhttp { #負(fù)載均衡 upstream production_site{ server web1.xxx.com:8080 weight=6 max_fails=3 fail_timeout=20s; server web2.xxx.com:8080 weight=3 max_fails=3 fail_timeout=20s; server web3.xxx.com:8080 weight=7 max_fails=3 fail_timeout=20s; server web4.xxx.com:8080 weight=8 max_fails=3 fail_timeout=20s; } server { listen 8090; server_name web1.xxx.com,web2.xxx.com,web3.xxx.com,web4.xxx.com; charset utf-8; client_max_body_size 75M; location / { uwsgi_pass django; include uwsgi_params; }}
6.1.2 Django&uwsgi安裝配置
#!bash[root@localhost venv]# pip install Django安裝uWSGI[root@localhost venv]# pip install uwsgi[uwsgi]home=/data/Mydata/envchdir=/data/Mydata/uid=rootgid=rootwsgi-file=/data/Mydata/wsgi.pysocket=127.0.0.1:8001master=trueworkers=8pidfile=/data/Mydata/uwsgi.pidvacuum=truethunder-lock=trueenable-threads=trueharakiri=30post-buffering=4096daemonize=/data/Mydata/uwsgi.loglogger=file:/data/Mydata/uwsgi.log
6.2 Web后端
6.2.1 Php-fpm安裝
nginx 安裝忽略
#!bashcd /usr/local/src/ wget http://php.net/distributions/php-5.6.8.tar.gztar --zxvf php-5.6.8.tar.gzyum install -y libxml2 libxml2-devel openssl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel mcrypt mhash./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --enable-fpm --disable-ipv6 --enable-pdo --with-pdo-mysql --with-openssl --with-mcrypt --with-mhash --enable-json --enable-mbstring --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --enable-zipmake make installcp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.confcp /usr/local/src/php-5.6.8/sapi/fpm/init.d.php-fpm /usr/local/php5/sbin/ cd /usr/local/php5/sbin/ chmod 755 init.d.php-fpm ./init.d.php-fpm start Starting php-fpm done
配置Nginx來(lái)支持PHP
#!bashcd /etc/nginx/vi nginx.conf#打開(kāi)gzipgzip on;
配置vhost,假設(shè)域名為www.xxx.com
#!bashcd /etc/nginx/conf.d/vi www.xxx.com.conf#內(nèi)容如下server { listen 80; server_name www.xxx.com xxx.com; location / { #開(kāi)啟ssi支持shtml ssi on; ssi_silent_errors on; ssi_types text/shtml; index index.shtml index.php index.htm index.html; root /data/www/www.xxx.com; #框架路由設(shè)置 if ( !-e $request_filename ) { rewrite ^(.*)$ /index.php?url=$1 last; } } location ~.php$ { root /data/www/www.xxx.com; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~.(jpg|jpeg|png|js|css) { root /data/www/www.xxx.com; expires 30d; }}
測(cè)試一下 配置文件是否有錯(cuò)誤
#!bash/etc/init.d/nginx configtestnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful
新建info.php測(cè)試文件,內(nèi)容為
#!php<?phpphpinfo();?>
然后:
#!bashvim /etc/hosts127.0.0.1 www.xxx.comcd /usr/local/src/php-5.6.8cp php.ini-production /usr/local/php5/etc/php.ini
至此nginx+php-fpm設(shè)置完成。
6.2.2 Mysql擴(kuò)展安裝
#!bashyum install mysql-devel
由于之前沒(méi)有安裝mysql服務(wù),也沒(méi)有安裝php的mysql擴(kuò)展,用是PDO方式,為適應(yīng)老版本的joomla程序,再添加mysql.so擴(kuò)展
方法如下:
1、進(jìn)入php源代碼目錄:
#!bashcd /usr/local/src/php-5.6.8/extcd mysqlyum install autoconf
調(diào)用已經(jīng)編譯好的php可執(zhí)行程序phpize,phpize是用來(lái)擴(kuò)展php擴(kuò)展模塊的,通過(guò)phpize可以建立php的外掛模塊
phpize的規(guī)則:去哪個(gè)目錄下運(yùn)行phpize文件,那么就會(huì)在該目錄下生成一個(gè)configure文件。
#!bash/usr/local/php5/bin/phpize./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysql --with-zlib-dir=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/make && make install
完成后,可以看到no-debug-non-zts-20131226目錄下生成了mysql.so文件
修改php.ini,去掉 ;extension=php_mysql.so 前面的分號(hào)。將 php_mysql.so 改成我們生成的 mysql.so 。
重啟 php-fpm 后可以從phpinfo看到mysql擴(kuò)展已經(jīng)生效。
6.2.3 Yaf擴(kuò)展安裝
#!bashwget https://github.com/laruence/yaf/archive/master.zipunzip master.zip./configure --with-php-config=/usr/local/php5/bin/php-configmake && make installvim /usr/local/php5/etc/php.iniextension=yaf.so

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Common problems and solutions for PHP variable scope include: 1. The global variable cannot be accessed within the function, and it needs to be passed in using the global keyword or parameter; 2. The static variable is declared with static, and it is only initialized once and the value is maintained between multiple calls; 3. Hyperglobal variables such as $_GET and $_POST can be used directly in any scope, but you need to pay attention to safe filtering; 4. Anonymous functions need to introduce parent scope variables through the use keyword, and when modifying external variables, you need to pass a reference. Mastering these rules can help avoid errors and improve code stability.

To safely handle PHP file uploads, you need to verify the source and type, control the file name and path, set server restrictions, and process media files twice. 1. Verify the upload source to prevent CSRF through token and detect the real MIME type through finfo_file using whitelist control; 2. Rename the file to a random string and determine the extension to store it in a non-Web directory according to the detection type; 3. PHP configuration limits the upload size and temporary directory Nginx/Apache prohibits access to the upload directory; 4. The GD library resaves the pictures to clear potential malicious data.

There are three common methods for PHP comment code: 1. Use // or # to block one line of code, and it is recommended to use //; 2. Use /.../ to wrap code blocks with multiple lines, which cannot be nested but can be crossed; 3. Combination skills comments such as using /if(){}/ to control logic blocks, or to improve efficiency with editor shortcut keys, you should pay attention to closing symbols and avoid nesting when using them.

AgeneratorinPHPisamemory-efficientwaytoiterateoverlargedatasetsbyyieldingvaluesoneatatimeinsteadofreturningthemallatonce.1.Generatorsusetheyieldkeywordtoproducevaluesondemand,reducingmemoryusage.2.Theyareusefulforhandlingbigloops,readinglargefiles,or

The key to writing PHP comments is to clarify the purpose and specifications. Comments should explain "why" rather than "what was done", avoiding redundancy or too simplicity. 1. Use a unified format, such as docblock (/*/) for class and method descriptions to improve readability and tool compatibility; 2. Emphasize the reasons behind the logic, such as why JS jumps need to be output manually; 3. Add an overview description before complex code, describe the process in steps, and help understand the overall idea; 4. Use TODO and FIXME rationally to mark to-do items and problems to facilitate subsequent tracking and collaboration. Good annotations can reduce communication costs and improve code maintenance efficiency.

TolearnPHPeffectively,startbysettingupalocalserverenvironmentusingtoolslikeXAMPPandacodeeditorlikeVSCode.1)InstallXAMPPforApache,MySQL,andPHP.2)Useacodeeditorforsyntaxsupport.3)TestyoursetupwithasimplePHPfile.Next,learnPHPbasicsincludingvariables,ech

In PHP, you can use square brackets or curly braces to obtain string specific index characters, but square brackets are recommended; the index starts from 0, and the access outside the range returns a null value and cannot be assigned a value; mb_substr is required to handle multi-byte characters. For example: $str="hello";echo$str[0]; output h; and Chinese characters such as mb_substr($str,1,1) need to obtain the correct result; in actual applications, the length of the string should be checked before looping, dynamic strings need to be verified for validity, and multilingual projects recommend using multi-byte security functions uniformly.

ToinstallPHPquickly,useXAMPPonWindowsorHomebrewonmacOS.1.OnWindows,downloadandinstallXAMPP,selectcomponents,startApache,andplacefilesinhtdocs.2.Alternatively,manuallyinstallPHPfromphp.netandsetupaserverlikeApache.3.OnmacOS,installHomebrew,thenrun'bre
