Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
d0ed9efd
Commit
d0ed9efd
authored
13 years ago
by
Robert Haas
Browse files
Options
Downloads
Patches
Plain Diff
Copy editing of sepgsql documentation.
parent
523176cb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/sepgsql.sgml
+54
-58
54 additions, 58 deletions
doc/src/sgml/sepgsql.sgml
with
54 additions
and
58 deletions
doc/src/sgml/sepgsql.sgml
+
54
−
58
View file @
d0ed9efd
...
@@ -192,9 +192,9 @@ sepgsql-regtest 1.04
...
@@ -192,9 +192,9 @@ sepgsql-regtest 1.04
<para>
<para>
Third, turn on <literal>sepgsql_regression_test_mode</>.
Third, turn on <literal>sepgsql_regression_test_mode</>.
We don't enable all
the rules in <filename>sepgsql-regtest</>
For security reasons,
the rules in <filename>sepgsql-regtest</>
by default, for your system's safety.
are not enabled by default;
T
he <literal>sepgsql_regression_test_mode</literal> parameter enables
t
he <literal>sepgsql_regression_test_mode</literal> parameter enables
the rules needed to launch the regression tests.
the rules needed to launch the regression tests.
It can be turned on using the <command>setsebool</> command:
It can be turned on using the <command>setsebool</> command:
</para>
</para>
...
@@ -415,43 +415,38 @@ UPDATE t1 SET x = 2, y = md5sum(y) WHERE z = 100;
...
@@ -415,43 +415,38 @@ UPDATE t1 SET x = 2, y = md5sum(y) WHERE z = 100;
<title>DDL Permissions</title>
<title>DDL Permissions</title>
<para>
<para>
<productname>SELinux</> defines several permissions to control common
<productname>SELinux</> defines several permissions to control common
operations for each object type
s
; such as creation, alter, drop and
operations for each object type; such as creation, alter, drop and
relabel of security label. In addition, several object types ha
s its
relabel of security label. In addition, several object types ha
ve
special permissions to control
its
characteristic operations; such as
special permissions to control
their
characteristic operations; such as
addition or deletion of name entries
underly
in
g
a particular schema.
addition or deletion of name entries
with
in a particular schema.
</para>
</para>
<para>
<para>
When <literal>CREATE</> command is executed, <literal>create</> will
When
a
<literal>CREATE</> command is executed, <literal>create</> will
be checked on the object being constructed for each object types.
be checked on the object being constructed for each object types.
A default security label
sha
ll be assigned o
n
the new database object,
A default security label
wi
ll be assigned
t
o the new database object,
and the <literal>create</> permission
needs to be allow
ed on the pair
and the <literal>create</> permission
will be check
ed on the pair
of security label of the client and the new object itself.
of security label of the client and the new object itself.
We consider <xref linkend="sql-createtable"> construct a table and
We consider <xref linkend="sql-createtable">
to
construct a table and
underlying columns at the same time, so it requires users
permission
underlying columns at the same time, so it requires
the
users
to have
to create both
of
table and columns.
permission
to create both
the
table and
its
columns.
</para>
</para>
<para>
<para>
A few additional checks are applied depending on object types.
A few additional checks are applied depending on object types.
On <xref linkend="sql-createdatabase">, <literal>getattr</> permission
On <xref linkend="sql-createdatabase">, <literal>getattr</> permission
sha
ll be checked on the source or template database of the new database,
wi
ll be checked on the source or template database of the new database,
not only <literal>create</> on the new database.
not only <literal>create</> on the new database.
On creation of objects
underly
in
g
a particula schema (tables, views,
On creation of objects
with
in a particula schema (tables, views,
sequences and procedures), <literal>add_name</>
sha
ll be also chechked
sequences and procedures), <literal>add_name</>
wi
ll be also chechked
on the schema, not only <literal>create</> on the new object itself.
on the schema, not only <literal>create</> on the new object itself.
</para>
</para>
<para>
<para>
When <literal>DROP</> command is executed, <literal>drop</> will be
When <literal>DROP</> command is executed, <literal>drop</> will be
checked on the object being removed for each object types.
checked on the object being removed for each object types. Permissions
Please note that it shall not be checked on the objects removed by
will not be checked for objects dropped indirectly via <literal>CASCADE</>.
cascaded deletion according to the standard manner in SQL.
Deletion of objects contained within a particular schema (tables, views,
</para>
sequences and procedures) additionally requires
<para>
<literal>remove_name</> on the schema.
A few additional checks are applied depending on object types.
On deletion of objects underlying a particula schema (tables, views,
sequences and procedures), <literal>remove_name</> shall be also checked
on the schema, not only <literal>drop</> on the object being removed
itself.
</para>
</para>
<para>
<para>
...
@@ -526,22 +521,22 @@ postgres=# SELECT cid, cname, show_credit(cid) FROM customer;
...
@@ -526,22 +521,22 @@ postgres=# SELECT cid, cname, show_credit(cid) FROM customer;
</sect3>
</sect3>
<sect3>
<sect3>
<title>Dynamic
d
omain
t
ransitions</title>
<title>Dynamic
D
omain
T
ransitions</title>
<para>
<para>
It is possible to use SELinux's dynamic domain transition feature
It is possible to use SELinux's dynamic domain transition feature
to switch the security label of the client process, the client domain,
to switch the security label of the client process, the client domain,
to a new context, if that is allowed by the security policy.
to a new context, if that is allowed by the security policy.
The client domain needs the
'
setcurrent
'
permission and also
The client domain needs the
<literal>
setcurrent
</>
permission and also
'
dyntransaction
'
from the old to the new domain.
<literal>
dyntransaction
</>
from the old to the new domain.
</para>
</para>
<para>
<para>
Dynamic domain transitions should be considered carefully, because
i
t
Dynamic domain transitions should be considered carefully, because t
hey
means we
allow
s
users to switch their label
(also peforms a set of
allow users to switch their label
, and therefore their privileges, in
privileges in SELinux model) in arbitrary way, unlike regular
at their option, rather than (as in the case of a trusted procedure)
mandat
ory way such as trusted procedures
.
as
mandat
ed by the system
.
Thus,
T
he dyntransition permission is only considered
safe when used
Thus,
t
he
<literal>
dyntransition
</literal>
permission is only considered
to switch to a domain with a smaller set of privileges than
the
safe when used
to switch to a domain with a smaller set of privileges than
original one
, f
or example:
the
original one
. F
or example:
</para>
</para>
<screen>
<screen>
regression=# select sepgsql_getcon();
regression=# select sepgsql_getcon();
...
@@ -561,29 +556,29 @@ ERROR: SELinux: security policy violation
...
@@ -561,29 +556,29 @@ ERROR: SELinux: security policy violation
</screen>
</screen>
<para>
<para>
In this example above we were allowed to switch from the larger MCS
In this example above we were allowed to switch from the larger MCS
range c1.c1023 to the smaller range c1.c4, but
switching back was
range
<literal>
c1.c1023
</>
to the smaller range
<literal>
c1.c4
</>
, but
denied.
switching back was
denied.
</para>
</para>
<para>
<para>
A combination of dynamic domain transition and trusted procedure
A combination of dynamic domain transition and trusted procedure
enables an interesting use case that fits typical process life-
enables an interesting use case that fits
the
typical process life-
cycle of connection pooling software.
cycle of connection pooling software.
Even if your connection pooling software is not allowed to run most
Even if your connection pooling software is not allowed to run most
of SQL commands,
it shall be available
to switch the security label
of SQL commands,
you can allow it
to switch the security label
of the client using <literal>sepgsql_setcon()</literal> function
of the client using
the
<literal>sepgsql_setcon()</literal> function
to be invoked inside of the
trusted procedure; that should take some
from within a
trusted procedure; that should take some
credential to authorize the request to switch the client label.
credential to authorize the request to switch the client label.
After that, this session
performs wi
th privileges of the
user being
After that, this session
will have
th
e
privileges of the
target user,
switched, but it shall be unavailable to reference database objects
rather than the connection pooler.
labeled as other user's one.
The connection pooler can later revert the security label change by
Then, it can revert the security label alsp using
again using <literal>sepgsql_setcon()</literal> with
<literal>
sepgsql_setcon()</literal> with <literal>NULL</literal>
<literal>
NULL</literal> argument, again invoked from within a trusted
argument, unless the security policy prevent it
.
procedure with appropriate permissions checks
.
The point
s of this use case are
the trusted procedure
is only way
The point
here is that only
the trusted procedure
actually has permission
for the connection pooling software to switch security label of
to change the effective security label, and only does so when given proper
the clinet, and the trusted procedure does not work withou
t
credentials. Of course, for secure operation, the credential store mus
t
appropriate credentials. In addition, it is also a point that the
(table, procedure definition, or whatever) must be protected from
table to store credentials is only visible from trusted procedure
.
unauthorized access
.
</para>
</para>
</sect3>
</sect3>
...
@@ -618,8 +613,8 @@ ERROR: SELinux: security policy violation
...
@@ -618,8 +613,8 @@ ERROR: SELinux: security policy violation
<entry>
<entry>
Switches the client domain of the current session to the new domain,
Switches the client domain of the current session to the new domain,
if allowed by the security policy.
if allowed by the security policy.
It also accepts <literal>NULL</literal> input
,
a
nd it shall be
It also accepts <literal>NULL</literal> input a
s a request to transition
considered as a transition to the
original
one
.
to the client's
original
domain
.
</entry>
</entry>
</row>
</row>
<row>
<row>
...
@@ -655,8 +650,8 @@ ERROR: SELinux: security policy violation
...
@@ -655,8 +650,8 @@ ERROR: SELinux: security policy violation
<term>Data Definition Language (DDL) Permissions</term>
<term>Data Definition Language (DDL) Permissions</term>
<listitem>
<listitem>
<para>
<para>
Due to implementation restrictions, some
of
DDL per
miss
ions
are
not
Due to implementation restrictions, some DDL
o
per
at
ions
do
not
check
ed
.
check
permissions
.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -665,7 +660,8 @@ ERROR: SELinux: security policy violation
...
@@ -665,7 +660,8 @@ ERROR: SELinux: security policy violation
<term>Data Control Language (DCL) Permissions</term>
<term>Data Control Language (DCL) Permissions</term>
<listitem>
<listitem>
<para>
<para>
Due to implementation restrictions, DCL permissions are not checked.
Due to implementation restrictions, DCL operations do not check
permissions.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment