Skip to content
Snippets Groups Projects
  1. Mar 06, 2024
  2. Nov 24, 2023
    • Dmitry Ivanov's avatar
      feat(audit): remove irrelevant fields from log entries · e27a0b47
      Dmitry Ivanov authored
      Now the records look like this:
      
      ```
      {
        "message": "instance is starting",
        "severity": "low",
        "time": "2023-11-22T22:10:24.211+0300",
        "title": "local_startup"
      }
      {
        "message": "target grade of instance `i1` changed to Online(7)",
        "severity": "low",
        "time": "2023-11-22T22:10:24.334+0300",
        "title": "change_target_grade"
      }
      {
        "message": "current grade of instance `i1` changed to Replicated(7)",
        "severity": "medium",
        "time": "2023-11-22T22:10:24.436+0300",
        "title": "change_current_grade"
      }
      ```
      e27a0b47
  3. Nov 17, 2023
    • Dmitry Ivanov's avatar
      feat(audit): change audit log format from plain to json · f3364158
      Dmitry Ivanov authored
      This patch changes the way audit records are formatted. Previously
      we would format them as plain strings (we still do that in tlog),
      now we use json to store all KV pairs including the message.
      
      TODO: optimize string allocations using a stream formatter.
      
      Example:
      
      ```
      {
        "time": "2023-11-16T22:48:08.297+0300",
        "level": "WARN",
        "auth_type": "chap-sha1",
        "message": "created user `idris`",
        "title": "create_user",
        "pid": 66625,
        "cord_name": "main",
        "fiber_id": 111,
        "fiber_name": "raft_main_loop",
        "file": "src/storage.rs",
        "line": 2633
      }
      ```
      f3364158
  4. Nov 10, 2023
    • Dmitry Ivanov's avatar
      feat: implement audit log (initial patch) · ba967f50
      Dmitry Ivanov authored and Yaroslav Dynnikov's avatar Yaroslav Dynnikov committed
      Implemented:
      
      - features:
          * FFI wrappers for `say.{h,c}`
          * safe logger object on top of FFI definitions
          * unified tlog/audit definitions for formatting
          * fixed a needless allocation in tlog (new root per each line)
      
      - events:
          * create_user
          * drop_user
          * create_role
          * drop_role
          * change_password
          * grant_privilege
          * revoke_privilege
          * create_table
          * drop_table
          * grant_role
          * revoke_role
      
      Todo:
      
      - features:
          * unique id generation
          * security subject (who executed the action)
          * audit configuration (via `pico.audit` function)
      
      - well-defined events:
          * create_database (universe)
          * change_config
          * change_current_grade
      
      - special events (local to each node):
          * auth_ok / auth_fail
          * access_denied (still not sure if we absolutely need that)
          * audit_rotate
      
      - Unavailable (haven't been defined yet):
          * rename_user
          * create_procedure
          * drop_procedure
      
      Example:
      
      ```
      $ cat /tmp/audit.log
      2023-11-10 12:07:19.457 [15735] main/103/interactive I> audit log is ready, title: initialize_audit
      2023-11-10 12:07:19.457 [15735] main/103/interactive I> database is starting, title: startup
      2023-11-10 12:07:19.818 [15741] main/103/interactive I> audit log is ready, title: initialize_audit
      2023-11-10 12:07:19.818 [15741] main/103/interactive I> database is starting, title: startup
      2023-11-10 12:07:34.910 [15741] main/111/raft_main_loop storage.rs:2809 W> created user `KEK`, auth_type: chap-sha1, title: create_user
      2023-11-10 12:07:52.869 [15741] main/111/raft_main_loop storage.rs:2861 W> created role `mgr`, title: create_role
      2023-11-10 12:07:55.602 [15741] main/111/raft_main_loop storage.rs:2861 W> created role `kek`, title: create_role
      2023-11-10 12:07:57.594 [15741] main/111/raft_main_loop storage.rs:2906 W> granted role `mgr` to role `kek`, title: grant_role
      2023-11-10 12:08:08.482 [15741] main/111/raft_main_loop storage.rs:2913 W> granted privilege execute on universe `` to role `kek`, title: grant_privilege
      ```
      ba967f50
  5. Nov 03, 2023
  6. Oct 31, 2022
  7. Aug 16, 2022
    • Georgy Moshkin's avatar
      feat: now can highlight relevant parts of logs · 69f89b4c
      Georgy Moshkin authored
      To highlight all the logging messages containing the given key do this:
      * rust: `tlog::highlight_key(log_key, Some(color))`.
      * lua: `picolib.log.highlight_key(log_key, color)`.
      
      To disable highlight for the given key do this:
      * rust: `tlog::highlight_key(log_key, None)`.
      * lua: `picolib.log.highlight_key(log_key)`.
      
      To disable highlighting of all keys do this:
      * rust: `tlog::clear_highlight()`.
      * lua: `picolib.log.clear_highlight()`.
      69f89b4c
    • Georgy Moshkin's avatar
      chore: fix clippy warnings · 6a859116
      Georgy Moshkin authored
      6a859116
  8. Feb 18, 2022
    • Georgy Moshkin's avatar
      build: static linking with tarantool · f77d1e5d
      Georgy Moshkin authored
      + tarantool-sys submodule
      + tarantool-patches directory
      + build.rs build script to patch and build tarantool
      + static linking with tarantool
      + refactoring for cli arguments
      f77d1e5d
  9. Jan 18, 2022
Loading