Table of contents
1.
Introduction
2.
Component Overview
2.1.
Automate gateway
2.2.
Deployment Service
2.3.
Configuration Management Service
2.4.
Ingest Service
2.5.
Compliance Service
2.6.
Notification Service
2.7.
License Control Service
2.8.
AuthZ Service
2.9.
AuthN Service
2.10.
Teams Service
2.11.
Session Service
2.12.
Secrets Service
3.
Chef Automate API
3.1.
Authentication
3.2.
Reporting 
3.2.1.
List Controls
3.3.
Report Manager
3.3.1.
List Download Report Requests
3.4.
Node Managers
3.4.1.
Create a Node Manager
3.5.
Event Feed
3.5.1.
List Summary Data of Events
3.6.
Secrets
3.6.1.
Create a secret
3.7.
IAM Users
3.7.1.
Update self
4.
Chef Automate CLI Commands
4.1.
chef-automate
4.1.1.
Usage
4.2.
chef-automate backup
4.2.1.
Usage
4.3.
chef-automate config
4.3.1.
Usage
4.4.
chef-automate config patch
4.4.1.
Usage
4.5.
chef-automate deploy
4.5.1.
Usage
4.6.
chef-automate external-cert
4.6.1.
Usage
4.7.
chef-automate iam
4.7.1.
Usage
4.8.
chef-automate license apply
4.8.1.
Usage
4.9.
chef-automate license nodeRunReport
4.9.1.
Usage
4.10.
chef-automate preflight-check
4.10.1.
Usage
5.
Feature Flags
6.
Frequently Asked Questions
6.1.
Which service handles InSpec and scans job-related data?
6.2.
Which service manages the users local to Chef Automate?
6.3.
Which command is used to enable the debug output?
7.
Conclusion
Last Updated: Mar 27, 2024

Chef - Automate Basics

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Chef Automate is an enterprise dashboard as well as an analytic tool which enables cross-team collaborations with actionable insights for configuration and compliance. It helps change how the user Automate everything in the Stack. It offers real-time data across environments, powerful auditing capabilities, actionable insights, etc.

Chef - Automate Basics

Component Overview

Some of the major components of Chef Automate 2 architecture are mentioned below:

Automate gateway

It serves as an application layer of Chef Automate’s architecture. All of the public-facing requests go through the gateway, and the process of authentication/authorization occurs here.

Deployment Service

This service is responsible for collecting the initial service configuration from the user. It performs all the activities that are required to set up the Chef Automate initially. It also manages the configuration patches as well.

Configuration Management Service

This service is responsible for serving all the configuration management-related information to API and user interface, including Chef Infra Server action data and Chef Infra Client run data.

Ingest Service

This service is the main ingress event handler for configuration management-related events. It also manages the data that is related to domains like cleanup, migration, and index initialization.

Compliance Service

This service is responsible for handling InSpec as well as scans job-related data, which also includes event ingestion and reporting.

Notification Service

This service is responsible for sending notifications which are based upon configured rules in response to events.

License Control Service

This service is responsible for providing policy information to the rest of the system that is derived from the license file. It also includes telemetry configuration.

AuthZ Service

This service is responsible for providing the API to determine what all actions a requestor is allowed to take on in Chef Automate.

AuthN Service

This service is responsible for providing the API to verify whether a requestor is allowed to interact with Chef Automate or not.

Teams Service

This service is an API for defining local teams that are used as a part of the authorization model for Chef Automate.

Session Service

This service is present and stands between the browser and Dex. It acts as an OpenID Connect client to Dex and also uses the Authorization Code Grant Flow.

Secrets Service

This service securely stores all the credentials for the other services.

Chef Automate API

Now, we will look at the various chef automate API commands:

Authentication

The Chef Automate API uses an API token which is passed in the header of the API request. If the user wants to create an admin token and set it as an environment variable, use the below command:

export TOKEN=`chef-automate iam token create <TOKEN-NAME> --admin`


An admin token has access to the entire Chef Automate API for an unlimited duration. The user needs to pass the token as part of the API call.

If the user wants to create API tokens that have limited permissions, then the user can do so by using their admin token to create a standard token. The user then can write a policy that exactly defines the API access for that standard token.

Reporting 

Now, we will discuss the list control command in detail:

List Controls

It lists the controls from the last run and has optional filtering. It also supports filtering pagination but does not support sorting. By default, it is limited to 100.

Authorization Action

compliance:controlItems:list


Request Body Schema

  • filters: these represent the criteria used to filter the controls that are returned.
  • size: it represents the maximum number of controls that are to be returned.
  • text: it is the term which is used to match the resources on.
     

Report Manager

Now, we will discuss the list download report requests in detail:

List Download Report Requests

It returns the details of all the downloaded report requests that the user places.

Authorization Action

reportmanager:requests:list


Node Managers

Now, we will discuss create a node manager command in detail:

Create a Node Manager

It creates a node manager with the given name, credential id or credential data and type mentioned.

Authorization Action

infra:nodeManagers:create


Request Body Schema

  • account_id: it represents the account id which is associated with the node manager.
  • credential_data: it overrides the values in credential_id. This is used when the user has not yet created node credentials and provided credential data.
  • data_added: it represents the date at which the node manager was created.
  • name: it represents the user-defined name given to the node manager.
  • status: it represents the status of the node manager.
  • type: it represents the type of the node manager
  • credential_id: it is the UUID of the credential with the information that the user needs to connect to aws, azure, or GCP.
  • id: it is the UUID of the node manager


Event Feed

Now, we will discuss the List Summary Data of Events command in detail:

List Summary Data of Events

It returns the data that populates the guitar strings visual that are on the top of the event feed.

Authorization Action

event:events:list


Query Parameters

  • start: it represents the earliest events to return.
  • end: it represents the latest events to return.
  • timezone: it represents the user’s timezone to apply to the request.
  • filter: it represents the filters that are to be applied to the request.


Secrets

Now, we will discuss the create a secret command in detail:

Create a secret

It is used to create a secret. It requires values for name, type, and data.

Authorization Action

Secrets:secrets:create


Request Body Schema

  • data: it represents the secret data/
  • id: it is the UUID.
  • last_modified: it represents the timestamp, which denotes the last time the secret was modified.
  • name: it is the user-specified name for the secret.
  • tags: these are the tags which are associated with the secret.


IAM Users

The IAM local users aren’t attached to external identity providers. 

Update self

It is to update a local user’s own name or password. If, in case, the password is to be changed, then both ‘password’ and ‘previous_password’ are required.

Authorization Action

iam:usersSelf:update


Path Parameters

  • id: it is the ID of the user. It can’t be changed. It is used to sign in.


Request Body Schema

  • name: it represents the display name for the local user.
  • password: it is the new password for the user. It is used by the user to sign in.
  • previous_password: it is the previous password for the user. It is optional, but if included, then it also requires the password field.

Chef Automate CLI Commands

Some of the Chef Automate CLI commands are mentioned below:

chef-automate

It is a helpful utility used to deploy as well as manage Chef Automate.

Usage

chef-automate COMMAND [flags]

 

Flag options for chef-automate

chef-automate backup

Usage

chef-automate backup COMMAND [flags]

 

Flag options for chef-automate backup

chef-automate config

Usage

chef-automate config COMMAND [flags]

 

Flag options for chef-automate config

chef-automate config patch

It applies partial Chef Automate configuration to the deployment. It takes the partial configuration, merges it with the existing configuration and applies it.

Usage

chef-automate config patch path/to/config.toml [flags]

Flag options for chef-automate config patch

chef-automate deploy

It deploys a new Chef Automate instance using a supplied configuration. -<CONFIG_FILE> needs to be a valid path to a TOM formatted configuration file.

Usage

chef-automate deploy [/path/to/config.toml] [flags]

 

Flag options for chef-automate deploy

chef-automate external-cert

It manages the Chef Automate’s external certificate authority. It is used for establishing TLS/SSL communication with the automate.

Usage

ef-automate external-cert COMMAND [flags]

 

Flag options for chef-automate external-cert

chef-automate iam

Usage

chef-automate iam COMMAND [flags]

 

Flag options for chef-automate iam

chef-automate license apply

It applies the Chef Automate license token.

Usage

chef-automate license apply LICENSE [flags]

 

Flag options for chef-automate license apply

chef-automate license nodeRunReport

Usage

chef-automate license nodeRunReport [flags]

 

Flag options for chef-automate license nodeRunReport

chef-automate preflight-check

It performs preflight check in order to verify host meets installation criteria.

Usage

chef-automate preflight-check [flags]

 

Flag options for chef-automate preflight-check

Feature Flags

To turn the beta, legacy, or in-development features on or off using the beta, lega, or feat flags. In order to open the feature flags window, simply select anywhere on the Chef Automate interface and enter feat, lega, or beta. The user can toggle their desired feature to either ‘ON’ or ‘OFF’ that position.

Frequently Asked Questions

Which service handles InSpec and scans job-related data?

The Compliance Service handles InSpec and scans job-related data.

Which service manages the users local to Chef Automate?

The Users Service manages the users local to Chef Automate.

Which command is used to enable the debug output?

The ‘-d’ command is used to enable the debug output.

Conclusion

In this article, we have extensively discussed the Chef Automate Basics.

After reading about the Chef Automate Basics, are you not feeling excited to read/explore more articles on Configuration Management? Don't worry; Coding Ninjas has you covered. To learn about what ansible iswhat is ansible YAML syntax and how errors are handled in the ansible playbook

If you wish to enhance your skills in Data Structures and AlgorithmsCompetitive ProgrammingJavaScript, etc., you should check out our Guided path column at Coding Ninjas Studio. We at Coding Ninjas Studio organize many contests in which you can participate. You can also prepare for the contests and test your coding skills by giving the mock test series available. In case you have just started the learning process, and your dream is to crack major tech giants like Amazon, Microsoft, etc., then you should check out the most frequently asked problems and the interview experiences of your seniors that will surely help you in landing a job in your dream company. 

Do upvote if you find the blogs helpful.

Happy Learning!

Thank you
Live masterclass