ysrc / yulong-hids-archived

[archived] 一款实验性质的主机入侵检测系统
Other
2.16k stars 581 forks source link

启动web服务报403错误,无法看到面板 #50

Closed iris1230xs closed 6 years ago

iris1230xs commented 6 years ago

在开发机上编译运行web.exe,在127.0.0.1/login/可以看到登录界面,但是登录之后看不到监控面板(已在服务器上启动了MongoDB, Elasticsearch并能连接) 下面是app.config

appname = yulong-hids-analyze-dashboard
runmode = prod
sessionon = true
apihost = ""
TemplateLeft = "<<<"
TemplateRight = ">>>"
ApiVer = "json"
copyrequestbody = true
perloadcount = 500

# Alert : 1
# Critical : 2
# Error : 3
# Warning : 4
# Notice : 5
# Informational : 6
# Debug : 7
loglevel=7

# 设置hostname, 如果没设置则不会验证
# 如果设置了,只有该host可以访问web页面,多个host以逗号隔开
ylhostname = ""

# 后台登录用户名
username = "yulong"
# passwordhex为登录密码的32位md5,默认密码为(带句号): All_life_is_a_game_of_luck. 
passwordhex = "0c885bb124969eead759a4c2b512ed52"
# 日志文件路径
logfile = "logs.log"

OnlyHTTPS = true

EnableHTTPS = true
EnableHttpTLS = true
HTTPSPort = 443

EnableHTTP = true
HTTPPort = 80

HTTPSCertFile = "https_cert/cert.pem"
HTTPSKeyFile = "https_cert/private.pem"
FilePath = "upload_files/"

# 是否开启二次验证,推荐开启
TwoFactorAuth = true
# base32格式的二次验证秘钥,请务必修改默认值
# 可使用命令: python2 -c "import base64, random, string;print(base64.b32encode(''.join([random.choice(string.printable) for _ in range(35)]).encode()));" 
# 命令可直接生成随机秘钥,直接在 Google Authenticator app内填入秘钥即可
TwoFactorAuthKey = "IVFHGS2OGYTXIVDGEIZWCNC2MVMHYWDRK44GOQALPNJHGRS6FE2QUCT4"

[mongodb]
# mongodb url 数据库名固定为agent
# mongodb 的 ip 地址请设置内网ip,请勿设置 127.0.0.1
url = "${IDS_MONGODB_URL||mongodb://*.*.*.*:27017/agent}"

[elastic_search]
# elastic_search web接口
baseurl = "${IDS_ELASTICSEARCH_URL||http://*.*.*.*:9200/}"
neargle commented 6 years ago

web log 有所有的报错信息,可以根据报错信息判断问题。