forked from microsoft/regorus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated readme. Added bundle support. (microsoft#61)
Signed-off-by: Anand Krishnamoorthi <[email protected]>
- Loading branch information
Showing
12 changed files
with
280 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package example | ||
|
||
default allow := false # unless otherwise defined, allow is false | ||
|
||
allow := true { # allow is true if... | ||
count(violation) == 0 # there are zero violations. | ||
} | ||
|
||
violation[server.id] { # a server is in the violation set if... | ||
some server | ||
public_server[server] # it exists in the 'public_server' set and... | ||
server.protocols[_] == "http" # it contains the insecure "http" protocol. | ||
} | ||
|
||
violation[server.id] { # a server is in the violation set if... | ||
server := input.servers[_] # it exists in the input.servers collection and... | ||
server.protocols[_] == "telnet" # it contains the "telnet" protocol. | ||
} | ||
|
||
public_server[server] { # a server exists in the public_server set if... | ||
some i, j | ||
server := input.servers[_] # it exists in the input.servers collection and... | ||
server.ports[_] == input.ports[i].id # it references a port in the input.ports collection and... | ||
input.ports[i].network == input.networks[j].id # the port references a network in the input.networks collection and... | ||
input.networks[j].public # the network is public. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"servers": [ | ||
{"id": "app", "protocols": ["https", "ssh"], "ports": ["p1", "p2", "p3"]}, | ||
{"id": "db", "protocols": ["mysql"], "ports": ["p3"]}, | ||
{"id": "cache", "protocols": ["memcache"], "ports": ["p3"]}, | ||
{"id": "ci", "protocols": ["http"], "ports": ["p1", "p2"]}, | ||
{"id": "busybox", "protocols": ["telnet"], "ports": ["p1"]} | ||
], | ||
"networks": [ | ||
{"id": "net1", "public": false}, | ||
{"id": "net2", "public": false}, | ||
{"id": "net3", "public": true}, | ||
{"id": "net4", "public": true} | ||
], | ||
"ports": [ | ||
{"id": "p1", "network": "net1"}, | ||
{"id": "p2", "network": "net3"}, | ||
{"id": "p3", "network": "net2"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.