Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ea2c264

Browse files
committed
More documentation cleanup for sepgsql.
Thom Brown and Robert Haas
1 parent 74be35b commit ea2c264

File tree

1 file changed

+46
-50
lines changed

1 file changed

+46
-50
lines changed

doc/src/sgml/sepgsql.sgml

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,14 @@ $ restorecon -R /usr/local/pgsql/
307307
Currently, <productname>sepgsql</productname> allows security labels to be
308308
assigned to schemas, tables, columns, sequences, views, and functions.
309309
When <productname>sepgsql</productname> is in use, security labels are
310-
automatically assigned to suppoted database objects at creation time.
310+
automatically assigned to supported database objects at creation time.
311311
This label is called as a default security label, being decided according
312312
to the system security policy, which takes as input the creator's label
313313
and the label assigned to the new object's parent object.
314314
</para>
315315

316316
<para>
317-
A new database object basically inherits security label of the parent
317+
A new database object basically inherits the security label of the parent
318318
object, except when the security policy has special rules known as
319319
type-transition rules, in which case a different label may be applied.
320320
The meaning of the term "parent object" varies by object class, as follows.
@@ -365,7 +365,7 @@ $ restorecon -R /usr/local/pgsql/
365365
<term>function</term>
366366
<listitem>
367367
<para>
368-
Its parent object is the containing schema.
368+
The parent object is the containing schema.
369369
</para>
370370
</listitem>
371371
</varlistentry>
@@ -383,18 +383,18 @@ $ restorecon -R /usr/local/pgsql/
383383
<para>
384384
DML statements are used to reference or modify contents within
385385
the specified database objects; such as tables or columns.
386-
We basically checks access rights of the client on all the objects
386+
The access rights of the client are checked on all the objects
387387
mentioned in the given statement, and the kind of privileges checked
388388
depend on the class of the object and the type of access.
389389
</para>
390390

391391
<para>
392392
For tables, <literal>db_table:select</>, <literal>db_table:insert</>,
393393
<literal>db_table:update</> or <literal>db_table:delete</> is
394-
checked for all the appeared target tables depending on the sort of
394+
checked for all the referenced target tables depending on the sort of
395395
statement;
396396
in addition, <literal>db_table:select</> is also checked for
397-
all the tables that containin the columns to be referenced in
397+
all the tables that contain the columns referenced in the
398398
<literal>WHERE</> or <literal>RETURNING</> clause, as a data source
399399
of <literal>UPDATE</>, and so on.
400400
</para>
@@ -404,23 +404,23 @@ $ restorecon -R /usr/local/pgsql/
404404
UPDATE t1 SET x = 2, y = md5sum(y) WHERE z = 100;
405405
</synopsis>
406406

407-
In this case, we must have <literal>db_table:select</>, not only
407+
In this case, we must have <literal>db_table:select</> in addition to
408408
<literal>db_table:update</>, because <literal>t1.a</> is referenced
409-
within <literal>WHERE</> clause. Column-level permissions will be
410-
checked as well, for each referenced column.
409+
within the <literal>WHERE</> clause. Column-level permissions will also be
410+
checked for each referenced column.
411411
</para>
412412

413413
<para>
414-
The client must be allowed to reference all the appeared tables and
415-
columns, even if they are originated from views then expanded, because we
416-
intend to apply consistent access control rules independent from the
417-
manner in which the table contents are referenced.
414+
The client must be allowed to access all referenced tables and
415+
columns, even if they originated from views which were then expanded,
416+
so that we apply consistent access control rules independent of the manner
417+
in which the table contents are referenced.
418418
</para>
419419

420420
<para>
421421
For columns, <literal>db_column:select</> is checked on
422422
not only the columns being read using <literal>SELECT</>, but being
423-
referenced in other DML statement.
423+
referenced in other DML statements.
424424
</para>
425425

426426
<para>
@@ -438,16 +438,15 @@ UPDATE t1 SET x = 2, y = md5sum(y) WHERE z = 100;
438438
on the <literal>t1.y</> being updated and referenced,
439439
and <literal>db_column:select</> on the <literal>t1.z</> being only
440440
referenced in the <literal>WHERE</> clause.
441-
Also note that <literal>db_table:{select update}</> shall be checked
442-
in the table-level granularity.
441+
<literal>db_table:{select update}</> will also be checked
442+
at the table level.
443443
</para>
444444

445445
<para>
446-
For sequences, <literal>db_sequence:get_value</> when we reference
447-
a sequence object using <literal>SELECT</>; however, note that we
448-
cannot check permissions on execution of corresponding functions
449-
such as <literal>lastval()</> right now, although they performs same
450-
job, because here is no object access hook to acquire controls.
446+
For sequences, <literal>db_sequence:get_value</> is checked when we
447+
reference a sequence object using <literal>SELECT</>; however, note that we
448+
do not currently check permissions on execution of corresponding functions
449+
such as <literal>lastval()</>.
451450
</para>
452451

453452
<para>
@@ -462,7 +461,7 @@ UPDATE t1 SET x = 2, y = md5sum(y) WHERE z = 100;
462461
</para>
463462

464463
<para>
465-
Here is a few more corner cases.
464+
Here are a few more corner cases.
466465
The default database privilege system allows database superusers to
467466
modify system catalogs using DML commands, and reference or modify
468467
toast tables. These operations are prohibited when
@@ -480,30 +479,24 @@ UPDATE t1 SET x = 2, y = md5sum(y) WHERE z = 100;
480479
</para>
481480

482481
<para>
483-
In a case when multiple label providers are installed and user tries
482+
In the case where multiple label providers are installed and the user tries
484483
to set a security label, but is not managed by <productname>SELinux</>,
485484
only <literal>setattr</> should be checked here.
486-
This is currently not done due to implementation restrictions.
485+
This is currently not checked due to implementation restrictions.
487486
</para>
488487
</sect3>
489488

490489
<sect3>
491490
<title>Trusted Procedure</title>
492491
<para>
493-
It is a similar idea to security definer functions or set-uid commands
494-
on operating systems. <productname>SELinux</> provides a feature to
495-
switch privilege of the client (that is a security label of the client
496-
for more correctness) during execution of certain functions; being
497-
called as trusted procedures.
498-
</para>
499-
500-
<para>
501-
A trusted function is a function with a special security label being
502-
set up as a trusted procedure.
503-
So, we need to assign the special security label on the function that
504-
we hope it to perform as a trusted procedure, by administrative users.
505-
The default security policy also provides this special security label.
506-
See the following example.
492+
Trusted procedures are similar to security definer functions or set-uid
493+
commands. <productname>SELinux</> provides a feature to allow trusted
494+
code to run using a security label different from that of the client,
495+
generally for the purpose of providing highly controlled access to
496+
sensitive data (e.g. rows might be omitted, or the precision of stored
497+
values might be reduced). Whether or not a function acts as a trusted
498+
procedure is controlled by its security label and the operating system
499+
security policy. For example:
507500
</para>
508501

509502
<screen>
@@ -527,7 +520,7 @@ SECURITY LABEL
527520
</screen>
528521

529522
<para>
530-
Above operations shall be done by administrative users.
523+
The above operations should be performed by an administrative user.
531524
</para>
532525

533526
<screen>
@@ -544,14 +537,15 @@ postgres=# SELECT cid, cname, show_credit(cid) FROM customer;
544537
<para>
545538
In this case, a regular user cannot reference <literal>customer.credit</>
546539
directly, but a trusted procedure <literal>show_credit</> enables us
547-
to print credit number of customers with a bit modification.
540+
to print the credit card number of customers with some of the digits masked
541+
out.
548542
</para>
549543
</sect3>
550544

551545
<sect3>
552546
<title>Miscellaneous</title>
553547
<para>
554-
In this version, we reject <xref linkend="sql-load"> command across
548+
In this version, we reject the <xref linkend="sql-load"> command across
555549
the board, because any module loaded could easily circumvent security
556550
policy enforcement.
557551
</para>
@@ -605,10 +599,12 @@ postgres=# SELECT cid, cname, show_credit(cid) FROM customer;
605599
<listitem>
606600
<para>
607601
<productname>sepgsql</> never tries to hide existence of
608-
a certain object, even if user is not allowed to reference.
609-
For example, we can infer an existence of invisible object using
610-
primary-key confliction, foreign-key violation, and so on, even if
611-
we cannot reference contents of these objects.
602+
a certain object, even if the user is not allowed to the reference.
603+
For example, we can infer the existence of an invisible object as
604+
a result of primary key conflicts, foreign key violations, and so on,
605+
even if we cannot reference contents of these objects. The existence
606+
of a top secret table cannot be hidden; we only hope to conceal its
607+
contents.
612608
</para>
613609
</listitem>
614610
</varlistentry>
@@ -623,27 +619,27 @@ postgres=# SELECT cid, cname, show_credit(cid) FROM customer;
623619
<listitem>
624620
<para>
625621
This wiki page provides a brief-overview, security design, architecture,
626-
administration and upcoming feature for more details.
622+
administration and upcoming features.
627623
</para>
628624
</listitem>
629625
</varlistentry>
630626
<varlistentry>
631627
<term><ulink url="http://docs.fedoraproject.org/selinux-user-guide/">Fedora SELinux User Guide</ulink></term>
632628
<listitem>
633629
<para>
634-
This document provides wide spectrum of knowledge to administer
630+
This document provides a wide spectrum of knowledge to administer
635631
<productname>SELinux</> on your systems.
636-
It primary focuses on Fedora, but is not limited to Fedora.
632+
It focuses primarily on Fedora, but is not limited to Fedora.
637633
</para>
638634
</listitem>
639635
</varlistentry>
640636
<varlistentry>
641637
<term><ulink url="http://docs.fedoraproject.org/selinux-faq">Fedora SELinux FAQ</ulink></term>
642638
<listitem>
643639
<para>
644-
This document answers frequently asked questins about
640+
This document answers frequently asked questions about
645641
<productname>SELinux</productname>.
646-
It primary focuses on Fedora, but is not limited to Fedora.
642+
It focuses primarily on Fedora, but is not limited to Fedora.
647643
</para>
648644
</listitem>
649645
</varlistentry>

0 commit comments

Comments
 (0)