1SECURITY LABEL(7) PostgreSQL 9.2.24 Documentation SECURITY LABEL(7)
2
3
4
6 SECURITY_LABEL - define or change a security label applied to an object
7
9 SECURITY LABEL [ FOR provider ] ON
10 {
11 TABLE object_name |
12 COLUMN table_name.column_name |
13 AGGREGATE agg_name (agg_type [, ...] ) |
14 DATABASE object_name |
15 DOMAIN object_name |
16 FOREIGN TABLE object_name
17 FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) |
18 LARGE OBJECT large_object_oid |
19 [ PROCEDURAL ] LANGUAGE object_name |
20 ROLE object_name |
21 SCHEMA object_name |
22 SEQUENCE object_name |
23 TABLESPACE object_name |
24 TYPE object_name |
25 VIEW object_name
26 } IS 'label'
27
29 SECURITY LABEL applies a security label to a database object. An
30 arbitrary number of security labels, one per label provider, can be
31 associated with a given database object. Label providers are loadable
32 modules which register themselves by using the function
33 register_label_provider.
34
35 Note
36 register_label_provider is not an SQL function; it can only be
37 called from C code loaded into the backend.
38
39 The label provider determines whether a given label is valid and
40 whether it is permissible to assign that label to a given object. The
41 meaning of a given label is likewise at the discretion of the label
42 provider. PostgreSQL places no restrictions on whether or how a label
43 provider must interpret security labels; it merely provides a mechanism
44 for storing them. In practice, this facility is intended to allow
45 integration with label-based mandatory access control (MAC) systems
46 such as SE-Linux. Such systems make all access control decisions based
47 on object labels, rather than traditional discretionary access control
48 (DAC) concepts such as users and groups.
49
51 object_name, table_name.column_name, agg_name, function_name
52 The name of the object to be labeled. Names of tables, aggregates,
53 domains, foreign tables, functions, sequences, types, and views can
54 be schema-qualified.
55
56 provider
57 The name of the provider with which this label is to be associated.
58 The named provider must be loaded and must consent to the proposed
59 labeling operation. If exactly one provider is loaded, the provider
60 name may be omitted for brevity.
61
62 arg_type
63 An input data type on which the aggregate function operates. To
64 reference a zero-argument aggregate function, write * in place of
65 the list of input data types.
66
67 argmode
68 The mode of a function argument: IN, OUT, INOUT, or VARIADIC. If
69 omitted, the default is IN. Note that SECURITY LABEL ON FUNCTION
70 does not actually pay any attention to OUT arguments, since only
71 the input arguments are needed to determine the function's
72 identity. So it is sufficient to list the IN, INOUT, and VARIADIC
73 arguments.
74
75 argname
76 The name of a function argument. Note that SECURITY LABEL ON
77 FUNCTION does not actually pay any attention to argument names,
78 since only the argument data types are needed to determine the
79 function's identity.
80
81 argtype
82 The data type(s) of the function's arguments (optionally
83 schema-qualified), if any.
84
85 large_object_oid
86 The OID of the large object.
87
88 PROCEDURAL
89 This is a noise word.
90
91 label
92 The new security label, written as a string literal; or NULL to
93 drop the security label.
94
96 The following example shows how the security label of a table might be
97 changed.
98
99 SECURITY LABEL FOR selinux ON TABLE mytable IS 'system_u:object_r:sepgsql_table_t:s0';
100
102 There is no SECURITY LABEL command in the SQL standard.
103
105 sepgsql, dummy_seclabel
106
107
108
109PostgreSQL 9.2.24 2017-11-06 SECURITY LABEL(7)