Skip to main content

Rego policy engine implemented in Rust (gordon-to fork of microsoft/regorus).

Project description

regorus

Regorus is

  • Rego-Rus(t) - A fast, light-weight Rego interpreter written in Rust.
  • Rigorous - A rigorous enforcer of well-defined Rego semantics.

Regorus can be used in Python via regorus package. (It is not yet available in PyPI, but can be manually built.)

See Repository.

Automation

Run cargo xtask build-python to produce wheels via maturin, or cargo xtask test-python to reinstall the package locally and execute the sample script and pytest suite.

To build this binding, see building

Usage

import regorus

# Create engine
engine = regorus.Engine()

# Load policies
engine.add_policy_from_file('../../tests/aci/framework.rego')
engine.add_policy_from_file('../../tests/aci/api.rego')
engine.add_policy_from_file('../../tests/aci/policy.rego')

# Add policy data
data = {
  "metadata": {
    "devices": {
      "/run/layers/p0-layer0": "1b80f120dbd88e4355d6241b519c3e25290215c469516b49dece9cf07175a766",
      "/run/layers/p0-layer1": "e769d7487cc314d3ee748a4440805317c19262c7acd2fdbdb0d47d2e4613a15c",
      "/run/layers/p0-layer2": "eb36921e1f82af46dfe248ef8f1b3afb6a5230a64181d960d10237a08cd73c79",
      "/run/layers/p0-layer3": "41d64cdeb347bf236b4c13b7403b633ff11f1cf94dbc7cf881a44d6da88c5156",
      "/run/layers/p0-layer4": "4dedae42847c704da891a28c25d32201a1ae440bce2aecccfa8e6f03b97a6a6c",
      "/run/layers/p0-layer5": "fe84c9d5bfddd07a2624d00333cf13c1a9c941f3a261f13ead44fc6a93bc0e7a"
    }
  }
}
engine.add_data(data)

# Set input
input = {
  "containerID": "container0",
  "layerPaths": [
    "/run/layers/p0-layer0",
    "/run/layers/p0-layer1",
    "/run/layers/p0-layer2",
    "/run/layers/p0-layer3",
    "/run/layers/p0-layer4",
    "/run/layers/p0-layer5"
  ],
  "target": "/run/gcs/c/container0/rootfs"
}
engine.set_input(input)

# Eval rule
value = engine.eval_rule('data.framework.mount_overlay')

# Print value
print(value)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gordon_to_regorus-0.10.1.tar.gz (3.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gordon_to_regorus-0.10.1-cp310-abi3-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ ARM64

gordon_to_regorus-0.10.1-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

gordon_to_regorus-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file gordon_to_regorus-0.10.1.tar.gz.

File metadata

  • Download URL: gordon_to_regorus-0.10.1.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gordon_to_regorus-0.10.1.tar.gz
Algorithm Hash digest
SHA256 bcc06002bb6056b15e34a300130045b56895c91842803aaaaa26bc398f0f07cc
MD5 4693febccb3acaf0597650d0aaca44c4
BLAKE2b-256 cae07ccd52d83a695f5be020c17fead6715963567bd02a2e1d7e06935498acdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for gordon_to_regorus-0.10.1.tar.gz:

Publisher: publish-python.yml on gordon-to/gordon-to-regorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gordon_to_regorus-0.10.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for gordon_to_regorus-0.10.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1a24dce2ad911516aff6c829e35ea5886d035fa1a27f77eb964414c7cba80877
MD5 00139ff1f9fdd574040d4f76e7aa14ed
BLAKE2b-256 05ca8c19bcc013ad9f9d3847f8e7980ed61feaef662b07b1d0e262e22e5c5766

See more details on using hashes here.

Provenance

The following attestation bundles were made for gordon_to_regorus-0.10.1-cp310-abi3-win_amd64.whl:

Publisher: publish-python.yml on gordon-to/gordon-to-regorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2727b22fb4bb063d013b52071f176f4fac9c66dfb9710d119ac33447d570d9e1
MD5 949a8655dd965ca8379effdcd41655d7
BLAKE2b-256 d262022cfdf44170f20fd01badf04ebc226ce8d1b040814f7913177acc94a764

See more details on using hashes here.

Provenance

The following attestation bundles were made for gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish-python.yml on gordon-to/gordon-to-regorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 4467c2c44054df4ec2a521d731b70db8b26025536a8d0930e8a2f033bfd4b071
MD5 67c74e72209ced352cae20ddaaa26860
BLAKE2b-256 5b096a590cc75d056644c0f106d1b897091d582f9fabd046edf7560a5b0c20af

See more details on using hashes here.

Provenance

The following attestation bundles were made for gordon_to_regorus-0.10.1-cp310-abi3-manylinux_2_34_aarch64.whl:

Publisher: publish-python.yml on gordon-to/gordon-to-regorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gordon_to_regorus-0.10.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gordon_to_regorus-0.10.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47d0843ae5704e26fd85a96087e088617c2687573efa7395ae3d7f019d5086d6
MD5 47db337ff334d1a9bb2db0b997a85370
BLAKE2b-256 3c9c5ed6154bf346b934db1fad148cc047816113a86a0c08747fa2f7d339fad9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gordon_to_regorus-0.10.1-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: publish-python.yml on gordon-to/gordon-to-regorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gordon_to_regorus-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gordon_to_regorus-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e9c26d73f67ea9669bdc329eed4a121122623b501de16ef9f65cfd01c1e4b36d
MD5 844247e243ab2015cf595574c20df8c5
BLAKE2b-256 e39f490f73b3fe0b6f0eb58809c7cb1235ee151483845165788deab2b7b469fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for gordon_to_regorus-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-python.yml on gordon-to/gordon-to-regorus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page