비트(bit)주세요

[GitHub Opensource] gosec 본문

SUA/오픈소스 보안

[GitHub Opensource] gosec

yglee730 2021. 10. 22. 17:06
728x90

Gosec : Golang 취약점 점검 애플리케이션

 

https://github.com/securego/gosec

 

GitHub - securego/gosec: Golang security checker

Golang security checker. Contribute to securego/gosec development by creating an account on GitHub.

github.com

 

 

golang 버전 확인

go version

 

gosec 설치법

go version go[버전] linux/amd64에 있는 버전이

1.16 이상일 경우(1.16이 가장 최신 버전인가)
go install github.com/securego/gosec/v2/cmd/gosec@latest
1.16 미만일 경우
go get -u github.com/securego/gosec/v2/cmd/gosec

 

home/[유저] 디렉토리로 이동해서 다시 설치했다.

 

gosec 테스트

gotify/server가 go언어로 되어있으니 그 곳에서 테스트를 해보겠다

go언어로 된 애플리케이션을 하나 가져와서 테스트를 해도 된다.

그럴경우에는

 

[GitHub 접속] -> [Explore 접속] -> [Topics 접속] -> [Go 선택]

https://github.com/topics/go

 

GitHub: Where the world builds software

GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

 

점검하려는 애플리케이션 디렉터리로 들어가고 점검해야 한다.

cd [점검하려는 애플리케이션 디렉터리]

 

results.json에 JSON 형식의 쓰기 출력 (다른 형식들의 출력은 GitHub를 참고할 것)

gosec -fmt = JSON -out = results.json * .go

마지막엔 점검 내용을 요약해서 출력시켜준다.

Summary 위에 어디어디가 취약한지 알려주는 것 같은데, 맞나 모르겠다.

자세한건 gosec github에서 더 알아봐야 한다.