草庐IT

Linux安全加固

全部标签

javascript - XMLHttpRequest 无法加载 localhost 资源,安全检查是 Chrome

我在OSX10.11.4上运行Chrome版本49.0.2623.108(64位)。从终端:我跑了:>ls/tmpwtf.jpg>ps-ef|grep-ichrome|grep-vgrep退出Chrome后,只需确保没有实例仍在运行。然后我使用以下参数打开Chrome以跳过跨源检查:>open/Applications/Google\Chrome.app/--args--allow-file-access-from-files"我也试过:>open/Applications/Google\Chrome.app/--args--disable-web-security"现在,我运行简单的

linux - tls conn Read 中的 Golang panic - 仅在 linux 上?

我正在使用golangcrypto/tls来处理自定义的面向行的消息协议(protocol)。这种方法在Windows上运行良好:varfullBufferstringfor{//Ifwe'renotconnected,attemptreconnectifthis.conn==nil{ifthis.IsSecure(){this.conn,err=tls.Dial("tcp",this.GetHostOnly(),nil)}else{this.conn,err=net.Dial("tcp",this.GetHostOnly())}iferr==nil{//logandcontinue}

Go logging struct 实例化实用方法的 Goroutine 线程安全

我正在使用一个新的go服务,我有一个SetupLogger实用函数,它创建一个新的go-kit日志结构实例log.Logger。从在单独的go-routines中处理请求的代码调用此方法是否安全?packageutilsimport("fmt""github.com/go-kit/kit/log""io""os""path/filepath")//Iftheenvironment-specifieddirectoryforwritinglogfilesexists,opentheexistinglogfile//ifitalreadyexistsorcreatealogfileifno

ruby - 这个示例 tcp 套接字编程事件顺序安全吗?

我计划提供两项服务。用Ruby编写的HTTPREST服务用Go编写的JSONRPC服务Ruby服务将打开一个到GoJSONRPC服务的TCP套接字连接。它将为收到的每个传入HTTP请求执行此操作。它会通过套接字向Go服务发送一些数据,然后该服务会通过套接字发回相应的数据。Go代码Go服务go看起来像这样(简化):srv:=new(service.App)//thiswouldexposeaProcessmethodrpc.Register(srv)listener,err:=net.Listen("tcp",":8080")iferr!=nil{//handleerror}for{co

linux - go1.6 File方法WriteString频繁调用导致系统缓存大

go1.6文件方法WriteString频繁调用导致系统缓存很大。如何解决这个问题。进入环境:linuxamd64。这是Linux系统的问题吗?代码:packagemainimport("fmt""net/http""os""time")varlogCtxChchan*http.RequestvaraccessLogFile*os.FiletypeHandlerHttpstruct{}func(this*HandlerHttp)ServeHTTP(whttp.ResponseWriter,req*http.Request){sendAccessLog(req)w.Write([]byt

linux - 段错误 debian 8 golang

tstx程序代码(golang)packagemainimport"fmt"funcmain(){fmt.Printf("Hello")}在开发计算机(基于debian的linux)上一切正常,但是当我在服务器计算机(Debian8)上运行它时出现段错误两个系统都是amd64,代码用[gobuild]编译[strace./tstx]-说execve("./tstx",["./tstx"],[/*16vars*/])=0---SIGSEGV{si_signo=SIGSEGV,si_code=SEGV_MAPERR,si_addr=0xffffffffffffff8b}---+++kill

go - 是否可以预编译 Go 项目并在不同的 Linux 发行版上运行

这个问题在这里已经有了答案:AreGolangbinariesportable?(1个回答)关闭6年前。我是Go的新手,想知道我是否可以在我的计算机上构建我的应用程序,然后放在具有不同Linux系统的目标机器上运行,而无需编译它或它的依赖项?我如何确定二进制文件可以在哪些目标系统上运行?

linux - 调试器在带有 "Go"插件的 IntelliJ IDEA 中不起作用

我安装的是IntelliJIDEA,go1.4,gopluginforIdea。现在我可以运行GO代码,但不能使用调试器。调试后,我在控制台中看到错误panic:notanIntgoroutine68[running]:go/constant.Int64Val(0x0,0x0,0x2,0xc8200d5180)/usr/local/go/src/go/constant/value.go:236+0x338github.com/derekparker/delve/proc.(*Variable).parseG(0xc8200a6700,0xc8200a6700,0x0,0x0)/opt/

go - 如何从 Windows 交叉编译到 Linux?

我在Windows机器上安装了Go1.2,编写了一个虚拟程序并将环境变量GOARCH和GOOS分别设置为“AMD64”和“linux”.当我发出“gobuild”命令时,我收到一个错误:gobuildruntime:linux/amd64mustbebootstrappedusingmake.bat这是什么意思? 最佳答案 它告诉您它需要构建所有工具才能使用它们。如果你的windowsGOARCH是amd64,那么你可以通过运行这个小批量程序来“构建”所有需要的工具:setGOARCH=amd64setGOOS=linuxgotoo

linux - docker api ContainerExecInspect 无法获得正确的退出代码

我正在使用dockerengine-api(github.com/docker/engine-api)来执行一些命令我使用client.ContainerExecCreate,然后使用client.ContainerExecInspect来运行我的命令,然后获取命令退出代码(我在同一容器中运行多个命令,因此从ContainerInspect获取的退出代码对我来说毫无用处。)这是我用来在容器中执行命令的函数http://pastebin.com/rTNVuv9T但ContainerExecInspect有时会返回错误的值,因为有时ContainerExecInspect在命令退出之前被调