
67
Two Methods of Profiling
Subdomain.vim
A syntax coloring file for the vim text editor highlights various features
of an Novell AppArmor profile with colors. Using vim and the Novell
AppArmor syntax mode for vim, you can see the semantic implications
of your profiles with color highlighting. Use vim to view and edit your
profile by typing
vim
at a terminal window.
To enable the syntax coloring, when you edit an Novell AppArmor pro-
f
i
l
e
i
n
vi
m,
use
t
he
command
“
:syntax on
”
and
t
hen
“
:set syn-
tax=subdomain
”
.
Al
t
er
nat
el
y,
you
can
pl
ace
t
hese
l
i
nes
i
n
your
~/.vimrc
file:
When
vi
m
opens
t
he
pr
of
i
l
e,
f
i
r
st
ent
er
“
:syntax on
”
and
t
hen
“
:set
syntax=subdomain
”
and
vi
m
wi
l
l
col
or
t
he
l
i
nes
of
t
he
pr
of
i
l
e
f
or
you:
blue:
#include lines that pull in other Novell AppArmor rules, and
comments that begin with #
white:
ordinary read access lines
brown:
capability statements and complain flags
yellow:
lines that grant write access.
green:
lines that grant execute permission, either
ix
or
px
red:
lines that grant
unconfined
access,
ux
red background:
syntax errors that will not load properly into the
SubDomain module.
Note:
There is a security risk to using these lines in your
.vimrc
file,
as it causes vim to trust the syntax mode presented in files you are
editing. It may enable an attacker to send you a file to be opened with
vim that may do something unsafe.
man
subdomai
n.
vi
m,
man
vi
m,
and
“
:help syntax
”
f
r
om
wi
t
hi
n
t
he
vim editor for particulars. The Novell AppArmor syntax is stored in
/usr/share/vim/vim61/syntax/subdomain.vim
syntax on
set modeline
set modelines=5