Sha256: bf3841cb5319cdecb9daf64d65eb49cf4d67b40a8690a10cb61d9d112f46ba65

Contents?: true

Size: 1.18 KB

Versions: 42

Compression:

Stored size: 1.18 KB

Contents

---
title: About the group Resource
platform: os
---

# group

Use the `group` InSpec audit resource to test groups on the system.

<br>

## Syntax

A `group` resource block declares a group, and then the details to be tested, such as if the group is a local group, the group identifier, or if the group exists:

    describe group('group_name') do
      it { should exist }
      its('gid') { should eq 0 }
    end

where

* `'group_name'` must specify the name of a group on the system
* `exist` and `'gid'` are valid matchers for this resource

<br>

## Examples

The following examples show how to use this InSpec audit resource.

### Test the group identifier for the root group

    describe group('root') do
      it { should exist }
      its('gid') { should eq 0 }
    end

<br>

## Matchers

For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

### be_local

The `be_local` matcher tests if the group is a local group:

    it { should be_local }

### exist

The `exist` matcher tests if the named user exists:

    it { should exist }

### gid

The `gid` matcher tests the named group identifier:

    its('gid') { should eq 1234 }

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
inspec-core-2.2.55 docs/resources/group.md.erb
inspec-2.2.55 docs/resources/group.md.erb
inspec-core-2.2.54 docs/resources/group.md.erb
inspec-2.2.54 docs/resources/group.md.erb
inspec-core-2.2.50 docs/resources/group.md.erb
inspec-2.2.50 docs/resources/group.md.erb
inspec-core-2.2.41 docs/resources/group.md.erb
inspec-2.2.41 docs/resources/group.md.erb
inspec-core-2.2.35 docs/resources/group.md.erb
inspec-2.2.35 docs/resources/group.md.erb
inspec-core-2.2.34 docs/resources/group.md.erb
inspec-2.2.34 docs/resources/group.md.erb
inspec-core-2.2.27 docs/resources/group.md.erb
inspec-2.2.27 docs/resources/group.md.erb
inspec-core-2.2.20 docs/resources/group.md.erb
inspec-2.2.20 docs/resources/group.md.erb
inspec-core-2.2.16 docs/resources/group.md.erb
inspec-2.2.16 docs/resources/group.md.erb
inspec-core-2.2.10 docs/resources/group.md.erb
inspec-2.2.10 docs/resources/group.md.erb