バージョンごとのドキュメント一覧

SECURITY LABEL

SECURITY LABEL <refpurpose>define or change a security label applied to an object</refpurpose> — オブジェクトに適用するセキュリティラベルを定義または変更する

概要

SECURITY LABEL [ FOR provider ] ON
{
  TABLE object_name |
  COLUMN table_name.column_name |
  AGGREGATE aggregate_name ( aggregate_signature ) |
  DATABASE object_name |
  DOMAIN object_name |
  EVENT TRIGGER object_name |
  FOREIGN TABLE object_name
  FUNCTION function_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
  LARGE OBJECT large_object_oid |
  MATERIALIZED VIEW object_name |
  [ PROCEDURAL ] LANGUAGE object_name |
  PROCEDURE procedure_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
  PUBLICATION object_name |
  ROLE object_name |
  ROUTINE routine_name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] |
  SCHEMA object_name |
  SEQUENCE object_name |
  SUBSCRIPTION object_name |
  TABLESPACE object_name |
  TYPE object_name |
  VIEW object_name
} IS { string_literal | NULL }


<phrase>where <replaceable>aggregate_signature</replaceable> is:</phrase>

ここでaggregate_signatureは以下の通りです。

* |
[ argmode ] [ argname ] argtype [ , ... ] |
[ [ argmode ] [ argname ] argtype [ , ... ] ] ORDER BY [ argmode ] [ argname ] argtype [ , ... ]

説明

<title>Description</title>

<command>SECURITY LABEL</command> applies a security label to a database object. An arbitrary number of security labels, one per label provider, can be associated with a given database object. Label providers are loadable modules which register themselves by using the function <function>register_label_provider</function>. SECURITY LABELはセキュリティラベルをデータベースオブジェクトに適用します。 ラベルプロバイダごとに1つの、任意の数のセキュリティラベルを指定したデータベースオブジェクトに関連付けることができます。 ラベルプロバイダは、register_label_provider関数を使用して自身を登録する、ロード可能なモジュールです。

注記

<function>register_label_provider</function> is not an SQL function; it can only be called from C code loaded into the backend. register_label_providerはSQL関数ではありません。 バックエンドにロードされたCコードからのみ呼び出すことができます。

The label provider determines whether a given label is valid and whether it is permissible to assign that label to a given object. The meaning of a given label is likewise at the discretion of the label provider. <productname>PostgreSQL</productname> places no restrictions on whether or how a label provider must interpret security labels; it merely provides a mechanism for storing them. In practice, this facility is intended to allow integration with label-based mandatory access control (MAC) systems such as <productname>SELinux</productname>. Such systems make all access control decisions based on object labels, rather than traditional discretionary access control (DAC) concepts such as users and groups. ラベルプロバイダは、指定されたラベルが有効かどうか、および指定されたオブジェクトにラベルを割り当てることが許されているかどうかを決定します。 また、ラベルプロバイダは指定されたラベルの意味の決定権を持ちます。 PostgreSQLは、ラベルプロバイダがセキュリティラベルを解釈するかしないか、どのように解釈するかに関して制限を持ちません。 単にこれらを格納するための機構を提供するだけです。 実際には、この機能はSELinuxなどのラベルベースの強制アクセス制御(MAC)システムと統合できるようにすることを意図したものです。 こうしたシステムでは、すべてのアクセス制御の決定は、ユーザとグループなどの伝統的な任意アクセス制御(DAC)という考えではなく、オブジェクトラベルに基づいて行われます。

パラメータ

<title>Parameters</title>
object_name
table_name.column_name
aggregate_name
function_name
procedure_name
routine_name

The name of the object to be labeled. Names of objects that reside in schemas (tables, functions, etc.) can be schema-qualified. ラベル付けされるオブジェクトの名前です。 スキーマの中にあるオブジェクト(テーブル、関数など)の名前はスキーマ修飾可能です。

provider

The name of the provider with which this label is to be associated. The named provider must be loaded and must consent to the proposed labeling operation. If exactly one provider is loaded, the provider name may be omitted for brevity. このラベルが関連するプロバイダの名前です。 指定されたプロバイダはロードされていなければならず、かつ、提供されるラベル付け操作と一致しなければなりません。 プロバイダが1つだけロードされていた場合、プロバイダの名前を省略して簡略化することができます。

argmode

The mode of a function, procedure, or aggregate argument: <literal>IN</literal>, <literal>OUT</literal>, <literal>INOUT</literal>, or <literal>VARIADIC</literal>. If omitted, the default is <literal>IN</literal>. Note that <command>SECURITY LABEL</command> does not actually pay any attention to <literal>OUT</literal> arguments, since only the input arguments are needed to determine the function's identity. So it is sufficient to list the <literal>IN</literal>, <literal>INOUT</literal>, and <literal>VARIADIC</literal> arguments. 関数、プロシージャ、または集約の引数のモードです。 INOUTINOUTVARIADICのいずれかです。 省略された場合のデフォルトはINです。 関数の識別を決定するためには入力引数のみが必要ですので、実際にはSECURITY LABELOUTをまったく考慮しないことに注意してください。 このためININOUTVARIADICのリストで十分です。

argname

The name of a function, procedure, or aggregate argument. Note that <command>SECURITY LABEL</command> does not actually pay any attention to argument names, since only the argument data types are needed to determine the function's identity. 関数、プロシージャ、または集約の引数の名前です。 関数の識別を決定するためには引数のデータ型のみが必要ですので、実際にはSECURITY LABEL ON FUNCTIONは引数名をまったく考慮しないことに注意してください。

argtype

The data type of a function, procedure, or aggregate argument. 関数、プロシージャ、または集約の引数のデータ型です。

large_object_oid

The OID of the large object. ラージオブジェクトのOIDです。

PROCEDURAL

This is a noise word. これは意味がない単語です。

string_literal

The new setting of the security label, written as a string literal. 文字列リテラルで記述されたセキュリティラベルの新しい設定です。

NULL

Write <literal>NULL</literal> to drop the security label. セキュリティラベルを削除するためにはNULLと記述します。

<title>Examples</title>

The following example shows how the security label of a table could be set or changed: 以下の例はテーブルのセキュリティラベルを設定または変更する方法を示しています。

SECURITY LABEL FOR selinux ON TABLE mytable IS 'system_u:object_r:sepgsql_table_t:s0';

To remove the label: ラベルを削除するには以下のようにします。

SECURITY LABEL FOR selinux ON TABLE mytable IS NULL;

互換性

<title>Compatibility</title>

There is no <command>SECURITY LABEL</command> command in the SQL standard. 標準SQLにはSECURITY LABELコマンドはありません。

関連項目

<title>See Also</title> sepgsql, src/test/modules/dummy_seclabel