SUA/오픈소스 보안

정보보안 SUA - [오픈소스 보안] 4주차

yglee730 2021. 10. 24. 18:02
728x90

1. 과제

<Juice-Shop 취약점 3개 실습>

<Gotify 서버 사용성 분석 진행>

<Go-SCP에서 공부할 섹션 고르고 실습 진행>

<GoKart, GoSec 사용성 분석>

 

2. 내용

<Gotify에 메시지 전송>

CLI로 Gotify에 메시지를 전송하기 위한 초기 세팅 

https://standardh.tistory.com/174

 

[gotify/server] 초기 유저 세팅(CLI)

gotify : 메시지를 간단하게 주고받는 서버 애플리케이션 Websocket, REST-API로 메시지를 주고 받을 수 있음 웹 UI, CLI, Android 지원 gotify 오픈소스 링크 https://github.com/gotify/server GitHub - gotify/..

standardh.tistory.com

 

CLI로 Gotify에 메시지 전송

https://standardh.tistory.com/175

 

[gotify/server] 서버에 메시지 전송(CLI)

Gotify 오픈소스 링크 https://github.com/gotify/server GitHub - gotify/server: A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui) A simple server..

standardh.tistory.com

 

REST-API로 Gotify에 메시지 전송 

https://standardh.tistory.com/176

 

[gotify/server] REST-API 전송

Gotify 공식 문서 https://github.com/gotify/server GitHub - gotify/server: A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui) A simple server for..

standardh.tistory.com

 

<Cloudflare + NginX 환경 구축 시 뜨는 522 에러>

# 522 에러가 발생한 이유 
Cloudflare가 원본 웹 서버에 연결 중 제한 시간을 초과했을 때 발생

  -> 웹서버가 정상적으로 올라오지 않아서(?) 

 

<golang이 선호되는 이유 - golang 장단점>

# 장점
1. 매우 간단한 문법
2. 빠른 속도의 컴파일
3. 고루틴(goroutine)
4. 채널 사용

* 고루틴 : Go 런타임이 관리하는 논리적 쓰레드
go라는 키워드를 붙여서 호출하면 호출하는 함수와 현재 실행하고 있는 함수의 흐름이 구분되어 별개로 동작함
-> 고루틴 함수의 실행 순서는 프로그램에 영향을 미치지 않음
-> 실행 순서가 정해져 있지 않음

* 채널 : 고루틴끼리 데이터를 주고 받는 통로
상대편이 준비될 때까지 채널에서 대가힘으로써 별도의 lock을 걸지 않고 데이터를 동기화하는데 사용
-> 채널 자체는 값이 아닌 레퍼런스 타입임
-> 비유하자면 고루틴이 사용하는 데이터베이스(?)
# 단점
1. 없는게 정말 많음
-> 예외처리, 클래스 문법, 제네릭 문법, Private, Public, this 없음

2. 코드가 깔끔하지 않음
-> 예외 처리 문법이 없음
-> if문의 사용량 증가

3. 중앙 저장소의 부재
-> Go에서는 원격 저장소에 올라온 패키지를 go get 명령어로 다운로드함

4. Go는 템플릿도 매크로도 없음
-> 단순한 코드가 반복해서 등장함 

 

<Golang 취약점 점검 애플리케이션>

1. GoSec

https://standardh.tistory.com/177

 

[GitHub Opensource] gosec

Gosec : Golang 취약점 점검 애플리케이션 https://github.com/securego/gosec GitHub - securego/gosec: Golang security checker Golang security checker. Contribute to securego/gosec development by creati..

standardh.tistory.com

 

2. GoKart

https://standardh.tistory.com/178

 

[GitHub Opensource] goKart

goKart : golang 취약점 점검 애플리케이션  -> 원격으로도 점검할 수 있다는 장점이 있음 https://github.com/praetorian-inc/gokart GitHub - praetorian-inc/gokart: A static analysis tool for securing Go..

standardh.tistory.com

3. Go-SCP

Golang 애플리케이션의 취약점 점검 가이드
-> 취약점 점검 시 유용하게 쓰일 문서 

https://github.com/OWASP/Go-SCP

 

GitHub - OWASP/Go-SCP: Go programming language secure coding practices guide

Go programming language secure coding practices guide - GitHub - OWASP/Go-SCP: Go programming language secure coding practices guide

github.com

 

3. 결론

golang 관련하여 정보들을 찾아보니까, 시간이 지나고 golang에 기능들이 추가되고 단점들은 보완된다면, 

golang의 점유율이 높아질거라고 생각된다. 동시에, 한국에서는 golang이 Java를 따라잡으려면 시간이 얼마나

소요될까도 궁금해졌다.

 

4. 후기

1. 번역기에 의존을 자주 하게 된다. 영어 독해력을 늘려서 번역기 없이 기술을 터득할 수 있도록 해야겠다.

2. 집중력을 더 키워서, 시간 분배를 구체적으로 진행하고 수행할 수 있도록 해야겠다.

 

5. 참고

Cloudflare 522 error

https://support.cloudflare.com/hc/ko/articles/115003011431-Cloudflare-5XX-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0#522error

 

Cloudflare 5XX 오류 해결

Cloudflare가 프록시 역할을 하는 사이트의 5XX 오류를 진단하고 해결합니다. 개요 오류 분석 500: internal server error 502: bad gateway 또는 504: gateway timeout 503: service temporarily unavailable 520: web server returns an..

support.cloudflare.com

 

GoRoutine 개념

https://jbhs7014.tistory.com/179

 

[Go] 동시성을 위한 GoRoutine과 Channel

Go 언어의 특징중 하나는 동시성이다. 동시성이란 프로그램이 순차적인 흐름으로 수행되는 것이 아니라 동시에 수행되어 처리되는 것을 말한다. Go 언어는 이러한 동시성을 위해 고루틴(goroutine)

jbhs7014.tistory.com

 

Golang Channel

https://brownbears.tistory.com/315

 

[Golang] 채널

Go 채널은 그 채널을 통하여 고루틴끼리 데이터를 주고 받는 통로라 볼 수 있는데, 채널은 make(chan 자료형) 함수를 통해 미리 생성되어야 하며, 채널 연산자 아래 예제는 정수형 채널을 생성하고

brownbears.tistory.com

 

Golang 장단점

https://covenant.tistory.com/204

 

Go 언어의 장점과 단점

Go 언어의 장점과 단점 주의 본 글은 특정 언어를 지지하거나 GO를 폄하할 의도로 작성한 글이 아닙니다. 웹 상의 의견과 제가 Go를 사용하면서 느낀점을 첨언하였습니다. GO언어를 선택할까 고민

covenant.tistory.com