AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

getAuditConfig(데이터베이스 명령)

getAuditConfig

버전 5.0의 신규 항목입니다.

getAuditConfig is an administrative command that retrieves audit configurations from mongod and mongos server instances.

이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

중요

이 명령은 MongoDB Atlas 클러스터에서 지원되지 않습니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.

명령은 다음과 같은 구문을 가집니다:

db.adminCommand(
{
getAuditConfig: 1
}
)

Auditing must be enabled to use getAuditConfig.

런타임 감사 구성에 참여하지 않는 노드는 auditLog.filtersetParameter.auditAuthorizationSuccess 에 대한 현재 구성 파일 설정을 반환합니다.

Nodes that are participating in the runtime audit synthesize their current configuration from memory. Configuration updates are distributed via the oplog mechanism which means updates on mongod nodes are distributed to secondary nodes very quickly. However, the distribution mechanism is different on mongos nodes. mongos nodes have to poll the primary server at regular intervals for configuration updates. You may see stale data due to polling delay if you run setAuditConfig on the primary server and getAuditConfig on a shard before the shard has polled the primary server for updated configuration details.

참고

자동화된 감사 스크립트를 작성하는 경우 클러스터 서명을 나타내는 데 사용되는 인용 스타일과 유형이 mongosh 와 레거시 mongo shell 간에 다르다는 점에 유의하세요. mongosh 에서 유형은 바이너리 및 Long입니다. 레거시 shell 에서 해당 유형은 BinData 및 NumberLong입니다.

// mongosh
signature: {
hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
keyId: Long("0")
}
// mongo
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : Long(0)
}

Run getAuditConfig on the admin database .

db.adminCommand({getAuditConfig: 1})

예제 서버는 읽기 및 쓰기 작업을 감사하도록 구성됩니다. 여기에는 원하는 작업을 캡처하는 필터가 있으며 auditAuthorizationSuccess 값이 true 로 설정되었습니다.

{
generation: ObjectId("60e73e74680a655705f16525"),
filter: {
atype: 'authCheck',
'param.command': {
'$in': [ 'find', 'insert', 'delete', 'update', 'findandmodify' ]
}
},
auditAuthorizationSuccess: true,
ok: 1,
'$clusterTime': {
clusterTime: Timestamp(1, 1625767540),
signature: {
hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
keyId: Long("0")
}
},
operationTime: Timestamp(1, 1625767540)
}
이 페이지 평가하기

이 페이지의 내용