Skip to content

Commit f4e1a8a

Browse files
authored
Add information about public ca key, access key, and secret key. (#4419)
* Add information about public ca key, access key, and secret key. Signed-off-by: Ian Maddaus <[email protected]> * Fix heading Signed-off-by: Ian Maddaus <[email protected]> * Another minor fix Signed-off-by: Ian Maddaus <[email protected]> * Editing Signed-off-by: Ian Maddaus <[email protected]> * Update 360 SaaS port number Signed-off-by: Ian Maddaus <[email protected]> --------- Signed-off-by: Ian Maddaus <[email protected]>
1 parent 65fc041 commit f4e1a8a

File tree

1 file changed

+69
-10
lines changed

1 file changed

+69
-10
lines changed

content/360/saas/get_started/enroll_nodes.md

+69-10
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ To enroll a Windows node, follow these steps:
120120
121121
## Cookbook-based enrollment
122122
123-
With cookbook-based enrollment, you enroll nodes from the client side by uploading a [cookbook](https://docs.chef.io/cookbooks/) with enrollment settings to Chef Infra Server and then Chef Infra Client enrolls the node with Chef 360 SaaS.
123+
With cookbook-based enrollment, you enroll nodes from the client side by uploading a [cookbook](/cookbooks/) with enrollment settings to Chef Infra Server and then Chef Infra Client enrolls the node with Chef 360 SaaS.
124124
125-
### Enroll nodes
125+
### Enroll nodes with a cookbook
126126
127127
The `chef-cookbook-enroll` cookbook uses the `node_management_enroll` custom resource and a [wrapper cookbook](https://www.chef.io/blog/writing-wrapper-cookbooks) to define enrollment settings.
128128
@@ -144,23 +144,82 @@ To configure the cookbooks and define enrollment settings, follow these steps:
144144
chef generate cookbook <COOKBOOK_NAME>
145145
```
146146
147-
In the [`metadata.rb` file](https://docs.chef.io/config_rb_metadata/) of your wrapper cookbook, add the following dependency to include the `chef-cookbook-enroll` cookbook:
147+
In the [`metadata.rb` file](/config_rb_metadata/) of your wrapper cookbook, add the following dependency to include the `chef-cookbook-enroll` cookbook:
148148
149149
```ruby
150150
depends 'chef360-node-enroll', '~> 1.0.0'
151151
```
152152
153+
1. Copy of the Chef 360 SaaS public key and add it to your wrapper cookbook:
154+
155+
```plaintext
156+
-----B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bddTKJd+82cEHhXXipa0
173+
095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVE
174+
TI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02
175+
JQZR7rkpeDMdmztcpHWD9f
176+
-----END CERTIFICATE-----
177+
```
178+
179+
This public key expires on March 18, 2029.
180+
181+
1. Generate an access key and secret key:
182+
183+
```bash
184+
chef-platform-auth-cli user-account self create-token --body '{"expiration": "<EXPIRATION_DATE>", "name": "<TOKEN_NAME>"}' --profile <PROFILE_NAME>
185+
```
186+
187+
Replace:
188+
189+
- `<EXPIRATION_DATE>` with a date and time in ISO 8601 format (for example, `2027-12-31T11:42:23-05:00`).
190+
- `<TOKEN_NAME>` with a meaningful token name for easy identification.
191+
- `<PROFILE_NAME>` with a profile that has the node-manager role assigned to it.
192+
193+
The response includes an access key and secret key and is similar to the following:
194+
195+
```json
196+
{
197+
"item": {
198+
"accessKey": "6QIUKP4WIXD4RVAF0BQ3",
199+
"expiration": "2027-12-31T11:42:23-05:00",
200+
"id": "bcba5b7a-fb0b-4a62-b442-7ba7bda5e05a",
201+
"name": "CI-CD Token",
202+
"role": {
203+
"id": "5fcb0235-1e56-4ece-8857-404a5d39a290",
204+
"name": "tenant-admin"
205+
},
206+
"secretKey": "x6aCg1NckQoLsQnere26fmGgD0RiWOrf4RNXBhlg"
207+
}
208+
}
209+
```
210+
153211
1. Define the `node_management_enroll` resource in your wrapper cookbook's recipe:
154212

155213
```ruby
156214
node_management_enroll 'Enroll Node' do
157215
chef_platform_url '<CHEF_360_FQDN>'
158216
enroll_type '<ENROLLMENT_TYPE>'
159-
api_port '<API_PORT>'
217+
api_port '443'
160218
access_key '<ACCESS_KEY>'
161219
secret_key '<SECRET_KEY>'
162220
cohort_id '<COHORT_ID>'
163221
hab_builder_url '<HABITAT_BUILDER_URL>'
222+
root_ca <CHEF_360_SAAS_PUBLIC_KEY>
164223
working_dir_path '<VALID_DIR_PATH>'
165224
upgrade_skills <UPGRADE_SKILLS>
166225
end
@@ -170,30 +229,30 @@ To configure the cookbooks and define enrollment settings, follow these steps:
170229

171230
- `<CHEF_360_FQDN>` with the fully qualified domain name (FQDN) for your Chef 360 SaaS deployment.
172231
- `<ENROLLMENT_TYPE>` with either `full` or `partial` depending on the form of enrollment. Use `full` unless you must `partial`.
173-
- `<API_PORT>` with the API port configured in Chef 360 SaaS. The default value is `31000`.
174-
- `<ACCESS_KEY>` with an access key for secure communication with Chef 360 SaaS. Store securely using an [encrypted Chef data bag](https://docs.chef.io/data_bags/) or a [secrets manager](https://docs.chef.io/infra_language/secrets/).
175-
- `<SECRET_KEY>` with a secret key for secure communication with Chef 360 SaaS. Store securely using an [encrypted Chef data bag](https://docs.chef.io/data_bags/) or a [secrets manager](https://docs.chef.io/infra_language/secrets/).
232+
- `<ACCESS_KEY>` with the access key for secure communication with Chef 360 SaaS. This should be stored using an [encrypted Chef data bag](/data_bags/) or [secrets manager](/infra_language/secrets/).
233+
- `<SECRET_KEY>` with the secret key for secure communication with Chef 360 SaaS. This should be stored using an [encrypted Chef data bag](/data_bags/) or [secrets manager](/infra_language/secrets/).
176234
- `<COHORT_ID>` with a valid cohort UUID. The cohort defines all skills and settings installed on the node.
177235
- `<HABITAT_BUILDER_URL>` with the URL of the Chef Habitat Builder used by your organization. Default value: `https://bldr.habitat.sh`
236+
- `<CHEF_360_SAAS_PUBLIC_KEY>` if TLS is enabled, with the root CA public key. For example, `node['enroll']['root_ca']`.
178237
- `<VALID_DIR_PATH>` with a temporary working directory where all required builds are downloaded. Specify a valid path based on the OS. Default value: `/tmp`.
179238
- `<UPGRADE_SKILLS>` with `true` or `false`. If `true`, Chef 360 SaaS checks for the latest skill versions and installs them if found. Default value: `false`.
180239

181240
1. Push the wrapper cookbook or policy to the Chef Infra Server.
182241

183-
1. If you're using a role, [upload](https://docs.chef.io/workstation/knife_cookbook/#upload) the wrapper cookbook to the Chef Infra Server:
242+
1. If you're using a role, [upload](/workstation/knife_cookbook/#upload) the wrapper cookbook to the Chef Infra Server:
184243
185244
```bash
186245
knife cookbook upload <WRAPPER_COOKBOOK_NAME> --cookbook-path <WRAPPER_COOKBOOK_DIR_PATH>
187246
```
188247
189-
1. If you're using a Policyfile, [create `Policyfile.lock.json` file](https://docs.chef.io/workstation/ctl_chef/#chef-install) and [push](https://docs.chef.io/workstation/ctl_chef/#chef-push) the Policyfile to Chef Infra Server:
248+
1. If you're using a Policyfile, [create `Policyfile.lock.json` file](/workstation/ctl_chef/#chef-install) and [push](/workstation/ctl_chef/#chef-push) the Policyfile to Chef Infra Server:
190249

191250
```bash
192251
chef install
193252
chef push <POLICY_GROUP> <POLICYFILE>
194253
```
195254

196-
1. Include the wrapper cookbook in your node's run-list by adding it to a role or Policyfile. See the [run-list](https://docs.chef.io/run_lists/) and [role](https://docs.chef.io/roles/#manage-roles) documentation for more information.
255+
1. Include the wrapper cookbook in your node's run-list by adding it to a role or Policyfile. See the [run-list](/run_lists/) and [role](/roles/#manage-roles) documentation for more information.
197256
198257
The next time Chef Infra Client runs, it executes the `node_management_enroll` resource and the node is enrolled with Chef 360 SaaS.
199258

0 commit comments

Comments
 (0)