# Tools Documentation

Last modified: $Date: 2007-02-17 17:20:49 +0900 (Sat, 17 Feb 2007) $

## <<Tools for system administrators>>

### <Policy Editor "editpolicy">

Edits the current policy in /proc/ccs/policy/ directory.

You may give one of "s" "e" "d" to the commandline to choose the initial screen. If not given, screen for domain listing is shown.

<Scroll>

Up-arrow | Scroll 1 line up.
Down-arrow | Scroll 1 line down.
PageUp | Scroll 1 page up.
PageDown | Scroll 1 page down.
Right-arrow | Scroll 1 column right.
Left-arrow | Scroll 1 column left.
Home | Move to the top of line.
End | Move to the bottom of line.

<Search>

f/F | Find First
n/N | Find Next
p/P | Find Previous

<Edit>

a/A | Add an entry.
Enter | Edit ACLs of a domain at the cursor position. (Valid only for screen for domain listing.)
Space | Invert selection state of an entry at the cursor position.
c/C | Copy selection state of an entry at the cursor position to all entries below the cursor position.
d/D | Delete selected entries.
s/S | Set profile number of selected entries. (Valid only for screen for domain listing.)
Insert | Copy an entry at the cursor position to history buffer.

<Misc>

q/Q | Quit
r/R | Refresh
Tab | Switch to next screen.

### <Off-line Policy Editor "editpolicy_offline">

Edits the policy in /etc/ccs/ directory.

The usage is the same as "editpolicy".

### <Policy Loader "loadpolicy">

Reloads the on-disk policy onto memory.

There are the following commandline parameters.

- s --- Reload system policy.
- e --- Reload exception policy.
- d --- Reload domain policy.
- a --- Reload the above three policies.
- f --- Erase on-memory policy before loading.

### <Control Level Changer "setlevel">

Changes the current control level (i.e. writing to /proc/ccs/status ) and displays the new control level.

You can give the new control level from commandline parameter.

### <Profile Selector "setprofile">

Assigns a profile to domains.

You can give the new profile number and domainnames from the commandline parameter. The list of domainnames that the profile number assigned to has changed is printed.

### <Process Info Viewer "ccstree">

Lists the domainnames of currently running processes belong to and the profile numbers the domains currently assigned to.

This program shows the profile number, the name of process, PID, the domainname like "pstree" command.

### <Policy Saver "savepolicy">

Saves the on-memory policy onto disk.

There are the following commandline parameters.

- s --- Save system policy.
- e --- Save exception policy.
- d --- Save domain policy.
- a --- Save the above three policies.
- f --- Save even if on-memory policy and on-disk policy are same.

### <Template Generator for SYAORAN Filesystem "makesyaoranconf">

Generates syaoran.conf, the configuration file for SYAORAN (the Tamper-Proof /dev filesystem). You can use SYAORAN filesystem if you want to run the system with read-only root fs or you want to prevent device files from tampering.

You can't create files that are not listed in the configuration file. If the system creates device files dynamically, attach all necessary devices before executing this program to ensure all device files are listed in the configuration file.

### <Access Log Reading Daemon "ccs-auditd">

Reads from /proc/ccs/info/grant_log and /proc/ccs/info/reject_log and writes to the location given in the commandline parameters.

The first commandline parameter is the location of access granted log. The second one is the location of access rejected log. You may give /dev/null as the location. If you needn't to save access logs, you needn't to run this program.

This program runs as a daemon. You can start from /etc/rc.d/rc.local if you are using RedHat Linux. The number of logs that the kernel will keep is given using "MAX_GRANT_LOG=integer" and "MAX_REJECT_LOG=integer" lines in the profile.

### <Access Log Compressor "sortpolicy">

Remove duplicated entry from logs written by "ccs-auditd".

Reads logs written by "ccs-auditd" from standard input and sorts by domains and removes duplicated entries and writes to standard output.

### <Temporal Pathnames Detector "findtemp">

Reads domain policy from standard input and checks the existence of pathnames, and dumps the nonexistent pathnames.

The nonexistent pathnames are likely used as temporal pathnames. So find the naming rules from similar nonexistent pathnames and append the pattern to /etc/ccs/exception_policy.txt and /proc/ccs/policy/exception_policy .

You can pass the content of /etc/ccs/domain_policy.txt or /proc/ccs/policy/domain_policy using redirection or pipes to the standard input of this program.

### <Library Pathnames Updater "ld-watch">

Appends shared libraries to exception policy automatically using "allow_read" directive when the location of shared libraries in /etc/ld.so.cache has changed.

By running this program while updating packages, you can avoid errors "unable to start applications because shared libraries are unreadable" when the pathnames of shared libraries accessed by general programs has changed.

### <Delayed Enforcing Mode Handler "ccs-queryd">

Detects policy violation and displays the access request. You can tell the system whether the access request should be granted (or granted and policy should be appended to grant the access request) or rejected after you validate the access request.

By running this program while updating packages, you can avoid errors due to insufficient permissions.

Never grant access requests unconditionally. The cause of policy violation is not always updating packages, but may by malicious requests by attackers. If you grant access requests caused by malicious requests by attackers, the system gets intruded.

To enable "delayed enforcing mode", you need to either set "ALLOW_ENFORCE_GRACE=1" in /proc/ccs/status using "setlevel" command or assign a profile whose ALLOW_ENFORCE_GRACE is set to 1 to domains using "setprofile" command.

### <Policy Syntax Checker "checkpolicy">

Reads policy files from standard input and checks syntaxes.

Prints errors with line numbers if any.

### <Initial Policy Loader ".init">

Loads policy files from /etc/ccs/ directory and executes /sbin/init .

Run this program by giving "init=/.init" option to kernel commandline.

### <ACL Searcher "domainmatch">

This is a "fgrep" for /proc/ccs/policy/domain_policy .

### <Pathname Pattern Replacer "patternize">

Reads domain policy from standard input and replaces pathnames with patterns if the pathname matches to patterns given at commandline and writes to standard output. Pathnames that contains execute permission and domainnames won't be patterned.

### <Template Generator for Exception Policy "make_alias.sh/make_allow_read.sh/make_exception.sh/make_file_pattern.sh">

Generates templates for exception policy. You need to review the output because automatically generated exception policy may contain redundant or dangerous entries.

## <<Tools for reinforcing login authentications>>

### <Restricted login shell for authentication "falsh">

A tiny shell that has no built-in command such as "kill". You can use this program for login shell ( the shell specified in the /etc/passwd file). You won't need this program if you don't want to reinforce login authentications.

You should make your own programs for additional authentications. You shouldn't use the following example programs without modifications.

### <An example program for password authentication with timings "honey">

This program fails unless the correct password is typed with the correct time interval. Conventional authentication programs don't check the time interval of typing, but this program does to prevent password brute force attack.

### <An example program for password authentication with time limit "candy">

This program fails unless the correct password is typed and this program was invoked within 10 seconds after the parent process was invoked. Conventional authentication programs don't check the time interval between the invocation time of parent process and the invocation time of child process, but this program does to prevent password brute force attack.

### <An example program for lockfile authentication "groovy">

This program fails while the file /tmp/.lockme exists. This program prompts for password, but doesn't check for password. This program checks for the existence of the file /tmp/.lockme . This program prevents password brute force attack by keeping locked just before you run this program. This is a program for demonstration, and using a filename that are apparent to crackers. You must customize if you want to use.

### <An example program for token authentication "gettoken / checktoken">

This program generates tokens based on the system time. The authentication will succeed if the output of "gettoken" is passwd to the input of "checktoken". These are programs for demonstration, and the algorithm is too poor. You must customize if you want to use.

### <An example program for challenge-handshake authentication "chaplet">

This program displays strings as a challenge data. The authentication will succeed if you input only numerical letters from the challenge data as a response data. This is a program for demonstration, and the algorithm is too poor. You must customize if you want to use.

### <An example program for password authentication with timings "timeauth">

This is a re-implementation of "honey". Create a script and specify this program as the interpreter for the script.

### <An example program for one-time-password authentication using mail "mailauth">

This program generates one time password and sends it to the user using "mail". The authentication will succeed if the user input the password sent by "mail". To use this program, some mail server application is needed.

### <A simple port forwarder "proxy">

This program is used by client side. This program explicitly binds to local port and connects to server so that the server side firewall (such as "iptables") can use packet filtering based on client side's port number.

Return to index