mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
doc review
Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>
This commit is contained in:
parent
b087b4b38f
commit
d49f3c5f45
1 changed files with 16 additions and 15 deletions
|
@ -13,16 +13,15 @@ platform = "unix"
|
|||
|
||||
Use the `x509_private_key` Chef InSpec audit resource to test the x509 private key.
|
||||
|
||||
|
||||
## Availability
|
||||
|
||||
### Installation
|
||||
|
||||
This resource is distributed along with Chef InSpec itself.
|
||||
The Chef InSpec distributes this resource.
|
||||
|
||||
## Syntax
|
||||
|
||||
A `x509_private_key` Chef InSpec audit resource allows to test the x509 private key.
|
||||
An `x509_private_key` Chef InSpec audit resource allows you to test the x509 private key.
|
||||
|
||||
```ruby
|
||||
describe x509_private_key("/home/x509_private_key.pem", "key_password") do
|
||||
|
@ -31,22 +30,23 @@ A `x509_private_key` Chef InSpec audit resource allows to test the x509 private
|
|||
it { should have_matching_certificate("/home/x509_certificate.crt") }
|
||||
end
|
||||
```
|
||||
|
||||
> where
|
||||
>
|
||||
> - `"/home/x509_private_key.pem"` is the path of the private key
|
||||
>
|
||||
> - `"/home/x509_private_key.pem"` is the path of the private key.
|
||||
> - `"key_password"` is the password of the private key. This is optional for private keys without password.
|
||||
> - `be_valid`, `be_encrypted` and `have_matching_certificate` are matchers of this resource
|
||||
> - `"/home/x509_certificate.crt"` is a x509 certificate generated using the given private key.
|
||||
> - `be_valid`, `be_encrypted`, and `have_matching_certificate` are matchers of this resource
|
||||
> - `"/home/x509_certificate.crt"` is a x509 certificate generated using the specified private key.
|
||||
|
||||
## Matchers
|
||||
|
||||
For a full list of available matchers, please visit our [matchers page](https://docs.chef.io/inspec/matchers/).
|
||||
For a full list of available matchers, please visit the [matchers page](https://docs.chef.io/inspec/matchers/).
|
||||
|
||||
The specific matchers of this resource are: `be_valid`, `be_encrypted` and `have_matching_certificate`
|
||||
The specific matchers of this resource are: `be_valid`, `be_encrypted`, and `have_matching_certificate`.
|
||||
|
||||
### be_valid
|
||||
|
||||
The `be_valid` matcher tests if the given private key is valid.
|
||||
The `be_valid` matcher tests if the specified private key is valid.
|
||||
|
||||
```ruby
|
||||
it { should be_valid }
|
||||
|
@ -54,7 +54,7 @@ The `be_valid` matcher tests if the given private key is valid.
|
|||
|
||||
### be_encrypted
|
||||
|
||||
The `be_encrypted` matcher tests if the given private key is encrypted.
|
||||
The `be_encrypted` matcher tests if the specified private key is encrypted.
|
||||
|
||||
```ruby
|
||||
it { should be_encrypted }
|
||||
|
@ -69,9 +69,10 @@ The `have_matching_certificate` matcher tests if the x509 private key has a matc
|
|||
```
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples show how to use this Chef InSpec audit resource.
|
||||
|
||||
### Check if the x509 private key is valid.
|
||||
### Checks if the x509 private key is valid
|
||||
|
||||
`be_valid` checks if the x509 private key is valid.
|
||||
|
||||
|
@ -81,7 +82,7 @@ The following examples show how to use this Chef InSpec audit resource.
|
|||
end
|
||||
```
|
||||
|
||||
### Check if the x509 private key is valid without password.
|
||||
### Checks if the x509 private key is valid without a password
|
||||
|
||||
`be_valid` checks if the x509 private key is valid.
|
||||
|
||||
|
@ -91,7 +92,7 @@ The following examples show how to use this Chef InSpec audit resource.
|
|||
end
|
||||
```
|
||||
|
||||
### Check if the x509 private key is encrypted.
|
||||
### Checks if the x509 private key is encrypted
|
||||
|
||||
`be_encrypted` checks if the x509 private key is encrypted.
|
||||
|
||||
|
@ -101,7 +102,7 @@ The following examples show how to use this Chef InSpec audit resource.
|
|||
end
|
||||
```
|
||||
|
||||
### Check if the x509 private key has a matching certificate.
|
||||
### Checks if the x509 private key has a matching certificate
|
||||
|
||||
`be_valid` checks if the x509 private key has a matching certificate.
|
||||
|
||||
|
|
Loading…
Reference in a new issue