<commit_before># chef-conceal-cookbook

TODO: Enter the cookbook description here.

## Supported Platforms

TODO: List your supported platforms.

## Attributes

<table>
  <tr>
    <th>Key</th>
    <th>Type</th>
    <th>Description</th>
    <th>Default</th>
  </tr>
  <tr>
    <td><tt>['chef-conceal']['bacon']</tt></td>
    <td>Boolean</td>
    <td>whether to include bacon</td>
    <td><tt>true</tt></td>
  </tr>
</table>

## Usage

### chef-conceal::default

Include `chef-conceal` in your node's `run_list`:

```json
{
  "run_list": [
    "recipe[chef-conceal::default]"
  ]
}
```

## Contributing

1. Fork the repository on Github
2. Create a named feature branch (i.e. `add-new-recipe`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request

## License and Authors

Author:: YOUR_NAME (<YOUR_EMAIL>)<commit_msg>flesh out the cookbook README<commit_after># chef-conceal

Chef-conceal is a gem and chef recipe that includes a helpful DSL method to decrypt attributes with encrypted content using the encrypted_data_bag_secret file as the key.

## Supported Platforms

* Ubuntu

## Installation

Add `chef-conceal` to your `Berksfile`:

```ruby
cookbook 'chef-conceal'
```

## Usage

In order to use chef-conceal in your recipes, you'll first need to include it:

```ruby
include_recipe 'chef-conceal'
```

This will extend the recipe, resource, and provider DSLs with a `decrypt` convenience method.

## Encrypting plaintext

Use the `conceal` gem (https://github.com/gamepoet/conceal) to encrypt your plaintext into an encoded string. Generating a new password and putting it in the clipboard can be as easy as:

```
$ ruby -rsecurerandom -e 'print SecureRandom.urlsafe_base64(32)' | conceal encrypt ~/.chef/encrypted_data_bag_secret | pbcopy
```

## Examples

Given a chef environment

```
$ knife environment show chef_conceal_example
chef_type: environment
default_attributes:
  my_password: '1:aes-256-cbc:toekea56oRvQG1KpJNo2tw==:NjI2MjFmNjliODk4ZDM0YjJmNTQzNzdhMDdlMTBjZjhhMTUyZDQ0NTkyNjVlYjY1ODM4OTk4YmI0NDA0MmFlMDAzNWE4MDYwNjdmMDA3MTAxZWQ1NjBjZGNjMGYxNGNjYTM2YzMzYWIzYzYyNTFjNGYxZWQzNGFkYjkzZTgyN2M3YzBjY2JhNDUzNWVjYjkwY2FmODEzNGJhNWRkZmNmZGI2ZTM0NWI0MzUzMGZhODY1OGIxNjU5NjU0N2JiMDg1NzMxNWEzMmMxYWRiNzBjNWZkZWJhZDFhYzVhMGM4NzllYTQyNjViODVlOWMwYTIxZjM1OGYzZWJkMTBmY2M0Zg==:oh8bn5krZvMKiIzYt5LFEvEZMZt3sDS2Q4jL97Vty0g=:rnaFQ4su+/tSjtondhXKbSlbmbmLSIndPaBA++2kMgw='
json_class: Chef::Environment
name: chef_conceal_example
```

You could then write a recipe that references the decrypted content of the attribute with the `decrypt` function which will automatically use your `encrypted_data_bag_secret` as the key.

```ruby
include_recipe 'chef-conceal'

log decrypt(node[:my_password])
```

## Authors

* <NAME> (<<EMAIL>>)
{'fraction_non_alphanumeric': 0.1052257376466406, 'fraction_numerical': 0.020618556701030927, 'mean_word_length': 5.590163934426229, 'pattern_counts': {'":': 1, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3172605', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1159, 'n_words': 257}