2021-07-03 05:55:32 -04:00
|
|
|
{
|
|
|
|
// Declare static groups of users beyond those in the identity service.
|
2022-06-08 07:40:15 -04:00
|
|
|
"groups": {
|
2021-07-03 05:55:32 -04:00
|
|
|
"group:example": [
|
|
|
|
"user1@example.com",
|
|
|
|
"user2@example.com",
|
|
|
|
],
|
2021-07-03 11:31:08 -04:00
|
|
|
"group:example2": [
|
|
|
|
"user1@example.com",
|
|
|
|
"user2@example.com",
|
|
|
|
],
|
2021-07-03 05:55:32 -04:00
|
|
|
},
|
|
|
|
// Declare hostname aliases to use in place of IP addresses or subnets.
|
2022-06-08 07:40:15 -04:00
|
|
|
"hosts": {
|
2021-07-03 05:55:32 -04:00
|
|
|
"example-host-1": "100.100.100.100",
|
|
|
|
"example-host-2": "100.100.101.100/24",
|
|
|
|
},
|
|
|
|
// Define who is allowed to use which tags.
|
2022-06-08 07:40:15 -04:00
|
|
|
"tagOwners": {
|
2021-07-03 05:55:32 -04:00
|
|
|
// Everyone in the montreal-admins or global-admins group are
|
|
|
|
// allowed to tag servers as montreal-webserver.
|
|
|
|
"tag:montreal-webserver": [
|
2021-07-04 07:01:41 -04:00
|
|
|
"group:example",
|
2021-07-03 05:55:32 -04:00
|
|
|
],
|
|
|
|
// Only a few admins are allowed to create API servers.
|
2021-07-04 07:01:41 -04:00
|
|
|
"tag:production": [
|
|
|
|
"group:example",
|
2021-07-03 05:55:32 -04:00
|
|
|
"president@example.com",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// Access control lists.
|
2022-06-08 07:40:15 -04:00
|
|
|
"acls": [
|
2021-07-03 05:55:32 -04:00
|
|
|
// Engineering users, plus the president, can access port 22 (ssh)
|
|
|
|
// and port 3389 (remote desktop protocol) on all servers, and all
|
|
|
|
// ports on git-server or ci-server.
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"action": "accept",
|
|
|
|
"src": [
|
2021-07-03 11:31:08 -04:00
|
|
|
"group:example2",
|
2021-07-04 07:01:41 -04:00
|
|
|
"192.168.1.0/24"
|
2021-07-03 05:55:32 -04:00
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"dst": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"*:22,3389",
|
|
|
|
"git-server:*",
|
|
|
|
"ci-server:*"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// Allow engineer users to access any port on a device tagged with
|
|
|
|
// tag:production.
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"action": "accept",
|
|
|
|
"src": [
|
2021-07-03 11:31:08 -04:00
|
|
|
"group:example"
|
2021-07-03 05:55:32 -04:00
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"dst": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"tag:production:*"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// Allow servers in the my-subnet host and 192.168.1.0/24 to access hosts
|
|
|
|
// on both networks.
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"action": "accept",
|
|
|
|
"src": [
|
2021-07-04 07:01:41 -04:00
|
|
|
"example-host-2",
|
2021-07-03 05:55:32 -04:00
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"dst": [
|
2021-07-03 11:31:08 -04:00
|
|
|
"example-host-1:*",
|
2021-07-03 05:55:32 -04:00
|
|
|
"192.168.1.0/24:*"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// Allow every user of your network to access anything on the network.
|
|
|
|
// Comment out this section if you want to define specific ACL
|
|
|
|
// restrictions above.
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"action": "accept",
|
|
|
|
"src": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"*"
|
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"dst": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"*:*"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// All users in Montreal are allowed to access the Montreal web
|
|
|
|
// servers.
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"action": "accept",
|
|
|
|
"src": [
|
2021-07-03 11:31:08 -04:00
|
|
|
"example-host-1"
|
2021-07-03 05:55:32 -04:00
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"dst": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"tag:montreal-webserver:80,443"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// Montreal web servers are allowed to make outgoing connections to
|
|
|
|
// the API servers, but only on https port 443.
|
|
|
|
// In contrast, this doesn't grant API servers the right to initiate
|
|
|
|
// any connections.
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"action": "accept",
|
|
|
|
"src": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"tag:montreal-webserver"
|
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"dst": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"tag:api-server:443"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
// Declare tests to check functionality of ACL rules
|
2022-06-08 07:40:15 -04:00
|
|
|
"tests": [
|
2021-07-03 05:55:32 -04:00
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"src": "user1@example.com",
|
|
|
|
"accept": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"example-host-1:22",
|
|
|
|
"example-host-2:80"
|
|
|
|
],
|
2022-06-08 07:40:15 -04:00
|
|
|
"deny": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"exapmle-host-2:100"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2022-06-08 07:40:15 -04:00
|
|
|
"src": "user2@example.com",
|
|
|
|
"accept": [
|
2021-07-03 05:55:32 -04:00
|
|
|
"100.60.3.4:22"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|