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.
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 query
results = engine.eval_query('data.framework.mount_overlay=x')
# Print results
print(results['result'][0])
# Eval query as json
results_json = engine.eval_query_as_json('data.framework.mount_overlay=x')
print(results_json)
Metadata
Release files for lakera-regorus 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 128.8 MB
Release files / lakera_regorus-0.1.0-cp311-cp311-manylinux_2_34_aarch64.whl
| Download URL | lakera_regorus-0.1.0-cp311-cp311-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 19.9 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ ARM64 |
|
SHA-256 checksum How to use checksums |
fbc683256faea08a09fe8d03ee09939bc4d2b2307bf4714b117a0c79a54a654b
|
|
BLAKE2b-256 checksum How to use checksums |
893f4f97249a6036849f39cedf1f517f5b03936d6912f7380ee9ba1e88b07148
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp311-cp311-manylinux_2_27_x86_64.whl
| Download URL | lakera_regorus-0.1.0-cp311-cp311-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 20.5 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
e2d346c2023206f57afac8a749f756b9cc2a7feeb155a79aba6693471f7fdd8c
|
|
BLAKE2b-256 checksum How to use checksums |
f9551322cee33da41d4f8abf11877bbb80f978ab5f3e99182f4e40aafcee2940
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | lakera_regorus-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 20.4 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b7a797e225ce653c665e15710f05b23b8495474456dc4cabc8111ec2c3c7608f
|
|
BLAKE2b-256 checksum How to use checksums |
ba14ca8df72aca11140abf40c33a0d032ac5218d5962e7230d33a2a902b88135
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | lakera_regorus-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 19.8 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
95f5d046bbf13f17f19426e56f1a77f1a6e1c10c85847c7164792160562f6ebf
|
|
BLAKE2b-256 checksum How to use checksums |
337a9441dfe7adac34ca8111333fc146b6e2a4e22474c55cf2723a12b1507fad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | lakera_regorus-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
15d58bdc5aaee2bb39cfea34ef16b742ad1164927c4b6f8654e454e6ec1a0083
|
|
BLAKE2b-256 checksum How to use checksums |
311a5b8f0d42b78db6bcd7ca93c852e0b956916ad433e2affd515b70f38da0a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | lakera_regorus-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4970b41d029add72dc1788755fe494e40da208f47f2fa6d43abf0a1d6bf8f777
|
|
BLAKE2b-256 checksum How to use checksums |
d82e92ec80ff01831214dbc380d9aaaf3d13f8fa2db984faab3bc5675602d1aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | lakera_regorus-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 20.4 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d671e58f122fb2ce16be258d31a5762e122eddbfdc5c7681c2c931268d08416b
|
|
BLAKE2b-256 checksum How to use checksums |
8af781dadaf1c747f01a2773e086d1c676502eabf9431ecd696f61538149634a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lakera_regorus-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | lakera_regorus-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 19.8 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
7bca3942bff8c405c3a84bf5594fece7f0831257d0377ac5685247ab5b6043ed
|
|
BLAKE2b-256 checksum How to use checksums |
1c05a0542ee1605f88b35dc182480b23a7d80de5369ecc32135be17606f5e3fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|