Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Opa | 8,067 | 82 | 279 | 19 hours ago | 564 | September 07, 2022 | 312 | apache-2.0 | Go | |
An open source, general-purpose policy engine. | ||||||||||
Tongjian | 273 | 3 years ago | 10 | JavaScript | ||||||
资治通鉴易读版 | ||||||||||
Purescript Simple Json | 129 | 41 | a year ago | March 08, 2018 | 5 | mit | PureScript | |||
A simple Purescript JSON library that uses types automatically | ||||||||||
Keynote Extractor | 31 | 5 years ago | mit | AppleScript | ||||||
🎁 Extract Keynote presentations to JSON and Markdown using a simple script. | ||||||||||
Basicslider | 29 | 8 months ago | mit | JavaScript | ||||||
A slider in its purest form. | ||||||||||
Json Api Example | 24 | 8 years ago | Ruby | |||||||
JSON API example presented at Boston Ember on July 9, 2015. | ||||||||||
Networking With Rest Api Calls And Urlsession Unit Tests And Data Persistence In Core Data | 19 | 5 months ago | mit | Swift | ||||||
Networking in Swift with REST API calls and URLSession, that puts the parsed JSON Data from an HTTP based JSON storage endpoint I created into a TableView and persists the data using Core Data with CRUD (create, read, update, and delete). I used also Unit Tests to test URLSession asynchronous network operations and make the project as robust as possible. When the JSON data is parsed into the dynamic TableView cell we can easily delete the cell with a swipe, the TableView will then reload itself with a custom made animation and Core Data will update and save the changes in realtime. There is also an option to send HTTP GET requests to the JSONPlaceholder server. A And last but not least I implemented a settings launcher slide-up menu that slides up from the bottom of the screen when the settings tab bar button is pressed. On the slide-up menu, we have all the functionalities I mentioned above like getting the data from the REST API, filtering the data in the cells using a search bar and sorting them in the right alphabetical order, and also send data to a REST API. | ||||||||||
Mithril Slides | 18 | 5 years ago | 5 | other | HTML | |||||
A Keynote-inspired presentation app written with Mithril | ||||||||||
Presentations | 8 | 4 years ago | mit | JavaScript | ||||||
Tom Marrs' speaking engagement materials and slides. | ||||||||||
Jquery.jslide | 6 | 9 years ago | 1 | JavaScript | ||||||
Seamless photo gallery on desktop and mobile. |
The Open Policy Agent (OPA) is an open source, general-purpose policy engine that enables unified, context-aware policy enforcement across the entire stack.
OPA is hosted by the Cloud Native Computing Foundation (CNCF) as an incubating-level project. If you are an organization that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details read the CNCF announcement.
OPA gives you a high-level declarative language to author and enforce policies across your stack.
With OPA, you define rules that govern how your system should behave. These rules exist to answer questions like:
You integrate services with OPA so that these kinds of policy decisions do not have to be hardcoded in your service. Services integrate with OPA by executing queries when policy decisions are needed.
When you query OPA for a policy decision, OPA evaluates the rules and data (which you give it) to produce an answer. The policy decision is sent back as the result of the query.
For example, in a simple API authorization use case:
The examples below show different kinds of policies you can define with OPA as well as different kinds of queries your system can execute against OPA. The example queries are executed inside OPA's REPL which was built to make it easy to develop and test policies.
For concrete examples of how to integrate OPA with systems like Kubernetes, Terraform, Docker, SSH, and more, see openpolicyagent.org.
This example shows how you can enforce access controls over salary information served by a simple HTTP API. In this example, users are allowed to access their own salary as well as the salary of anyone who reports to them.
The management chain is represented in JSON and stored in a file (data.json
):
{
"management_chain": {
"bob": [
"ken",
"janet"
],
"alice": [
"janet"
]
}
}
Start OPA and load the data.json
file:
opa run data.json
Inside the REPL you can define rules and execute queries. Paste the following rules into the REPL.
default allow = false
allow {
input.method = "GET"
input.path = ["salary", id]
input.user_id = id
}
allow {
input.method = "GET"
input.path = ["salary", id]
managers = data.management_chain[id]
input.user_id = managers[_]
}
Is someone allowed to access their own salary?
> input := {"method": "GET", "path": ["salary", "bob"], "user_id": "bob"}
> allow
true
Display the management chain for Bob:
> data.management_chain["bob"]
[
"ken",
"janet"
]
Is Alice allowed to access Bob's salary?
> input := {"method": "GET", "path": ["salary", "bob"], "user_id": "alice"}
> allow
false
Is Janet allowed to access Bob's salary?
> input := {"method": "GET", "path": ["salary", "bob"], "user_id": "janet"}
> allow
true
This example shows how you can enforce where apps are deployed inside a simple orchestrator. In this example, apps must be deployed onto clusters that satisfy PCI and jurisdiction requirements.
app_placement[cluster_id] {
cluster = data.clusters[cluster_id]
satisfies_jurisdiction(input.app, cluster)
satisfies_pci(input.app, cluster)
}
satisfies_jurisdiction(app, cluster) {
not app.tags["requires-eu"]
}
satisfies_jurisdiction(app, cluster) {
app.tags["requires-eu"]
startswith(cluster.region, "eu-")
}
satisfies_pci(app, cluster) {
not app.tags["requires-pci-level"]
}
satisfies_pci(app, cluster) {
level = to_number(app.tags["requires-pci-level"])
level >= cluster.tags["pci-level"]
}
Where will this app be deployed?
> input := {"app": {"tags": {"requires-pci-level": "3", "requires-eu": "true"}}}
> app_placement
[
"prod-eu"
]
Display clusters in EU region:
> startswith(data.clusters[cluster_id].region, "eu-")
+------------+
| cluster_id |
+------------+
| "prod-eu" |
| "test-eu" |
+------------+
Display all clusters:
> data.clusters[cluster_id]
+------------+------------------------------------------------+
| cluster_id | data.clusters[cluster_id] |
+------------+------------------------------------------------+
| "prod-eu" | {"region":"eu-central","tags":{"pci-level":2}} |
| "prod-us" | {"region":"us-east"} |
| "test-eu" | {"region":"eu-west","tags":{"pci-level":4}} |
| "test-us" | {"region":"us-west"} |
+------------+------------------------------------------------+
This example shows how you can audit who has SSH access to hosts within different clusters. We will assume that SSH access is granted via group access in LDAP.
import data.ldap
import data.clusters
ssh_access[[cluster_name, host_id, user_id]] {
host_id = clusters[cluster_name].hosts[_]
group_id = ldap.users[user_id].groups[_]
group_id = clusters[cluster_name].groups[_]
}
prod_users = {user_id | ssh_access[["prod", _, user_id]]}
Who can access production hosts?
> prod_users
[
"alice",
"bob"
]
Display all LDAP users:
> data.ldap.users[user_id]
+-------------------------------+---------+
| data.ldap.users[user_id] | user_id |
+-------------------------------+---------+
| {"groups":["dev","platform"]} | "alice" |
| {"groups":["dev","ops"]} | "bob" |
| {"groups":["dev"]} | "janet" |
+-------------------------------+---------+
Display all cluster/group pairs:
> data.clusters[cluster_id].groups[_] = group_id
+------------+------------+
| cluster_id | group_id |
+------------+------------+
| "test" | "dev" |
| "test" | "ops" |
| "prod" | "ops" |
| "prod" | "platform" |
+------------+------------+
Does Janet have access to the test cluster?
> ssh_access[["test", _, "janet"]]
true
What are the addresses of the hosts in the test cluster that Janet can access?
> ssh_access[["test", host_id, "janet"]]; addr = data.hosts[host_id].addr
+------------+------------+
| addr | host_id |
+------------+------------+
| "10.0.0.1" | "host-abc" |
| "10.0.0.2" | "host-cde" |
| "10.0.0.3" | "host-efg" |
+------------+------------+
A third party security audit was performed by Cure53, you can see the full report here
Please report vulnerabilities by email to open-policy-agent-security. We will send a confirmation message to acknowledge that we have received the report and then we will send additional messages to follow up once the issue has been investigated.