Add syntax highlighting for SELinux CIL Policies & File Contexts

Authored by dhaumann on Feb 24 2018, 9:16 PM.

Description

Add syntax highlighting for SELinux CIL Policies & File Contexts

Summary:
SELinux CIL Policies:
The SELinux Common Intermediate Language (CIL) is a language for creating security policies. This is a recent language and is part of the official SELinux project.

More information:

SELinux File Contexts files (File Labeling Policy):
These contain the security contexts for paths/files. This highlighting applies to the following files:

  • "file_contexts", "file_contexts.local", "file_contexts.template", "file_contexts.homedirs", "homedir_template": They are SELinux configuration files. They are usually stored in: /etc/selinux/targeted/contexts/. The file 'file_contexts' is also generated when compiling the CIL policy.
  • "*.fc": These files are part of the SELinux Reference Policy.

The CIL syntax is very similar to the Scheme language, therefore, I used the bracket highlighting code of the Scheme XML file as a base (I even used the same bracket colors). At the beginning of the file I gave credits to the author of the Scheme file (Dominik Haumann), but I am not sure if this is the correct way.

Regards!

Reviewers: Framework: Syntax Highlighting, dhaumann

Reviewed By: Framework: Syntax Highlighting, dhaumann

Subscribers: dhaumann, ngraham, Framework: Syntax Highlighting, Frameworks

Tags: Frameworks, Framework: Syntax Highlighting

Differential Revision: https://phabricator.kde.org/D10174