運維操作管理理念
理念一:唯有控制才能真正解決問題
審計是事後行爲,從來沒有事前審計一說
審計可以發現問題,但是無法防止問題發生
只有在事前嚴格控制,才能從源頭真正解決問題
理念二:系統賬號無法確認用戶身份
系統賬號的作用只是區分工作角色
多人共用一個系統賬號是合理的
運維人員的流動不應影響系統賬號
理念三:人爲操作難免會出問題
人有失手,馬有失蹄
不怕出問題,就怕出問題找不到原因
只要機器能做的,就不要人做
Gate One 安裝和使用
官方使用手冊: http://liftoff.github.io/GateOne/
1.安裝Gateone:
git clone https://github.com/liftoff/GateOne.git
cd GateOne
python setup.py install
#也可以用目錄裏面的docker來構建
docker build -t wmj/gateone:v1 /root/GateOne/docker/
2.啓動Gateone:
# gateone #第一次啓動會生成配置文件
https://172.16.2.241/ 直接通過https訪問
3.命令行回放日誌文件:
cd /var/lib/gateone/users/ANONYMOUS/logs/ #默認日誌存放目錄
/root/GateOne/gateone/applications/terminal/logviewer.py --flat 20170425170036224259-10.0.200.6.golog
4.嵌入GateOne:
# /root/GateOne/gateone/tests/hello_embedded #這是一個Demo目錄
# ./hello_embedded_world.py --address=0.0.0.0 --port=6060
https://172.16.2.241:6060/ #訪問Demo
# 修改配置文件,讓gateone允許所有ip和關閉驗證,這樣才能嵌入。
vim /etc/gateone/conf.d/10server.conf
"origins": ["*"],
"auth": "None",
5.簡單嵌入html腳本:
下面的IP地址要改成你自己的gateone服務器地址
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
<!-- Include gateone.js somewhere on your page -->
<script src="https://172.16.2.241/static/gateone.js"></script>
<!-- Decide where you want to put Gate One -->
<div id="gateone_container" style="position: relative; width: 60em; height: 30em;">
<div id="gateone"></div>
</div>
<!-- Call GateOne.init() at some point after the page is done loading -->
<script>
window.onload = function() {
// Initialize Gate One:
GateOne.init({url: 'https://172.16.2.241/'});
}
</script>
<!-- That's it! -->
</body>
</html>