Skip to content

Commit 85f9aec

Browse files
authored
Merge pull request #85 from olehermanse/acls
Added allow-all-hosts module
2 parents 993b384 + 6d3e421 commit 85f9aec

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

cfbs.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"description": "Repository of modules written by the CFEngine team.",
44
"type": "modules",
55
"provides": {
6+
"allow-all-hosts": {
7+
"description": "Allows all hosts / IP addresses to connect and fetch policy.",
8+
"subdirectory": "management/allow-all-hosts",
9+
"steps": ["json def.json def.json"]
10+
},
611
"autorun": {
712
"description": "Enable autorun functionality.",
813
"subdirectory": "management/autorun",

management/allow-all-hosts/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
By default, CFEngine only accepts incoming connections from IP addresses on the same network (`/16` subnet).
2+
This module changes the setting to allow all IP addresses.
3+
4+
**Warning:** This module is intended to make testing / demonstrations easier.
5+
It should **not** be used for production setups.
6+
7+
## Details
8+
9+
Internally, this changes the value of the `default:def.control_server_allowconnects` and `default:def.acl` variables.
10+
The 2 variables have the same default values, but control slightly different things:
11+
12+
* `default:def.control_server_allowconnects` - Works similar to a firewall. Controls which IP addresses are allowed to connect to the `cf-serverd`.
13+
* `default:def.acl` - Controls access to files on the server, i.e. which IP addresses are allowed to fetch files, most notably the policy set from `/var/cfengine/masterfiles` on the hub.
14+
15+
Advanced users might want to configure each of these variables individually, or even customize specific access for specific folders.
16+
17+
You can achieve the same by editing `/var/cfengine/masterfiles/def.json`:
18+
19+
```
20+
{
21+
"variables": {
22+
"default:def.control_server_allowconnects": ["0.0.0.0/0", "::/0"],
23+
"default:def.acl": ["0.0.0.0/0", "::/0"]
24+
}
25+
}
26+
```
27+
28+
You can also edit these variables using the CMDB feature in Mission Portal.
29+
30+
**Tip:** You can omit the first variable, it defaults to the value of `default:def.acl`, when not specified.
31+
32+
**Note:** The variables and defaults mentioned here are for the default CFEngine policy set (MPF).
33+
If you are only using the CFEngine binaries, not the default policy, these variables don't do anything special.

management/allow-all-hosts/def.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"variables": {
3+
"default:def.control_server_allowconnects": ["0.0.0.0/0", "::/0"],
4+
"default:def.acl": ["0.0.0.0/0", "::/0"]
5+
}
6+
}

0 commit comments

Comments
 (0)