Giter Site home page Giter Site logo

nibags / selinux-ksyntaxhighlighting Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 455 KB

SELinux Policies Syntax Highlighting Definition for Kate (KSyntaxHighlighting Framework)

License: MIT License

HTML 100.00%
selinux syntax-highlighting kate cil selinux-policy kate-editor kwrite katepart ktexteditor ksyntaxhighlighting

selinux-ksyntaxhighlighting's Introduction

SELinux Policies Syntax Highlighting Definition for Kate (KSyntaxHighlighting Framework)

Example of SELinux policies (CIL policy & TE module) syntax highlighting

Author: Nibaldo González ([email protected])

Last Change: February 2021

Requirements: KDE Frameworks 5.80.0 or higher

These files are part of the KDE's KSyntaxHighlighting Framework.

Description:

Add syntax highlighting to KDE text editors (such as Kate, KWrite, KDevelop or any application that uses the KSyntaxHighlighting or KTextEditor Framework) for:

  • SELinux Kernel Policy Language (selinux.xml).
  • SELinux CIL Policies (selinux-cil.xml).
  • SELinux File Contexts (selinux-fc.xml).

NOTE: selinux-cil.xml and selinux-fc.xml depend on selinux.xml.

For details on the syntax of SELinux policies, visit:

About XML Files of Syntax Highlighting Definition:

The syntax highlighting definition files, of the KSyntaxHighlighting Framework, consist of XML files that are compiled in the KDE Frameworks libraries.

However, these XML files can also be stored in:

For local user $HOME/.local/share/org.kde.syntax-highlighting/syntax/
For all users /usr/share/org.kde.syntax-highlighting/syntax/
For Flatpak packages $HOME/.var/app/package-name/data/org.kde.syntax-highlighting/syntax/
For Snap packages $HOME/snap/package-name/current/.local/share/org.kde.syntax-highlighting/syntax/
On Windows %USERPROFILE%\AppData\Local\org.kde.syntax-highlighting\syntax\
On macOS $HOME/Library/Application Support/org.kde.syntax-highlighting/syntax/

For more details of KSyntaxHighlighting Framework, visit:

Installation:

Important: selinux-cil.xml & selinux-fc.xml depend on selinux.xml. To avoid problems, do not install the files separately, but the 3 together.

If you do not have the latest version of KDE Frameworks, you can manually install the latest .xml files.

Copy the .xml files to the directory of the XML syntax definition files, mentioned in the previous section.

Ex.: For local user:

mkdir -p $HOME/.local/share/org.kde.syntax-highlighting/syntax/
cp ./selinux{,-cil,-fc}.xml $HOME/.local/share/org.kde.syntax-highlighting/syntax/

For all users:

sudo mkdir -p /usr/share/org.kde.syntax-highlighting/syntax/
sudo cp ./selinux{,-cil,-fc}.xml /usr/share/org.kde.syntax-highlighting/syntax/

Usage:

Syntax highlighting of SELinux policies (selinux.xml) is automatically applied to named files: *.te, *.if, *.spt, policy.conf, access_vectors, mls, mcs, mls_macros, te_macros, policy_capabilities, seapp_contexts & port_contexts.

Syntax highlighting of SELinux file contexts is applied to named files: *.fc, file_contexts, file_contexts_*, file_contexts.local, file_contexts.homedirs, file_contexts.template, homedir_template, property_contexts, service_contexts, hwservice_contexts, initial_sid_contexts, genfs_contexts & fs_use.

Syntax highlighting of SELinux CIL policies is applied to files with .cil extension.

You can also force the syntax highlighting by writing a comment with:

kate: syntax SELinux Policy;
kate: syntax SELinux CIL Policy;
kate: syntax SELinux File Contexts;

List of Versions:

selinux.xml
Version
selinux-fc.xml
Version
Date KDE
Frameworks
SELinux
Support
(checkpolicy)
Relevant Changes
9 9 Feb. 24, 2021 5.80.0 3.0 Improve colors and performance of RegExpr rules.
5 7 Sep. 30, 2020 5.75.0 3.0 Use include keywords.
3 - Dec. 10, 2019 5.66.0 3.0
  • Add "glblub" keyword (default_range).
  • Update permissions list.
- 4 Apr. 02, 2019 5.57.0 2.8 / 2.9 No changes, only one indentation is removed.
2 3 Sep. 09, 2018 5.51.0 2.8 Update itemData's style for the new Solarized color schemes of Kate.
1 2 Aug. 28, 2018 5.50.0 2.8 Implement "selinux.xml": some rules and keywords of "selinux-fc.xml" are moved there.
- 1 Jan. 26, 2018 5.44.0 -
selinux-cil.xml
Version
Date KDE
Frameworks
SELinux
Support
(secilc)
Relevant Changes
10 Feb. 19, 2021 5.80.0 3.0 Improve performance of RegExpr rules.
7 Sep. 30, 2020 5.75.0 3.0 Use include keywords and improve color brackets.
5 Dec. 10, 2019 5.66.0 3.0 Add "glblub" keyword (defaultrange).
3 Apr. 02, 2019 5.57.0 2.8 / 2.9 No changes, only one indentation is removed.
2 Aug. 28, 2018 5.50.0 2.8
  • Add keywords of Android and BPF permissions.
  • Implement "selinux.xml": some rules and keywords of "selinux-cil.xml" are moved there.
1 Jan. 26, 2018 5.44.0 2.7

selinux-ksyntaxhighlighting's People

Contributors

nibags avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.