모듈: Mongo::Mongoing::Event::Secure
- 다음에 정의됨:
- lib/ Mongo/ 모니터링/ 이벤트/secure.rb
개요
명령 및 응답에서 민감한 정보를 삭제하는 동작을 제공합니다.
상수 요약 접기
- REDACTED_COMMANDS =
보안을 위해 데이터가 수정된 명령 목록입니다.
%w[ authenticate saslStart saslContinue getnonce createUser updateUser copydbgetnonce copydbsaslstart copydb ].동결
인스턴스 메서드 요약 접기
-
#Compression_allowed?(command_name) ⇒ true, false
지정된 명령 메시지에 대해 압축이 허용됩니까?
-
#redacted(command_name, document) ⇒ BSON::Document
다음과 같은 경우 문서에서 보안 정보를 삭제합니다. - 해당 명령이 민감한 명령에 포함된 경우 - 해당 명령이 hello/legacy hello 명령이고 추측 인증이 활성화된 경우 - 해당 시작 이벤트는 민감합니다.
-
#민감한?(command_name:, 문서:) ⇒ true | false
명령 모니터링 사양 측면에서 민감한 명령인지 확인합니다.
인스턴스 메서드 세부 정보
#Compression_allowed?(command_name) ⇒ true, false
지정된 명령 메시지에 대해 압축이 허용됩니까?
101 102 103 |
# 파일 'lib/ Mongo/ 모니터링/ 이벤트/secure.rb', 줄 101 def Compression_allowed?(command_name) @compression_allowed ||= !REDACTED_COMMANDS.포함?(command_name.to_s) end |
#redacted(command_name, document) ⇒ BSON::Document
다음과 같은 경우 문서에서 보안 정보를 삭제합니다.
- its command is in the sensitive commands;
- its command is a hello/legacy hello command, and
speculative authentication is enabled;
- corresponding started event is sensitive.
79 80 81 82 83 84 85 86 87 88 89 |
# 파일 'lib/ Mongo/ 모니터링/ 이벤트/secure.rb', 줄 79 def 편집됨(command_name, 문서) 만약 %w[1 true 네].포함?(ENV['MONGO_RUBY_DRIVER_UNREDACT_EVENTS']&.downcase) 문서 elsif response_to?(:started_event) && started_event.민감한 BSON::문서.신규 elsif 민감한?(command_name: command_name, 문서: 문서) BSON::문서.신규 other 문서 end end |
#민감한?(command_name:, 문서:) ⇒ true | false
명령 모니터링 사양 측면에서 명령이 민감한지 확인합니다. 명령이 목록에 있거나 hello/legacy hello 명령인 경우 민감한 명령으로 감지되며 추측 인증 이 활성화됩니다.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# 파일 'lib/ Mongo/ 모니터링/ 이벤트/secure.rb', 줄 49 def 민감한?(command_name:, 문서:) 만약 REDACTED_COMMANDS.포함?(command_name.to_s) true elsif %w[hello isMaster isMaster].포함?(command_name.to_s) && 문서['speculativeAuthenticate'] # hello/legacy hello 명령의 경우 명령 모니터링 사양에 따름 # speculativeAuthenticate가 있는 경우 해당 명령과 응답 # 이벤트에서 삭제해야 합니다. # https://github.com/mongodb/specations/lob/master/source/command-logging-and-monitoring/command-logging-and-monitoring.md#security를 참조하세요. true other 거짓 end end |