MCPcopy Index your code
hub / github.com/dburgener/cascade

github.com/dburgener/cascade @v0.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.2 ↗ · + Follow
241 symbols 636 edges 13 files 25 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Introduction

Cascade is a project to build a new high level language for defining SELinux policy.

The overall structure of the language is essentially object oriented, with types carrying knowledge of their use and a hierarchical inheritance tree of type definition which reflects real world usage in a variety of scenarios. The syntax is largely rust inspired, although inspiriation is taken from a variety of language with a focus on simplicity, consistency and familiarity to developers from a variety of backgrounds.

Getting Started

To build the executables run:

$ cargo build

To run tests, run:

$ cargo test

Cargo will automatically download all Rust crate dependencies. The tests depend on the secilc package.

casc

The Cascade compiler is named casc, and will be located at target/debug/casc after a successful build. Input files are supplied as arguments. Directory arguments are searched recursively for policy files. If no valid policy files are found, casc will exit with an error.

$ casc my_policy.cas

casc will create a file named out.cil, containing CIL policy. This CIL policy can then be compiled into final SELinux policy using secilc.

More arguments and configuration for casc will be added in future releases

audit2cascade

The current audit2cascade binary is a simple placeholder. Eventually this will be turned into a tool similar to audit2allow or audit2why which generates Cascade policy based on an output of AVC denial messages in the audit logs. It will take advantage of the semantic information present in the hll policy to aid the developer in making intelligent decisions about handling denials rather than simply adding raw allow rules.

Writing Cascade policy

For details on writing Cascade policy, see Type Enforcement.

Contribute

Thank you for your interest in contributing! There are several ways you can contribute to this project.

Reporting bugs and suggesting enhancements

If you see something wrong or have a suggestion for improvement, feel free to create an issue in the Issue tracker

Contributing code

We'd welcome your code contributions via GitHub PR. If you're planning on adding a major feature, it would probably be good to discuss it in the issue tracker prior to doing too much work so that we can all come to a consensus on how it should work. No advanced discussion is needed for smaller tweaks and bug fixes.

Project status

The project is still in its early stages and is being developed and improved rapidly. Not all features present in the documentation may be fully implemented yet. For the latest changes please see CHANGELOG.md, and for future work plans and milestones please see ROADMAP.md.

Extension points exported contracts — how you extend this code

Virtualable (Interface)
(no doc) [3 implementers]
src/ast.rs
Annotated (Interface)
(no doc) [2 implementers]
src/internal_rep.rs

Core symbols most depended-on inside this repo

add_class
called by 103
src/internal_rep.rs
as_ref
called by 55
src/ast.rs
iter
called by 52
src/internal_rep.rs
push
called by 41
src/ast.rs
get
called by 32
src/internal_rep.rs
get_range
called by 32
src/internal_rep.rs
append
called by 26
src/error.rs
next
called by 22
src/error.rs

Shape

Function 100
Method 91
Class 34
Enum 14
Interface 2

Languages

Rust100%

Modules by API surface

src/internal_rep.rs95 symbols
src/ast.rs39 symbols
src/lib.rs37 symbols
src/compile.rs28 symbols
src/error.rs20 symbols
src/context.rs14 symbols
src/bin/casc.rs3 symbols
src/sexp_internal.rs2 symbols
src/obj_class.rs1 symbols
src/bin/audit2cascade.rs1 symbols
build.rs1 symbols

For agents

$ claude mcp add cascade \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact