Skip to content

Commit

Permalink
add example cookbook for profile upload
Browse files Browse the repository at this point in the history
Signed-off-by: Victoria Jeffrey <vjeffrey@chef.io>
  • Loading branch information
Victoria Jeffrey committed Oct 27, 2016
1 parent 3b2721c commit 65a2779
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/profile_upload/.kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
driver:
name: vagrant
synced_folders:
- ["./profile_tar", "/opt", 'create: true']

provisioner:
name: chef_zero

platforms:
- name: ubuntu-14.04
- name: centos-7.2

suites:
- name: default
run_list:
- recipe[profile_upload::default]
attributes:
audit:
collector: 'chef-compliance'
server: "https://192.168.33.201/api"
inspec_version: 1.2.1
insecure: true
refresh_token: '4/0N2sqBYyHpmxwBO0KegXs7IPJ9tKF6qQDB9iCOA72pDJLGcHQ69XZWOIOIT6JEwlmBFnLd7o_UN5MlwMTM_ofg=='
owner: admin
profiles:
- name: admin/hardening
path: /opt/ssh-hardening.tar.gz
5 changes: 5 additions & 0 deletions examples/profile_upload/Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://supermarket.chef.io'

metadata

cookbook 'audit', path: '../../../audit'
19 changes: 19 additions & 0 deletions examples/profile_upload/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# profile_upload

Example cookbook used to upload a profile to chef-compliance.

To use this cookbook:

1) ensure you update the .kitchen.yml with your:
* chef-compliance server url
* refresh_token
* user (owner)

2) create a directory in this directory named 'profile_tar', and stick an archived
profile in there (something like: ssh-hardening.tar.gz)
(Note: you can easily archive an existing profile using `inspec archive PATH`)

3) run `kitchen converge`

4) go look in chef-compliance, under the compliance profiles section, and see your
uploaded profile! tada!
17 changes: 17 additions & 0 deletions examples/profile_upload/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name 'profile_upload'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'all_rights'
description 'Installs/Configures test-profiles'
long_description 'Installs/Configures test-profiles'
version '0.1.0'

# If you upload to Supermarket you should set this so your cookbook
# gets a `View Issues` link
# issues_url 'https://github.com/<insert_org_here>/test-profiles/issues' if respond_to?(:issues_url)

# If you upload to Supermarket you should set this so your cookbook
# gets a `View Source` link
# source_url 'https://github.com/<insert_org_here>/test-profiles' if respond_to?(:source_url)

depends 'audit'
9 changes: 9 additions & 0 deletions examples/profile_upload/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Cookbook Name:: test-profiles
# Recipe:: default
#
# Copyright (c) 2016 The Authors, All Rights Reserved.

# package 'git'

include_recipe 'audit::upload'

0 comments on commit 65a2779

Please sign in to comment.