Skip to content

(refactored branch) Pattern matching with '%' character is not supported. #45

@harada-toshi

Description

@harada-toshi

Overview

  • Pattern matching with '%' character is not supported
  • In Readme.md '%' with the character, it has been described as a possible backward match or forward match.

In the value '%' can be used for backward match or forward match.

  • If pattern matching is not supported, it is necessary to modify Readme.md.

Config file

[output]
        logger = 'serverlog'

# SQL(1)
[rule]
        class = 'READ,WRITE'
        object_name = 'public.f%'

# SQL(2)
[rule]
        class = 'READ,WRITE'
        object_name = 'public.f%,b%,public.baz%'

# SQL(3)
[rule]
        class = 'READ,WRITE'
        object_name = 'ba%,public.baz%,public.fo%'

Executed SQL

-- create objects
CREATE TABLE IF NOT EXISTS foo(id int, data text);
CREATE TABLE IF NOT EXISTS bar(id int, data text);
BEGIN;
INSERT INTO foo VALUES (1, 'aaa');
INSERT INTO bar VALUES (1, 'xxx');
UPDATE foo SET data = 'AAA' WHERE id = 1;
UPDATE bar SET data = 'XXX' WHERE id = 1;
SELECT * FROM foo;
SELECT * FROM bar;
DELETE FROM foo;
DELETE FROM bar;
TRUNCATE foo;
TRUNCATE bar;
COMMIT;
DROP TABLE foo;
DROP TABLE bar;

Log.

LOG:  connection received: host=[local]
LOG:  connection authorized: user=postgres database=postgres
LOG:  disconnection: session time: 0:00:00.060 user=postgres database=postgres host=[local]
  • Since no pattern match evaluation is performed, all audit logs are not output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions