|
3 | 3 | --
|
4 | 4 | LOAD '$libdir/sepgsql'; -- failed
|
5 | 5 | ERROR: SELinux: LOAD is not permitted
|
| 6 | +-- |
| 7 | +-- Permissions to execute functions |
| 8 | +-- |
| 9 | +CREATE TABLE t1 (x int, y text); |
| 10 | +INSERT INTO t1 (SELECT x, md5(x::text) FROM generate_series(1,100) x); |
| 11 | +SET sepgsql.debug_audit = on; |
| 12 | +SET client_min_messages = log; |
| 13 | +-- regular function and operators |
| 14 | +SELECT * FROM t1 WHERE x > 50 AND y like '%64%'; |
| 15 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_table name="public.t1" |
| 16 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="table t1 column x" |
| 17 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="table t1 column y" |
| 18 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function int4gt(integer,integer)" |
| 19 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function textlike(text,text)" |
| 20 | + x | y |
| 21 | +-----+---------------------------------- |
| 22 | + 77 | 28dd2c7955ce926456240b2ff0100bde |
| 23 | + 89 | 7647966b7343c29048673252e490f736 |
| 24 | + 90 | 8613985ec49eb8f757ae6439e879bb2a |
| 25 | + 91 | 54229abfcfa5649e7003b83dd4755294 |
| 26 | + 99 | ac627ab1ccbdb62ec96e702f07f6425b |
| 27 | + 100 | f899139df5e1059396431415e770c6dd |
| 28 | +(6 rows) |
| 29 | + |
| 30 | +-- aggregate function |
| 31 | +SELECT MIN(x), AVG(x) FROM t1; |
| 32 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_table name="public.t1" |
| 33 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="table t1 column x" |
| 34 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function avg(integer)" |
| 35 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function int4_avg_accum(bigint[],integer)" |
| 36 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function int8_avg(bigint[])" |
| 37 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function min(integer)" |
| 38 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function int4smaller(integer,integer)" |
| 39 | + min | avg |
| 40 | +-----+--------------------- |
| 41 | + 1 | 50.5000000000000000 |
| 42 | +(1 row) |
| 43 | + |
| 44 | +-- window function |
| 45 | +SELECT row_number() OVER (order by x), * FROM t1 WHERE y like '%86%'; |
| 46 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_table name="public.t1" |
| 47 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="table t1 column x" |
| 48 | +LOG: SELinux: allowed { select } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column name="table t1 column y" |
| 49 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function row_number()" |
| 50 | +LOG: SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sepgsql_proc_exec_t:s0 tclass=db_procedure name="function textlike(text,text)" |
| 51 | + row_number | x | y |
| 52 | +------------+----+---------------------------------- |
| 53 | + 1 | 2 | c81e728d9d4c2f636f067f89cc14862c |
| 54 | + 2 | 17 | 70efdf2ec9b086079795c442636b55fb |
| 55 | + 3 | 22 | b6d767d2f8ed5d21a44b0e5886680cb9 |
| 56 | + 4 | 27 | 02e74f10e0327ad868d138f2b4fdd6f0 |
| 57 | + 5 | 33 | 182be0c5cdcd5072bb1864cdee4d3d6e |
| 58 | + 6 | 43 | 17e62166fc8586dfa4d1bc0e1742c08b |
| 59 | + 7 | 54 | a684eceee76fc522773286a895bc8436 |
| 60 | + 8 | 73 | d2ddea18f00665ce8623e36bd4e3c7c5 |
| 61 | + 9 | 76 | fbd7939d674997cdb4692d34de8633c4 |
| 62 | + 10 | 89 | 7647966b7343c29048673252e490f736 |
| 63 | + 11 | 90 | 8613985ec49eb8f757ae6439e879bb2a |
| 64 | + 12 | 94 | f4b9ec30ad9f68f89b29639786cb62ef |
| 65 | +(12 rows) |
| 66 | + |
| 67 | +RESET sepgsql.debug_audit; |
| 68 | +RESET client_min_messages; |
| 69 | +-- |
| 70 | +-- Cleanup |
| 71 | +-- |
| 72 | +DROP TABLE IF EXISTS t1 CASCADE; |
0 commit comments