오디트 로깅

오디트 로깅 (Audit Logging)

Audit Logging은 Apache Cassandra 4.0의 새 기능이에요(CASSANDRA-12151). 이 새 기능은 힙 메모리와 디스크 공간에 구성 가능한 한도를 두고 out-of-memory 오류를 방지하므로 프로덕션에서 안전하게 사용할 수 있습니다. 모든 데이터베이스 활동이 지정된 로컬 파일시스템 디렉터리에 노드별 파일 기반 레코드로 기록됩니다. 오디트 로그 파일은 구성 가능한 값에 따라 주기적으로 롤됩니다.

오디트 로깅의 기능 중 일부는 다음과 같아요:

  • 오디트 로그를 저장하는 데 추가 데이터베이스 용량이 필요하지 않습니다.
  • 오디트 로그를 저장하는 데 쿼리 도구가 필요하지 않아요.
  • 데이터베이스 연산의 지연 시간에 영향을 주지 않으므로 성능 영향이 없습니다.
  • 힙 메모리 사용은 가중 큐로 제한되며, 로깅 스레드 앞에 구성 가능한 최대 가중치가 있습니다.
  • 디스크 활용은 구성 가능한 크기로 제한되며, 한도에 도달하면 오래된 로그 세그먼트를 삭제합니다.
  • 시작 시 cassandra.yaml로, 런타임에는 JMX 도구인 nodetool로 활성화/비활성화할 수 있어요.
  • cassandra.yaml 파일 또는 nodetool로 설정을 구성할 수 있습니다.

오디트 로깅은 성공과 실패를 포함한 모든 CQL 요청을 포함해요. 또한 로그인 시도 같은 모든 성공·실패 인증 및 권한 부여 이벤트를 캡처합니다. 전체 쿼리 로깅(FQL)과 오디트 로깅의 차이는 FQL은 성공적인 CQL 요청만 캡처하므로 로그를 재생하거나 비교할 수 있다는 점이에요. 오디트 로그는 규정 준수(compliance)와 디버깅에 유용하고, FQL은 CQL 쿼리의 디버깅, 성능 벤치마킹, 테스트, 감사에 유용합니다.

출처: 문서

본문

기록되는 오디트 정보

오디트 로그에는 다음이 포함됩니다:

  • 구성된 키스페이스의 모든 이벤트(포함할 것)
  • 구성된 범주의 모든 이벤트(포함할 것)
  • 구성된 사용자가 실행한 모든 이벤트(포함할 것)

오디트 로그에는 다음이 포함되지 않아요:

  • cassandra.yaml 파일에서 변경된 구성
  • nodetool 명령
  • DCL 문의 일부로 언급된 비밀번호: 비밀번호는 *******로 난독화됩니다.
  • 파싱에 실패하는 문은 password 단어가 나타난 뒤의 모든 것이 *******로 난독화됩니다.
  • 'password' 단어를 잘못 입력한 문은 난독화 없이 기록됩니다. 재시도 시에는 다른 비밀번호를 사용하세요.

오디트 로그는 일련의 로그 항목입니다. 오디트 로그 항목에는 다음이 포함됩니다:

  • keyspace (String) - 요청이 이루어진 키스페이스
  • operation (String) - CQL 명령 같은 데이터베이스 연산
  • user (String) - 사용자 이름
  • scope (String) - Table/Function/Aggregate 이름 같은 요청 범위
  • type (AuditLogEntryType) - 요청 유형
    • CQL Audit Log Entry Type
    • Common Audit Log Entry Type
  • source (InetAddressAndPort) - 요청이 시작된 소스 IP 주소
  • timestamp (long) - 요청 타임스탬프
  • batch (UUID) - 요청의 배치
  • options (QueryOptions) - CQL 쿼리 옵션
  • state (QueryState) - 주어진 쿼리와 관련된 상태

각 항목은 주어진 이벤트에 적용 가능한 모든 속성을 포함하며 파이프(|)로 연결됩니다.

CQL 오디트 로그 항목 유형은 다음 CQL 명령입니다. 각 명령은 기록할 특정 지정 범주에 할당됩니다:

범주 CQL 명령
DDL ALTER_KEYSPACE, CREATE_KEYSPACE, DROP_KEYSPACE, ALTER_TABLE, CREATE_TABLE, DROP_TABLE, CREATE_FUNCTION, DROP_FUNCTION, CREATE_AGGREGATE, DROP_AGGREGATE, CREATE_INDEX, DROP_INDEX, ALTER_TYPE, CREATE_TYPE, DROP_TYPE, CREATE_TRIGGER, DROP_TRIGGER, ALTER_VIEW, CREATE_VIEW, DROP_VIEW, TRUNCATE
DML BATCH, DELETE, UPDATE
DCL GRANT, REVOKE, ALTER_ROLE, CREATE_ROLE, DROP_ROLE, LIST_ROLES, LIST_PERMISSIONS, LIST_USERS
OTHER USE_KEYSPACE
QUERY SELECT
PREPARE PREPARE_STATEMENT

공통 오디트 로그 항목 유형은 다음 중 하나입니다:

범주 CQL 명령
AUTH LOGIN_SUCCESS, LOGIN_ERROR, UNAUTHORIZED_ATTEMPT
ERROR REQUEST_FAILURE

가용성과 지속성

오디트 로그 항목은 데이터와 달리 복제되지 않습니다.

주어진 쿼리에 대해 해당 오디트 항목은 조정자 노드에만 저장됩니다. 예를 들어 복제 계수 3인 키스페이스의 INSERT는 요청을 처리한 조정자 노드 하나에만 오디트 항목을 만들지, 다른 두 노드에는 만들지 않아요. 이런 이유로, 그리고 충족해야 하는 규정 준수 요구 사항에 따라, 오디트 로그가 비휘발성(non-ephemeral) 저장소에 저장되는지 확인하세요.

archive_command 옵션으로 사용자 지정 요구를 달성할 수 있어요.

cassandra.yaml에서 오디트 로깅 구성

cassandra.yaml 파일로 오디트 로깅을 구성하고 활성화할 수 있어요. 구성과 활성화는 cassandra.yaml 파일 설정에 따라 각 노드에서 같을 수도 다를 수도 있습니다.

오디트 로깅은 nodetool로 기능을 활성화할 때도 구성할 수 있으며, 이는 nodetool로 오디트 로깅 활성화에서 논의하듯 cassandra.yaml 파일에 설정된 값을 덮어씁니다.

오디트 로그는 활성화된 각 노드에서 생성되므로 각 노드의 로그에는 그 노드의 쿼리가 있습니다. 오디트 로깅의 모든 옵션은 cassandra.yaml 파일의 audit_logging_options: 아래에 설정할 수 있어요.

파일에는 사용을 위해 주석을 해제할 수 있는 다음 옵션이 포함됩니다:

# Audit logging - Logs every incoming CQL command request, authentication to a node. See the docs
# on audit_logging for full details about the various configuration options.
audit_logging_options:
    enabled: false
    logger:
      - class_name: BinAuditLogger
    # audit_logs_dir:
    # included_keyspaces:
    # excluded_keyspaces: system, system_schema, system_virtual_schema
    # included_categories:
    # excluded_categories:
    # included_users:
    # excluded_users:
    # roll_cycle: HOURLY
    # block: true
    # max_queue_weight: 268435456 # 256 MiB
    # max_log_size: 17179869184 # 16 GiB
    ## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
    # archive_command:
    # max_archive_retries: 10

enabled

오디트 로깅을 활성화할지 비활성화할지(기본값) 제어합니다.

오디트 로깅을 활성화하려면 enabled: true로 설정하세요.

이 옵션이 활성화되면 Cassandra가 시작될 때 오디트 로깅이 시작됩니다. 이후 런타임에 nodetool로 비활성화할 수 있어요.

오디트 로깅이 활성화되어 있는지는 JMX MBean org.apache.cassandra.db:type=StorageServiceAuditLogEnabled 속성으로 모니터링할 수 있습니다.

logger

오디트 로거의 유형은 logger 옵션으로 설정합니다. 지원되는 값은:

  • BinAuditLogger (기본값)
  • FileAuditLogger
  • NoOpAuditLogger

BinAuditLogger는 이벤트를 바이너리 형식으로 파일에 기록합니다. FileAuditLogger는 표준 로깅 메커니즘인 slf4j를 사용해 이벤트를 audit/audit.log 파일에 기록해요. 동기식 파일 기반 오디트 로거입니다. roll_cyclelogback.xml 파일에 설정됩니다. NoOpAuditLogger는 오디트 로깅이 비활성화되었을 때 지정해야 하는 오디트 로거의 no-op 구현입니다.

예를 들어:

logger:
  - class_name: FileAuditLogger

BinAuditLogger는 내부적으로 오픈소스 Chronicle Queue를 사용합니다. 규제 준수 목적으로 오디트 로깅을 고려한다면 이 라이브러리를 어느 정도 알아두는 것이 현명할 수 있어요. 그 영향의 예는 archive_commandroll_cycle을 참고하세요.

audit_logs_dir

오디트 로그를 쓰려면 audit_logs_dir에 존재하는 디렉터리를 설정해야 해요.

디렉터리는 읽기, 쓰기, 실행을 허용하도록 적절한 권한이 설정되어 있어야 합니다. 로깅은 필요에 따라 디렉터리 내용을 재귀적으로 삭제할 거예요. 파일시스템의 다른 부분으로의 링크를 이 디렉터리에 두지 마세요. 예: audit_logs_dir: /non_ephemeral_storage/audit/logs/hourly.

오디트 로그 디렉터리는 시스템 속성 cassandra.logdir.audit로도 구성할 수 있으며, 기본값은 cassandra.logdir + /audit/입니다.

included_keyspaces 및 excluded_keyspaces

included_keyspaces 옵션으로 포함할 키스페이스를, excluded_keyspaces 옵션으로 제외할 키스페이스를 설정합니다. 기본적으로 system, system_schema, system_virtual_schema가 제외되고 다른 모든 키스페이스가 포함돼요.

예를 들어:

included_keyspaces: test, demo
excluded_keyspaces: system, system_schema, system_virtual_schema

included_categories 및 excluded_categories

포함할 데이터베이스 연산 범주는 included_categories 옵션으로 쉼표로 구분된 목록으로 지정합니다. 제외할 데이터베이스 연산 범주는 excluded_categories 옵션으로 쉼표로 구분된 목록으로 지정해요. 오디트 로그에 지원되는 범주는 AUTH, DCL, DDL, DML, ERROR, OTHER, PREPARE, QUERY입니다. 기본적으로 모든 지원 범주가 포함되고 제외되는 범주는 없어요.

included_categories: AUTH, ERROR, DCL
excluded_categories: DDL, DML, QUERY, PREPARE

included_users 및 excluded_users

오디트 로그에 기록할 사용자는 included_usersexcluded_users 옵션으로 설정합니다. included_users 옵션은 명시적으로 포함할 사용자의 쉼표로 구분된 목록을 지정하고, excluded_users 옵션은 명시적으로 제외할 사용자의 쉼표로 구분된 목록을 지정합니다. 기본적으로 모든 사용자가 포함되고 제외되는 사용자는 없어요.

included_users:
excluded_users: john, mary

roll_cycle

roll_cycle은 오디트 로그 세그먼트가 롤되는 빈도를 정의합니다. 지원되는 값은:

  • MINUTELY
  • FIVE_MINUTELY
  • TEN_MINUTELY
  • TWENTY_MINUTELY
  • HALF_HOURLY
  • HOURLY (기본값)
  • TWO_HOURLY
  • FOUR_HOURLY
  • SIX_HOURLY
  • DAILY

예를 들어: roll_cycle: DAILY

프로덕션 노드에서 roll_cycle을 변경할 때 다음 단락을 읽으세요.

BinLogger 구현에서는 이전에 오디트 로깅이 활성화된 노드에서 롤 주기를 수정하려는 시도가 Chronicle Queue의 롤 주기 추론 메커니즘 때문에(metadata.cq4t 파일을 삭제하더라도) 조용히 실패합니다.

이러한 재정의가 Cassandra 로그에 나타난 예는 다음과 같아요:

INFO  [main] <DATE TIME> BinLog.java:420 - Attempting to configure bin log: Path: /path/to/audit Roll cycle: TWO_HOURLY [...]
WARN  [main] <DATE TIME> SingleChronicleQueueBuilder.java:477 - Overriding roll cycle from TWO_HOURLY to FIVE_MINUTE

노드에서 roll_cycle을 변경하려면 다음을 해야 합니다:

  • Cassandra 중지
  • 모든 오디트 로그를 다른 곳(안전하고 지속적인 위치)으로 이동 또는 오프로드
  • Cassandra 재시작
  • Cassandra 로그 확인
  • audit_logs_dir 아래의 오디트 로그 파일 이름이 새 롤 주기에 해당하는지 확인

block

block 옵션은 오디트 로깅이 뒤처질 때 쓰기를 차단할지 로그 레코드를 버릴지 지정합니다. 지원되는 불리언 값은 true(기본값) 또는 false입니다.

예: 레코드를 버리려면 block: false(예: 오디트가 문제 해결에 사용될 때)

규정 준수 목적으로는 미래의 기본값 변경에 따른 회귀를 방지하기 위해 block: true를 명시적으로 설정하는 것이 좋은 관행입니다.

max_queue_weight

max_queue_weight 옵션은 파일에 쓰기 전에 차단하거나 버리기 전까지, 파일에 기록되기를 기다리는 레코드의 인메모리 큐 최대 가중치를 설정합니다. 양수 값으로 설정해야 해요. 기본값은 268435456, 즉 256 MiB입니다.

예를 들어 기본값을 바꾸려면: max_queue_weight: 134217728 # 128 MiB

max_log_size

max_log_size 옵션은 가장 오래된 파일을 삭제하기 전에 디스크에 보관할 롤된 파일의 최대 크기를 설정합니다. 양수 값으로 설정해야 해요. 기본값은 17179869184, 즉 16 GiB입니다. 예를 들어 기본값을 바꾸려면: max_log_size: 34359738368 # 32 GiB

archive_command 옵션이 설정된 경우 max_log_size는 무시됩니다.

archive_command

archive_command 옵션이 비어 있거나 설정되지 않으면(기본값) Cassandra는 max_log_size에 도달하면 가장 오래된 파일을 삭제하는 내장 DeletingArchiver를 사용합니다.

archive_command 옵션은 롤된 로그 파일에 대해 실행할 사용자 정의 아카이브 스크립트를 설정합니다. 예: archive_command: "/usr/local/bin/archiveit.sh %path"

%path는 롤되는 파일의 절대 파일 경로로 대체됩니다.

사용자 정의 스크립트를 사용하면 Cassandra가 DeletingArchiver를 사용하지 않으므로, 필요한 정리를 수행하는 것은 스크립트의 책임이에요.

Cassandra는 로그 파일이 롤되는 즉시 사용자 정의 스크립트를 호출합니다. 이는 Chronicle Queue의 QueueFileShrinkManager가 희소(sparse) 로그 파일을 축소할 수 없다는 뜻이에요(비동기로 이루어지기 때문). 다시 말해 실제 데이터가 몇 KB뿐이더라도 모든 로그 파일은 최소한 기본 블록 크기(80 MiB)만큼의 크기를 갖습니다. 결과적으로 Cassandra system.log에 몇 가지 경고가 나타납니다:

WARN  [main/queue~file~shrink~daemon] <DATE TIME> QueueFileShrinkManager.java:63 - Failed to shrink file as it exists no longer, file=/path/to/xxx.cq4

Cassandra가 Pretoucher를 사용하지 않으므로, chronicle.queue.synchronousFileShrinking JVM 속성으로 Chronicle Queue가 파일을 동기적으로 — 즉 파일이 롤되는 즉시 — 축소하도록 구성할 수 있습니다. 예를 들어 cassandra-env.sh 끝에 다음 줄을 추가할 수 있어요: JVM_OPTS="$JVM_OPTS -Dchronicle.queue.synchronousFileShrinking=true"

max_archive_retries

max_archive_retries 옵션은 실패한 아카이브 명령의 최대 재시도 횟수를 설정합니다. 기본값은 10이에요.

예를 들어: max_archive_retries: 10

각 재시도 사이의 간격은 5분으로 하드코딩되어 있습니다.

nodetool로 오디트 로깅 활성화

오디트 로깅은 nodetool enableauditlog 명령으로 노드별로 활성화됩니다. 로깅 디렉터리는 cassandra.yaml 파일의 audit_logs_dir로 정의하거나 기본값 cassandra.logdir.audit를 사용해야 해요.

nodetool enableauditlog 명령의 문법에는 audit_logs_dir을 제외하고 cassandra.yaml 파일에 설정할 수 있는 것과 동일한 모든 옵션이 있습니다. 또한 nodetool에는 명령을 실행할 호스트와 포트, 명령에 인증이 필요할 경우 사용자 이름과 비밀번호를 설정하는 옵션이 있어요.

       nodetool [(-h <host> | --host <host>)] [(-p <port> | --port <port>)]
                [(-pp | --print-port)] [(-pw <password> | --password <password>)]
                [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
                [(-u <username> | --username <username>)] enableauditlog
                [--excluded-categories <excluded_categories>]
                [--excluded-keyspaces <excluded_keyspaces>]
                [--excluded-users <excluded_users>]
                [--included-categories <included_categories>]
                [--included-keyspaces <included_keyspaces>]
                [--included-users <included_users>] [--logger <logger>]

OPTIONS
        --excluded-categories <excluded_categories>
            Comma separated list of Audit Log Categories to be excluded for
            audit log. If not set the value from cassandra.yaml will be used

        --excluded-keyspaces <excluded_keyspaces>
            Comma separated list of keyspaces to be excluded for audit log. If
            not set the value from cassandra.yaml will be used

        --excluded-users <excluded_users>
            Comma separated list of users to be excluded for audit log. If not
            set the value from cassandra.yaml will be used

        -h <host>, --host <host>
            Node hostname or ip address

        --included-categories <included_categories>
            Comma separated list of Audit Log Categories to be included for
            audit log. If not set the value from cassandra.yaml will be used

        --included-keyspaces <included_keyspaces>
            Comma separated list of keyspaces to be included for audit log. If
            not set the value from cassandra.yaml will be used

        --included-users <included_users>
            Comma separated list of users to be included for audit log. If not
            set the value from cassandra.yaml will be used

        --logger <logger>
            Logger name to be used for AuditLogging. Default BinAuditLogger. If
            not set the value from cassandra.yaml will be used

        -p <port>, --port <port>
            Remote jmx agent port number

        -pp, --print-port
            Operate in 4.0 mode with hosts disambiguated by port number

        -pw <password>, --password <password>
            Remote jmx agent password

        -pwf <passwordFilePath>, --password-file <passwordFilePath>
            Path to the JMX password file

        -u <username>, --username <username>
            Remote jmx agent username

오디트 로깅을 활성화하려면 로깅을 활성화하려는 클러스터의 각 노드에서 다음 명령을 실행하세요:

$ nodetool enableauditlog

오디트 로깅 비활성화

nodetool disableauditlog 명령으로 오디트 로깅을 비활성화하세요.

오디트 로그 보기

auditlogviewer 도구는 로거가 BinAuditLogger인 경우 오디트 로그를 보는(dump) 데 사용합니다. auditlogviewer는 바이너리 로그 파일을 사람이 읽을 수 있는 형식으로 변환합니다. 명령줄 옵션으로 오디트 로그 디렉터리만 제공하면 돼요. 로거가 FileAuditLogger로 설정되었다면 로그 파일이 이미 사람이 읽을 수 있는 형식이므로 파일을 읽는 데 auditlogviewer가 필요하지 않아요.

auditlogviewer의 문법은:

auditlogviewer

Audit log files directory path is a required argument.
usage: auditlogviewer <path1> [<path2>...<pathN>] [options]
--
View the audit log contents in human readable format
--
Options are:
-f,--follow       Upon reaching the end of the log continue indefinitely
                  waiting for more records
-h,--help         display this help message
-r,--roll_cycle   How often to roll the log file was rolled. May be
                  necessary for Chronicle to correctly parse file names. (MINUTELY, HOURLY,
                  DAILY). Default HOURLY.

예제

  • 오디트 로깅을 시연하려면 먼저 cassandra.yaml 파일을 다음 설정으로 구성하세요:
audit_logging_options:
   enabled: true
   logger: BinAuditLogger
   audit_logs_dir: "/cassandra/audit/logs/hourly"
   # included_keyspaces:
   # excluded_keyspaces: system, system_schema, system_virtual_schema
   # included_categories:
   # excluded_categories:
   # included_users:
   # excluded_users:
   roll_cycle: HOURLY
   # block: true
   # max_queue_weight: 268435456 # 256 MiB
   # max_log_size: 17179869184 # 16 GiB
   ## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
   # archive_command:
   # max_archive_retries: 10
  • 오디트 로그 디렉터리 /cassandra/audit/logs/hourly를 만들고 디렉터리 권한을 모두에게 읽기, 쓰기, 실행으로 설정하세요.

  • 이제 cqlsh로 데모 키스페이스와 테이블을 만들고 데이터를 삽입하세요:

 cqlsh> CREATE KEYSPACE auditlogkeyspace
   ... WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
 cqlsh> USE auditlogkeyspace;
 cqlsh:auditlogkeyspace> CREATE TABLE t (
 ...id int,
 ...k int,
 ...v text,
 ...PRIMARY KEY (id)
 ... );
 cqlsh:auditlogkeyspace> INSERT INTO t (id, k, v) VALUES (0, 0, 'val0');
 cqlsh:auditlogkeyspace> INSERT INTO t (id, k, v) VALUES (0, 1, 'val1');

지원되는 모든 CQL 명령이 오디트 로그 디렉터리에 기록됩니다.

  • 오디트 로그 디렉터리로 변경하세요.
$ cd /cassandra/audit/logs/hourly
  • 오디트 로그 파일과 디렉터리를 나열하세요.
$ ls -l

다음과 유사한 결과가 보여야 합니다:

total 28
-rw-rw-r--. 1 ec2-user ec2-user    65536 Aug  2 03:01 directory-listing.cq4t
-rw-rw-r--. 1 ec2-user ec2-user 83886080 Aug  2 03:01 20190802-02.cq4
-rw-rw-r--. 1 ec2-user ec2-user 83886080 Aug  2 03:01 20190802-03.cq4

오디트 로그 파일은 모두 .cq4 파일 유형으로 나열됩니다. 오디트 디렉터리는 .cq4t 유형입니다.

  • auditlogviewer 도구를 실행해 오디트 로그를 보세요.
$ auditlogviewer /cassandra/audit/logs/hourly

이 명령은 로그의 읽을 수 있는 버전을 반환합니다. 이 데모의 명령에 대한 로그의 부분 샘플은 다음과 같아요:

WARN  03:12:11,124 Using Pauser.sleepy() as not enough processors, have 2, needs 8+
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/127.0.0.1|port:46264|timestamp:1564711427328|type :USE_KEYSPACE|category:OTHER|ks:auditlogkeyspace|operation:USE AuditLogKeyspace;
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/127.0.0.1|port:46264|timestamp:1564711427329|type :USE_KEYSPACE|category:OTHER|ks:auditlogkeyspace|operation:USE "auditlogkeyspace"
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/127.0.0.1|port:46264|timestamp:1564711446279|type :SELECT|category:QUERY|ks:auditlogkeyspace|scope:t|operation:SELECT * FROM t;
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/127.0.0.1|port:46264|timestamp:1564713878834|type :DROP_TABLE|category:DDL|ks:auditlogkeyspace|scope:t|operation:DROP TABLE IF EXISTS
AuditLogKeyspace.t;
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/3.91.56.164|port:42382|timestamp:1564714618360|ty
pe:REQUEST_FAILURE|category:ERROR|operation:CREATE KEYSPACE AuditLogKeyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};; Cannot add
existing keyspace "auditlogkeyspace"
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/127.0.0.1|port:46264|timestamp:1564714690968|type :DROP_KEYSPACE|category:DDL|ks:auditlogkeyspace|operation:DROP KEYSPACE AuditLogKeyspace;
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/3.91.56.164|port:42406|timestamp:1564714708329|ty pe:CREATE_KEYSPACE|category:DDL|ks:auditlogkeyspace|operation:CREATE KEYSPACE
AuditLogKeyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
Type: AuditLog
LogMessage:
user:anonymous|host:10.0.2.238:7000|source:/127.0.0.1|port:46264|timestamp:1564714870678|type :USE_KEYSPACE|category:OTHER|ks:auditlogkeyspace|operation:USE auditlogkeyspace;

Password obfuscation examples:
LogMessage: user:cassandra|host:localhost/127.0.0.1:7000|source:/127.0.0.1|port:65282|timestamp:1622630496708|type:CREATE_ROLE|category:DCL|operation:CREATE ROLE role1 WITH PASSWORD = '*******';
Type: audit
LogMessage: user:cassandra|host:localhost/127.0.0.1:7000|source:/127.0.0.1|port:65282|timestamp:1622630634552|type:ALTER_ROLE|category:DCL|operation:ATLER ROLE role1 WITH PASSWORD = '*******';
Type: audit
LogMessage: user:cassandra|host:localhost/127.0.0.1:7000|source:/127.0.0.1|port:65282|timestamp:1622630698686|type:CREATE_ROLE|category:DCL|operation:CREATE USER user1 WITH PASSWORD '*******';
Type: audit
LogMessage: user:cassandra|host:localhost/127.0.0.1:7000|source:/127.0.0.1|port:65282|timestamp:1622630747344|type:ALTER_ROLE|category:DCL|operation:ALTER USER user1 WITH PASSWORD '*******';

사용자 오디트 로깅을 위한 진단 이벤트

네이티브 전송을 활성화한 모든 클라이언트는 클러스터 문제 진단을 위해 오디트 로그 이벤트를 구독할 수 있어요. 이 이벤트는 Cassandra 사용자 감사 솔루션을 구현하기 위해 외부 도구가 소비할 수 있습니다.

더 알아보기 (Learn more)