<chapter id="modifyenc-1"><title>Making a Label Encodings
File (Tasks)</title><highlights><itemizedlist><para>This chapter describes creating and modifying a <filename>label_encodings</filename> file.</para><listitem><para><olink targetptr="modifyenc-35" remap="internal">Encodings File Syntax</olink></para>
</listitem><listitem><para><olink targetptr="modifyenc-30" remap="internal">Managing Label Encodings (Task
Map)</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="modifyenc-35"><title>Encodings File Syntax</title><para>The <filename>label_encodings</filename> file contains a <literal>VERSION</literal> specification
and seven mandatory sections:  <literal>CLASSIFICATIONS</literal>, <literal>INFORMATION
LABELS</literal>, <literal>SENSITIVITY LABELS</literal>, <literal>CLEARANCES</literal>, <literal>CHANNELS</literal>, <literal>PRINTER BANNERS</literal>, and <literal>ACCREDITATION
RANGE</literal>. The sections must appear in the order given. An optional <literal>LOCAL DEFINITIONS</literal> section can follow.</para><para>In the following table, <emphasis>Mandatory keyword</emphasis> means
only that the keyword must be present. Not all keywords must have definitions.
The notes for each section indicate what must be defined and what is optional.</para><table frame="topbot" id="modifyenc-tbl-86"><title>Label Encodings Keywords</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="37.68*"/><colspec colname="colspec1" colwidth="62.32*"/><thead><row rowsep="1"><entry><para>Section</para>
</entry><entry><para>Notes</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>VERSION=</literal></para>
</entry><entry><para>Mandatory keyword. The version specification is the single keyword <literal>VERSION=</literal>, followed by a character string that identifies this particular
version of encodings.</para>
</entry>
</row><row><entry rowsep="1"><para><literal>CLASSIFICATIONS:</literal></para>
</entry><entry rowsep="1"><para>Mandatory keyword. At least one classification must be defined</para>
</entry>
</row><row><entry rowsep="1"><para><literal>INFORMATION LABELS:</literal></para><para><literal>WORDS:</literal></para><para><literal>REQUIRED COMBINATIONS:</literal></para><para><literal>COMBINATION CONSTRAINTS:</literal></para>
</entry><entry rowsep="1"><para>Mandatory keywords. Even though information labels are not used in Trusted Extensions software,
you must assign one bit to an information label word for each bit that you
assign to a sensitivity label word. The sensitivity label words are defined
in the following section.</para>
</entry>
</row><row><entry rowsep="1"><para><literal>SENSITIVITY LABELS:</literal></para><para><literal>WORDS:</literal></para><para><literal>REQUIRED COMBINATIONS:</literal></para><para><literal>COMBINATION CONSTRAINTS</literal></para>
</entry><entry rowsep="1"><para>Mandatory keywords. <literal>WORDS</literal> definitions are optional.
If you define sensitivity label words, the same bits must be assigned to <literal>WORDS</literal> in both the <literal>INFORMATION LABELS</literal> and <literal>CLEARANCES</literal> sections. The words that are assigned to the bits do not need to
be the same.</para>
</entry>
</row><row><entry rowsep="1"><para><literal>CLEARANCES:</literal></para><para><literal>WORDS:</literal></para><para><literal>REQUIRED COMBINATIONS:</literal></para><para><literal>COMBINATION CONSTRAINTS</literal></para>
</entry><entry rowsep="1"><para>Mandatory keywords. One bit must be assigned to a clearance word for
any sensitivity label word that you have defined. Clearance labels can allow
combinations of words that have been disallowed in the definitions for sensitivity
label words.</para>
</entry>
</row><row><entry><para><literal>CHANNELS:</literal></para>
</entry><entry><para>Mandatory keyword.</para>
</entry>
</row><row><entry><para><literal>PRINTER BANNERS:</literal></para>
</entry><entry><para>Mandatory keyword.</para>
</entry>
</row><row><entry colname="colspec0"><para><literal>ACCREDITATION RANGE:</literal></para>
</entry><entry colname="colspec1"><para>Mandatory keyword. A rule must be defined for each classification name.
The minimum clearance, minimum sensitivity label, and minimum protect as classification
must be defined.</para>
</entry>
</row><row><entry><para><literal>LOCAL DEFINITIONS:</literal></para>
</entry><entry><para>Optional keyword.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For all the required sections, the keywords in the preceding table must
be present, but not all of the sections must have definitions. For example,
a <filename>label_encodings</filename> file with only <literal>CLASSIFICATIONS</literal> and <literal>ACCREDITATION RANGE</literal> definitions is valid.</para><sect2 id="modifyenc-21"><title>Word Order Requirements</title><para>The order in which words are configured for sensitivity labels and clearances
is not enforced. However, the order is important when setting up relationships
between words. By convention, the <literal>WORDS</literal> in the <literal>SENSITIVITY
LABELS</literal> section are arranged in increasing order of importance.</para><para>For the effect of word order, see <olink targetptr="printl-4" remap="internal">Specifying
Channels</olink> of <olink targetptr="printl-1" remap="internal">Chapter&nbsp;4, Labeling Printer
Output (Tasks)</olink>. Detailed information is provided in <olink targetdoc="wslblencode" remap="external"><citetitle remap="book">Compartmented Mode Workstation Labeling: Encodings Format</citetitle></olink>.</para><para>If a compartment word is defined for one type of label (by assigning
the compartment word to one or more bits) in the <filename>label_encodings</filename> file,
then the same bits must be assigned to a word in the definition of the other
types of labels. While all types of labels use the same classification names,
the words that are used for each type of label can be different. The words
can be different even when they are encoded with the same bits and literally
refer to the same thing. Clearance labels can allow combinations of words
that have been disallowed in the definitions for sensitivity labels words.</para>
</sect2><sect2 id="modifyenc-28"><title>Classification Name Syntax</title><para>The classification is
the hierarchical portion of a label. Each label has one and only one classification.
A site can define up to 255 classifications. An integer value from 1 to 255
can be assigned to a classification in the <filename>label_encodings</filename> file.
The value 0 is reserved for the <constant>ADMIN_LOW</constant> administrative
label. The value 32,767 is reserved for the <constant>ADMIN_HIGH</constant> administrative
label. For an illustration, see <olink targetptr="overview-fig-10" remap="internal">Figure&nbsp;1&ndash;2</olink>.</para><para>Classifications are defined once for clearances and for sensitivity
labels in the <literal>CLASSIFICATIONS</literal> section of the <filename>label_encodings</filename> file.</para><para>A classification with a higher value dominates a classification
with a lower value. The following table shows two sets of label names that
are assigned the same values in different encodings files. The left column
shows sample sensitivity labels from the <filename>label_encodings.example</filename> file.
The middle column shows labels from the <filename>label_encodings.gfi.multi</filename> file.
A label with the <literal>Registered</literal> or <literal>Top Secret</literal> classification,
with a value of 6, dominates the labels that are listed in its column.</para><informaltable frame="topbot"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="131.25*"/><colspec colname="column3" colwidth="151.09*"/><colspec colname="column4" colwidth="73.67*"/><thead><row rowsep="1"><entry align="left" valign="bottom"><para>Commercial Example</para>
</entry><entry colname="column3" align="left" valign="bottom"><para>U.S. Government Example</para>
</entry><entry align="left" valign="bottom"><para>Value</para>
</entry>
</row>
</thead><tbody><row><entry align="left" valign="top"><para><literal>Registered</literal></para>
</entry><entry colname="column3" align="left"><para><literal>Top Secret</literal></para>
</entry><entry align="left" valign="top"><para>6</para>
</entry>
</row><row><entry align="left" valign="top"><para><literal>Need to Know</literal></para>
</entry><entry colname="column3" align="left"><para><literal>Secret</literal></para>
</entry><entry align="left" valign="top"><para>5</para>
</entry>
</row><row><entry align="left" valign="top"><para><literal>Internal Use Only</literal></para><literallayout></literallayout>
</entry><entry colname="column3" align="left"><para><literal>Confidential</literal></para>
</entry><entry align="left" valign="top"><para>4</para>
</entry>
</row><row><entry align="left" valign="top"><para><literal>Public</literal></para>
</entry><entry colname="column3" align="left"><para><literal>Unclassified</literal></para>
</entry><entry align="left" valign="top"><para>1</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><sect3 id="modifyenc-20"><title>Keywords for Classifications</title><para>The following list describes the keywords that can be defined for classifications.
For examples of initial compartment definitions, see <olink targetptr="modifyenc-29" remap="internal">Default and Inverse Words</olink>.</para><variablelist><varlistentry><term><literal>name=</literal></term><listitem><para>Cannot contain (/) or (,) or (;). All other alphanumeric
characters and white space are allowed. Users can enter either the <literal>name</literal> or
the <literal>sname</literal> or the <literal>aname</literal> when specifying
labels.</para>
</listitem>
</varlistentry><varlistentry><term><literal>sname=</literal></term><listitem><para>Required in classifications only. The short name
appears in sensitivity labels in brackets.</para>
</listitem>
</varlistentry><varlistentry><term><literal>aname=</literal></term><listitem><para>Optional. Name that can be entered by users when
a classification is needed.</para>
</listitem>
</varlistentry><varlistentry><term><literal>value=</literal></term><listitem><para>The values that you assign should represent the
actual hierarchy among the classifications. The values should leave room for
later expansion. <literal>0</literal> is reserved for <constant>ADMIN_LOW</constant>.
Values can start at <literal>1</literal> and go to <literal>255</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>initial compartments=</literal></term><listitem><para>Optional. Specify bit numbers for any default
compartment words. Default compartment words are words that should initially
appear in any label that has the associated classification.</para><para>Advanced: Specify bit numbers for any inverse words. The minimum classification
should not have initial compartments.</para>
</listitem>
</varlistentry><varlistentry><term><literal>initial markings=</literal></term><listitem><para>Obsolete. Do not define.</para>
</listitem>
</varlistentry>
</variablelist><para>The following example shows the top of the <filename>label_encodings.multi</filename> file.</para><example id="modifyenc-ex-21"><title>Classifications With Initial Compartments
in <filename>label_encodings.multi</filename></title><screen>VERSION= Trusted Solaris Multi-Label Sample Version - 5.6 05/07/27

*
*    WARNING:  If CIPSO Tag Type 1 network labels are to be used:
*
*        a) All CLASSIFICATIONS values must be less than or equal to 255.
*        b) All COMPARTMENTS bits must be less than or equal to 239.
*

CLASSIFICATIONS:

*
name= UNCLASSIFIED;  sname= U;  value= 1;
name= CONFIDENTIAL;  sname= C;  value= 4; initial compartments= 4-5 190-239;
name= SECRET;        sname= S;  value= 5; initial compartments= 4-5 190-239;
name= TOP SECRET;    sname= TS; value= 6; initial compartments= 4-5 190-239;</screen>
</example><para>Each classification has the mandatory <literal>name</literal>, <literal>sname</literal>, and <literal>value</literal> fields. The <literal>CONFIDENTIAL</literal>, <literal>SECRET</literal>, and <literal>TOP SECRET</literal> classifications have <literal>initial compartments</literal>. The lowest classification, <literal>UNCLASSIFIED</literal>,
has no initial compartments.</para><para>The initial compartment bit assignments of <literal>4-5</literal> and <literal>190-239</literal> signify that bits 4, 5, and 190 through 239 are turned on.
These bits are set to <literal>1</literal> in a label with this classification.</para><para>Some of the initial compartments are later used to define <emphasis>default</emphasis> and <emphasis>inverse</emphasis> words. Some initial compartments
are reserved for possible later definitions of inverse words.</para><para>The following example shows a set
of classifications that have no initial compartments.</para><example id="modifyenc-ex-22"><title>Classifications With No Initial Compartments
in <filename>label_encodings.example</filename></title><screen>CLASSIFICATIONS:

name= PUBLIC; sname= PUBLIC; value= 1;
name= INTERNAL_USE_ONLY; sname= INTERNAL; aname= INTERNAL; value= 4;
name= NEED_TO_KNOW; sname= NEED_TO_KNOW; aname= NEED_TO_KNOW; value= 5;
name= REGISTERED; sname= REGISTERED; aname= REGISTERED; value= 6;</screen>
</example>
</sect3><sect3 id="modifyenc-29"><title>Default and Inverse Words</title><para>When a bit is defined as an initial compartment, the bit is set to <literal>1</literal> in every label that contains the classification. Any bit that
is specified for an initial compartment can be defined later in the <filename>label_encodings</filename> file as a <emphasis>default word</emphasis> or an <emphasis>inverse
word</emphasis>.</para><itemizedlist><listitem><para>A <emphasis>default compartment word</emphasis> is a word
that appears in any label that contains the classification.</para>
</listitem><listitem><para>An <emphasis>inverse compartment word</emphasis> is a word
that appears in a label that has the associated classification when another
word that you define with the inverse compartment's bit is not present.</para>
</listitem>
</itemizedlist><example id="modifyenc-ex-23"><title>Assigning Initial Compartments</title><para>In this example, the <literal>PUBLIC</literal> classification is assigned
no initial compartments, while the <literal>WEB COMPANY</literal> classification
is assigned initial compartments 4 and 5. A label that includes the <literal>PUBLIC</literal> classification has no default compartments. A label that includes
the <literal>WEB COMPANY</literal> classification always has compartment bits
4 and 5 turned on.</para><screen>name= PUBLIC;  sname= P;  value= 1;
name= WEB COMPANY;  sname= WEBCO;  value= 4; initial compartments= 4-5</screen>
</example><para>The following section shows how these
initial compartment bits can be assigned to words.</para><example id="modifyenc-ex-24"><title>Defining Default and Inverse <literal>SENSITIVITY
LABELS</literal> Words</title><itemizedlist><para>In this example, compartment bits 4 and 5 are assigned to the word <literal>DIVISION ONLY</literal>. Each compartment bit is also associated with an inverse
word. <literal>WEBC AMERICA</literal> is assigned to the inverse compartment
bit ~4. <literal>WEBC WORLD</literal> is assigned to the inverse compartment
bit  ~5. These assignments have the following results:</para><listitem><para>A sensitivity label with the <literal>WEB COMPANY</literal> classification
initially includes the word <literal>DIVISION ONLY</literal>. The label's
binary representation has the compartment bits 4 and 5 turned on.</para>
</listitem><listitem><para>A sensitivity label with the <literal>PUBLIC</literal> classification
always has compartment bits 4 and 5 turned off. The words <literal>WEBC AMERICA</literal> and <literal>WEBC WORLD</literal> are included in the label.</para><para>Because a <literal>minclass</literal> of <literal>IUO</literal> is specified for the inverse words, <literal>WEBC AMERICA</literal> and <literal>WEBC WORLD</literal> are not displayed
in the <literal>PUBLIC</literal> sensitivity label. The presence of these
two inverse words is understood.</para>
</listitem>
</itemizedlist><screen>SENSITIVITY LABELS:

WORDS:

name= DIVISION ONLY;  sname= DO;       minclass= WEB COMPANY; compartments= 4-5;
name= WEBC AMERICA;   sname= WEBCA;    minclass= WEB COMPANY; compartments= ~4;
name= WEBC WORLD;     sname= WEBCW;    minclass= WEB COMPANY; compartments= ~5;</screen>
</example>
</sect3><sect3 id="overview-206"><title>Compartment Words</title><para>Compartments are optional words that can be defined to appear in labels.
Compartments are called categories in some other trusted systems. Compartments
are used to indicate the special handling procedures to be used for the information
whose label contains the compartment and the general class of people who might
have access to the information.</para><para>Compartment words are assigned to non-hierarchical bits. However, hierarchies
can be established between compartment words. These hierarchies are based
on rules for including bits from one compartment word in the bits that are
defined for another compartment word.</para><para>Compartment words are optionally defined in the <literal>WORDS</literal> subsection
for each label type. Each compartment word is assigned to one or more bits.</para><para>While all types of labels use the same classifications, the words that
are used for each type of label can be different. The words can be different
even when they are encoded with the same bits and literally refer to the same
thing.</para><para>The following example shows the <literal>WEB COMPANY</literal> compartment
word. The word is specified with a short name (<literal>sname</literal>) of <literal>WEBCO</literal> and compartment bits 40-50.</para><example id="overview-ex-207"><title>Sample Compartment Definition for a Sensitivity
Label</title><screen>WORDS:

name= WEB COMPANY; sname= WEBCO; compartments= 40-50;</screen>
</example><para>Along with its classification field, each
label has a 256-bit compartment field, of which 239 are available for CIPSO
labels. Each bit is assignable in zero or more compartment words. Each word
can have one or more compartment bits assigned. Out of the 239 available bits,
many compartment words can be created. For an example, see the compartments
planner in <olink targetptr="planex-tbl-3" remap="internal">Table&nbsp;6&ndash;3</olink>.</para><itemizedlist><para>The classification, compartments, and combination requirements affect
the accreditation range. The <literal>ACCREDITATION RANGE</literal> for each
classification setting should be one of the following strings:</para><listitem><para><literal>only valid compartment combinations;</literal></para>
</listitem><listitem><para><literal>all compartment combinations valid;</literal></para>
</listitem><listitem><para><literal>all compartment combinations valid except;</literal></para>
</listitem>
</itemizedlist>
</sect3><sect3 id="overview-46"><title>Hierarchical Compartment Words</title><para>Hierarchical compartments can be used to differentiate between documents
that are available to everyone in a larger group, and documents that are available
to subgroups only.</para><example id="modifyenc-31"><title>Using Bit Combinations to Establish Hierarchies</title><para>By defining a word that uses one bit and a second word that uses that
same bit along with a second bit, you define a hierarchical relationship between
the two words. The compartment word that is more general must be defined below
the word that is more specific. For example, by defining a word that uses
bit number 1 and another word that uses bits number 1 and 2, you give the
two words a hierarchical relationship.</para><para>In this example, a Sales compartment is defined with two subcompartments,
Direct Sales, and Indirect Sales. A single classification that is named WebCo
is previously defined.</para><screen>name= Direct_Sales;   compartments= 1, 2
name= Indirect_Sales;   compartments= 1, 3
name= Sales;   compartments= 1</screen><para>This definition allows the WebCo company to differentiate between documents
that can be accessed by anyone in the entire sales force, documents that can
be accessed only by members of the indirect sales force, and documents that
can be accessed only by members of the direct sales force.</para><itemizedlist><listitem><para>The security administrator gives the WebCo Direct_Sales clearance
to employees in the direct sales organization. The WebCo Indirect_Sales clearance
is given to employees in the indirect sales organization.</para>
</listitem><listitem><para>Documents created by anyone working at the WebCo Direct_Sales
label get the same label, so the documents are only accessible to employees
in the direct sales department.</para>
</listitem><listitem><para>Anyone in the indirect or direct sales forces can work at
the WebCo Sales label because the compartment word Sales is below both the
Direct_Sales and Indirect_Sales words. Creating documents at the WebCo Sales
label makes the documents available to everyone in the Sales department.</para>
</listitem>
</itemizedlist>
</example><example id="modifyenc-33"><title>Using <literal>REQUIRED COMBINATIONS</literal> to
Establish Hierarchies</title><para>If two words are specified together in the <literal>REQUIRED COMBINATIONS</literal> section,
the second label is added to the label whenever the first word is used.</para><para>In this example, the definition of the Direct Sales, Indirect_Sales,
and Sales serves essentially the same effect as the example in <olink targetptr="modifyenc-31" remap="internal">Example&nbsp;3&ndash;6</olink>. The difference is
that the Direct_Sales word will always have the Sales word with it</para><screen>name= Direct_Sales;   compartments= 2
name= Indirect_Sales;   compartments= 3
name= Sales;   compartments= 1

REQUIRED COMBINATIONS:

Direct_Sales            Sales
Indirect_Sales          Sales</screen>
</example>
</sect3>
</sect2>
</sect1><sect1 id="modifyenc-30"><title>Managing Label Encodings (Task Map)</title><caution><para>The safest time to modify a <filename>label_encodings</filename> file
is when the first host is installed. Proceed with caution when modifying a
file that is in use. For details, see the <olink targetdoc="trsolrefman" targetptr="label-encodings-4" remap="external"><citerefentry><refentrytitle>label_encodings</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</caution><informaltable frame="all" pgwide="100"><tgroup cols="2" colsep="1" rowsep="1"><colspec colwidth="44.07*"/><colspec colwidth="55.93*"/><thead><row><entry><para>Task</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create or change the <filename>label_encodings</filename> file</para>
</entry><entry><para><olink targetptr="modifyenc-22" remap="internal">How to Create a label_encodings File</olink></para>
</entry>
</row><row><entry><para>Test the <filename>label_encodings</filename> file</para>
</entry><entry><para><olink targetptr="modifyenc-24" remap="internal">How to Analyze and Verify the label_encodings
File</olink></para>
</entry>
</row><row><entry><para>Distribute the <filename>label_encodings</filename> file</para>
</entry><entry><para><olink targetptr="modifyenc-48" remap="internal">How to Distribute the label_encodings
File</olink></para>
</entry>
</row><row><entry><para>Debug a <filename>label_encodings</filename> file</para>
</entry><entry><para><olink targetptr="modifyenc-12" remap="internal">How to Debug a label_encodings File</olink></para>
</entry>
</row><row><entry><para>Change a classification definition</para>
</entry><entry><para><olink targetptr="modifyenc-71" remap="internal">How to Add or Rename a Classification</olink></para>
</entry>
</row><row><entry><para>Create default or inverse words</para>
</entry><entry><para><olink targetptr="modifyenc-26" remap="internal">How to Specify Default and Inverse Words</olink></para>
</entry>
</row><row><entry><para>Customize a single-label file</para>
</entry><entry><para><olink targetptr="modifyenc-16" remap="internal">How to Create a Single-Label Encodings
File</olink></para>
</entry>
</row><row><entry><para>Specify a label name</para>
</entry><entry><para><olink targetptr="modifyenc-41" remap="internal">Example&nbsp;3&ndash;9</olink></para>
</entry>
</row><row><entry><para>Add a <literal>LOCAL DEFINITIONS</literal> section</para>
</entry><entry><para><olink targetptr="modifyenc-38" remap="internal">How to Add Sun Extensions to an Encodings
File</olink></para>
</entry>
</row><row><entry><para>Prevent specific users from seeing labels</para>
</entry><entry><para><olink targetdoc="trsoladmproc" targetptr="modifyenc-18" remap="external"><citetitle remap="section">How to Hide Labels From a User</citetitle> in <citetitle remap="book">Solaris Trusted Extensions Administrator&rsquo;s Procedures</citetitle></olink></para>
</entry>
</row><row><entry><para>Prevent all users of a particular system from seeing labels</para>
</entry><entry><para><olink targetdoc="trsoladmproc" targetptr="manageusers-26" remap="external"><citetitle remap="section">How to Modify policy.conf Defaults</citetitle> in <citetitle remap="book">Solaris Trusted Extensions Administrator&rsquo;s Procedures</citetitle></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><task id="modifyenc-22"><title>How to Create a <filename>label_encodings</filename> File</title><tasksummary><para>For sample files, see the <filename class="directory">/etc/security/tsol</filename> directory
on an installed system. The files are described in.<olink targetptr="planl-4" remap="internal">Labels
Files in Solaris Trusted Extensions Packages</olink>.</para>
</tasksummary><taskprerequisites><para>You can create this file before you install Trusted Extensions on your first
system. On that first system, you check the file. You can also create this
file on the first system that you install with Trusted Extensions. This procedure
must be completed before a second computer is configured with Trusted Extensions.</para><para>On a system that is configured with Trusted Extensions, you must be in the
global zone in the Security Administrator role. On other systems, you can
create and edit the file in any editor.</para>
</taskprerequisites><procedure><step><para>Create a backup copy of the original file.</para>
</step><step><para>Open a new or existing version of the file.</para><stepalternatives><step><para>On a system that is not configured with Trusted Extensions, use any
editor to create the file.</para>
</step><step><para>On a system that is configured with Trusted Extensions, use the Edit
Encodings action to create the file.</para><para>In CDE, the Trusted_Extensions
folder in the Application Manager contains two actions for the encodings file.</para><variablelist><varlistentry><term>Edit Encodings</term><listitem><para>Edits and checks the syntax of the specified <filename>label_encodings</filename> file.</para>
</listitem>
</varlistentry><varlistentry><term>Check Encodings</term><listitem><para>Checks the syntax of a specified <filename>label_encodings</filename> file.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</stepalternatives>
</step><step><para>Modify the file.</para><para>For details, see <olink targetptr="planl-7" remap="internal">How to Plan the Encodings File</olink>.</para>
</step><step><para>Continue with <olink targetptr="modifyenc-24" remap="internal">How to Analyze and
Verify the label_encodings File</olink>.</para>
</step>
</procedure>
</task><task id="modifyenc-24"><title>How to Analyze and Verify the <filename>label_encodings</filename> File</title><taskprerequisites><para>You must be in the global zone in the Security Administrator role.</para>
</taskprerequisites><procedure><step><para>Check the syntax and relationships of the labels.</para><para>In
a terminal, use the <command>chk_encodings -a</command> command to analyze
and report on label relationships.</para><screen>$ chk_encodings -a <replaceable>encodings-file</replaceable></screen>
</step><step><para>Verify the file.</para><para>The Check Encodings action runs the <command>chk_encodings</command> command on the specified file.</para><stepalternatives><step><para>If the file passes, install it.</para><screen>Do you want to install this label_encodings file? <userinput>yes</userinput></screen>
</step><step><para>If the file does not pass, see <olink targetptr="modifyenc-12" remap="internal">How
to Debug a label_encodings File</olink> for assistance.</para>
</step>
</stepalternatives>
</step><step><para>Test the encodings file.</para><para>Where possible, test the
file on a few systems before approving the file for all systems at your site.</para>
</step><step><para>Create a master copy.</para><para>For copying instructions, see <olink targetdoc="trsoladmproc" targetptr="basic-52" remap="external"><citetitle remap="section">How to Copy Files to Portable Media in Trusted Extensions</citetitle> in <citetitle remap="book">Solaris Trusted Extensions Administrator&rsquo;s Procedures</citetitle></olink>.</para>
</step><step><para>Save a labeled copy of the file in a protected location.</para>
</step>
</procedure>
</task><task id="modifyenc-48"><title>How to Distribute the <filename>label_encodings</filename> File</title><procedure><step><para>Create a master copy.</para><para>For copying instructions, see <olink targetdoc="trsoladmproc" targetptr="basic-52" remap="external"><citetitle remap="section">How to Copy Files to Portable Media in Trusted Extensions</citetitle> in <citetitle remap="book">Solaris Trusted Extensions Administrator&rsquo;s Procedures</citetitle></olink>.</para>
</step><step><para>Immediately after installing a system with Trusted Extensions, copy
the master file onto the system.</para><para>For copying instructions, see <olink targetdoc="trsoladmproc" targetptr="basic-25" remap="external"><citetitle remap="section">How to Copy Files From Portable Media in Trusted Extensions</citetitle> in <citetitle remap="book">Solaris Trusted Extensions Administrator&rsquo;s Procedures</citetitle></olink>.</para>
</step>
</procedure>
</task><task id="modifyenc-71"><title>How to Add or Rename a Classification</title><taskprerequisites><para>You must be in the Security Administrator role in the global zone.</para>
</taskprerequisites><procedure><step><para>Edit the <filename>label_encodings</filename> file.</para><para>Use
the Edit Encodings action. For details, see <olink targetptr="modifyenc-22" remap="internal">How
to Create a label_encodings File</olink>.</para>
</step><step><para>Specify a version number.</para><para>In the <literal>VERSION=</literal> section
put your site's name, a title for the file, a version number and the date.</para><screen>VERSION= Sun Microsystems, Inc. Example Version - 5.10 04/05/28</screen><para>Sun uses SCCS keywords for the version number and the date. For details,
see the <olink targetdoc="refman1" targetptr="sccs-1" remap="external"><citerefentry><refentrytitle>sccs</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para><screen>VERSION= Sun Microsystems, Inc. Example Version - %I% %E%</screen>
</step><step><para>Specify the classification.</para><para>In the <literal>CLASSIFICATIONS</literal> section, supply the long name, short name, and numeric value for
the new classification.</para><screen>name= NEW_CLASS; sname= N; value= 2; </screen>
</step><step><para>Include the new classification in the accreditation range.</para><para>Add the new classification to the <literal>ACCREDITATION RANGE</literal> section.</para><para>The following example shows three new classifications added to the <literal>ACCREDITATION RANGE</literal> section. Each classification is specified with <literal>all compartment combinations valid</literal>.</para><screen>ACCREDITATION RANGE:

classification= UNCLASSIFIED;        all compartment combinations valid;

* i is new in this file
classification= INTERNAL_USE_ONLY;   all compartment combinations valid;

* n is new in this file
classification= NEED_TO_KNOW;        all compartment combinations valid;

classification= CONFIDENTIAL;        all compartment combinations valid except:
c
c a
c b

classification= SECRET;               only valid compartment combinations:
. . .
* r is new in this file
classification= REGISTERED;           all compartment combinations valid;</screen>
</step><step><para>Adjust the  <literal>ACCREDITATION RANGE</literal> section
if necessary.</para><para>You might need to make the new classification a
minimum classification.</para><screen>minimum clearance= u; 
minimum sensitivity label= u; 
minimum protect as classification= u;</screen><note><para>Make sure that you set a minimum clearance that is dominated by
all the clearances that you plan to assign to users. Similarly, make sure
that the minimum sensitivity label is dominated by all the minimum labels
that you plan to assign to users.</para>
</note>
</step><step><para>Save your changes.</para>
</step>
</procedure>
</task><task id="modifyenc-26"><title>How to Specify Default and Inverse Words</title><taskprerequisites><para>You must be in the Security Administrator role in the global zone.</para>
</taskprerequisites><procedure><step><para>Edit the <filename>label_encodings</filename> file.</para><para>Use
the Edit Encodings action. For details, see <olink targetptr="modifyenc-22" remap="internal">How
to Create a label_encodings File</olink>.</para>
</step><step><para>Specify initial compartments.</para><para>In the <literal>CLASSIFICATIONS</literal> section, specify compartments as part of the classification definition.</para><screen>CLASSIFICATIONS:
name= PUBLIC;  sname= P;  value= 1;
name= WEB COMPANY;  sname= WEBCO;  value= 2; initial compartments= 4-5 ;</screen>
</step><step><para>Specify a default word.</para><para>Assign an initial compartment
bit to the word.</para><screen>name= DIVISION ONLY;  sname= DO;  minclass=  IUO; compartments= 4-5;
name= WEBC AMERICA;  sname= WEBCA; minclass= IUO; compartments= 4;
name= WEBC WORLD;  sname= WEBCW; minclass= IUO; compartments= 5;</screen>
</step><step><para>Specify an inverse word.</para><para>Inverse words are created
by preceding an initial compartment with a tilde (~).</para><screen>name= DIVISION ONLY;  sname= DO;  minclass=  IUO; compartments= 4-5;
name= WEBC AMERICA;  sname= WEBCA; minclass= IUO; compartments= <userinput>~4</userinput>;
name= WEBC WORLD;  sname= WEBCW; minclass= IUO; compartments= <userinput>~5</userinput>;</screen>
</step><step><para>Save your changes.</para>
</step>
</procedure><taskrelated role="troubleshooting"><itemizedlist><para>For any compartment bits that are not reserved for later assignment,
you need to assign a word to the bit in the following sections:</para><listitem><para><literal>SENSITIVITY LABELS: WORDS:</literal></para>
</listitem><listitem><para><literal>INFORMATION LABELS: WORDS:</literal></para>
</listitem><listitem><para><literal>COMPARTMENTS: WORDS:</literal></para>
</listitem>
</itemizedlist>
</taskrelated>
</task><task id="modifyenc-16"><title>How to Create a Single-Label Encodings File</title><tasksummary><itemizedlist><para>Certain labels must always be present in a <filename>label_encodings</filename> file:</para><listitem><para>One sensitivity label in the user accreditation range must
be defined</para>
</listitem><listitem><para>One clearance in the user accreditation range must be defined</para>
</listitem><listitem><para>One information label in the user accreditation range must
be defined</para>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>You must be in the Security Administrator role in the global zone.</para>
</taskprerequisites><procedure><step><para>Edit an encodings file.</para><para>Use the Edit Encodings action.
For details, see <olink targetptr="modifyenc-22" remap="internal">How to Create a label_encodings
File</olink>. Provide a name that is different from the installed <filename>label_encodings</filename> file.</para>
</step><step><para>Create an encodings file with only one classification and only
the desired compartments.</para><para>For example, you could set up an encodings
file with the <literal>INTERNAL_USE_ONLY</literal> classification, and specify
no words.</para><screen>VERSION= Single-Label Encodings

. . .
CLASSIFICATIONS:

name= INTERNAL_USE_ONLY;       sname= INTERNAL;  value= 5;

INFORMATION LABELS:

WORDS:

SENSITIVITY LABELS:

WORDS:

CLEARANCES:

WORDS:

CHANNELS:

WORDS:

PRINTER BANNERS:

WORDS:</screen>
</step><step><para>In the <literal>ACCREDITATION RANGE</literal>  section, include
only one classification and one valid compartment combination.</para><para>The
following example encodes the <literal>INTERNAL</literal> classification.</para><screen>ACCREDITATION RANGE:

classification= INTERNAL;
only valid compartment combinations:

INTERNAL

minimum clearance= INTERNAL;
minimum sensitivity label= INTERNAL;
minimum protect as classification= INTERNAL;</screen>
</step><step><para>Encode the <literal>LOCAL DEFINITIONS</literal> section. </para><para>For details, see <olink targetptr="localdef-1" remap="internal">Chapter&nbsp;5, Customizing
LOCAL DEFINITIONS</olink>.</para>
</step><step><para>Ensure that the file is syntactically correct.</para><stepalternatives><step><para>If the file does not pass <command>chk_encodings</command>, see <olink targetptr="modifyenc-12" remap="internal">How to Debug a label_encodings File</olink></para>
</step><step><para>Otherwise, continue with <olink targetptr="modifyenc-24" remap="internal">How to
Analyze and Verify the label_encodings File</olink>.</para>
</step>
</stepalternatives>
</step><step performance="optional"><para>Configure labels so that they are not visible
to users.</para><para>For the steps, see <olink targetdoc="trsoladmproc" targetptr="modifyenc-18" remap="external"><citetitle remap="section">How to Hide Labels From a User</citetitle> in <citetitle remap="book">Solaris Trusted Extensions Administrator&rsquo;s Procedures</citetitle></olink>.</para>
</step>
</procedure><example id="modifyenc-37"><title>Defining the Accreditation Range in a Single-Label Encodings File</title><para>The following example shows the settings in the <literal>ACCREDITATION
RANGE:</literal> section. A single <literal>ANY_CLASS</literal> classification
is defined. Compartments words <literal>A</literal>, <literal>B</literal>,
and <literal>REL CNTRY 1</literal> are specified for all types of labels.</para><screen>ACCREDITATION RANGE:

classification= ANY_CLASS;      only valid compartment combinations:

ANY_CLASS A B REL CNTRY1

minimum clearance= ANY_CLASS A B REL CNTRY1;
minimum sensitivity label= ANY_CLASS A B REL CNTRY1;
minimum protect as classification= ANY_CLASS;</screen>
</example><example id="modifyenc-41"><title>Changing the Single Label Name</title><para>In this example, the <filename>label_encodings.example</filename> file
is changed to handle a single-label company. The <literal>name=</literal> value
is changed from <literal>SECRET</literal> to <literal>INTERNAL_USE_ONLY</literal>.
The <literal>sname=</literal> value is changed from <literal>s</literal> to <literal>INTERNAL</literal>. Neither the <literal>value=</literal> nor the <literal>initial
compartments=</literal> definition is changed.</para><screen>CLASSIFICATIONS:
name= INTERNAL_USE_ONLY;  sname= INTERNAL;  value= 5; initial compartments= 4-5
190-239;</screen><para>In the <literal>ACCREDITATION RANGE</literal> section, the short name
of the classification is replaced. Also, the minimums are replaced with the
new <literal>sname</literal>.</para><screen>ACCREDITATION RANGE:

classification= INTERNAL;      only valid compartment combinations:

INTERNAL

minimum clearance= INTERNAL;
minimum sensitivity label= INTERNAL;
minimum protect as classification= INTERNAL;</screen>
</example>
</task><task id="modifyenc-38"><title>How to Add Sun Extensions to an Encodings File</title><taskprerequisites><para>You must be in the Security Administrator role in the global zone. You
must have an encodings file that does not have a <literal>LOCAL DEFINITIONS</literal> section.</para>
</taskprerequisites><procedure><step><para>Add the <literal>LOCAL DEFINITIONS</literal> section to your file.</para><para>Append the section from a Sun-supplied <filename>label_encodings</filename> file.
Sun-supplied files are in the <filename>/etc/security/tsol</filename> directory.</para>
</step><step><para>Customize the extensions for your site.</para><para>For details,
see <olink targetptr="localdef-11" remap="internal">Modifying Sun Extensions (Task Map)</olink>.</para>
</step>
</procedure>
</task><task id="modifyenc-12"><title>How to Debug a <filename>label_encodings</filename> File</title><taskprerequisites><para>You must be in the Security Administrator role in the global zone.</para>
</taskprerequisites><procedure><step><para>Edit the <filename>label_encodings</filename> file.</para><para>Use
the Edit Encodings action. For details, see <olink targetptr="modifyenc-22" remap="internal">How
to Create a label_encodings File</olink>.</para>
</step><step><para>Check the entries in the <literal>INFORMATION LABELS: WORDS:</literal> section.</para><para>The entries must exactly match the entries in the <literal>SENSITIVITY
LABELS: WORDS:</literal> section.</para><tip><para>Encode the sensitivity label words, then copy the words to the <literal>INFORMATION LABELS</literal> section.</para>
</tip>
</step><step><para>Check that no label in the user accreditation range has a value
of 0 with no compartment bits.</para><para>This step ensures that no label
is indistinguishable from the label <constant>ADMIN_HIGH</constant>.</para>
</step><step><para>Check that no label in the user accreditation range has a value
of 255 with all compartment bits from 0 to 239.</para><para>This step ensures
that no label is indistinguishable from the label <constant>ADMIN_HIGH</constant>.</para>
</step><step><para>Check that no compartment has a value higher than 239.</para><para>This
step ensures that all labels can be mapped to CIPSO labels.</para>
</step><step><para>For labels that cannot be resolved, do the following:</para><substeps><step><para>Reset any objects with the new labels to a low system label, <constant>ADMIN_LOW</constant>.</para>
</step><step><para>Restore a known, usable <filename>label_encodings</filename> file
from the backup.</para>
</step><step><para>Use the <command>chk_encodings -a</command> command to analyze
the label problems in the faulty file.</para>
</step>
</substeps>
</step>
</procedure>
</task>
</sect1>
</chapter>