{"id":16780354,"url":"https://github.com/ahelal/cf-inspec","last_synced_at":"2025-04-10T21:15:16.177Z","repository":{"id":38295668,"uuid":"181049537","full_name":"ahelal/cf-inspec","owner":"ahelal","description":"inSpec resources for Cloudfoundry, Opsman and Bosh","archived":false,"fork":false,"pushed_at":"2022-06-07T21:24:42.000Z","size":121,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:15:11.476Z","etag":null,"topics":["bosh","cloudfoundry","inspec","opsman","opsmanager","pcf","testing"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahelal.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-12T16:59:04.000Z","updated_at":"2023-03-22T18:06:32.000Z","dependencies_parsed_at":"2022-09-08T07:33:01.307Z","dependency_job_id":null,"html_url":"https://github.com/ahelal/cf-inspec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahelal%2Fcf-inspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahelal%2Fcf-inspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahelal%2Fcf-inspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahelal%2Fcf-inspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahelal","download_url":"https://codeload.github.com/ahelal/cf-inspec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298312,"owners_count":21080320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bosh","cloudfoundry","inspec","opsman","opsmanager","pcf","testing"],"created_at":"2024-10-13T07:34:56.387Z","updated_at":"2025-04-10T21:15:16.157Z","avatar_url":"https://github.com/ahelal.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/ahelal/cf-inspec.svg?branch=master)](https://travis-ci.org/ahelal/cf-inspec)\n\n# inSpec Cloudfoundry resources\n\nThis InSpec resource pack that provides the required resources to write tests for cloudfoundry.\n\n## Prerequisites\n\nYou need [inSpec](https://www.inspec.io/downloads/) :)\n\n## Usage\n### Create a new profile\n\n1. `$ inspec init profile my-profile`\n\n```yaml\nname: my-profile\ntitle: test\nversion: 0.1.0\ndepends:\n  - name: cf-inspec\n    url: https://github.com/ahelal/cf-inspec/archive/master.tar.gz\n```\n\n2. Edit inspec.yml to reflect the depends\n3. Define your tests in `your_profile/control`\n\n### Configuration for Opsman resources\n\nYou need to export **required** opsman variables\n* `OM_TARGET` with schema eg. `https://opsman.example.com`\n* `OM_USERNAME`\n* `OM_PASSWORD`\n\nOptional variables\n* `OM_SKIP_SSL_VALIDATION` defaults to `false`\n\n### Available resources\n\nList of [available resources](doc/opsman)\n\n#### Examples\n\nCheck the [Opsman examples](test/examples/opsman/controls)\n\nAn example profile\n\n```ruby\ncontrol 'opsman should be reachable and using desired version' do\n  describe bosh_info do\n    its('version') { should match(/2.3/) }\n  end\nend\n\ncontrol 'Certificate should not expire in the next two months' do\n  describe om_certificates(2, 'm') do\n    its('expires') { should be_empty }\n  end\nend\n\ndescribe om_director_properties do\n  its(%w[director_configuration ntp_servers_string]) { should eq 'us.pool.ntp.org, time.google.com' }\n  its(%w[iaas_configuration tls_enabled]) { should eq true }\n  its(%w[syslog_configuration enabled]) { should eq true }\nend\n\ncontrol 'PCF should be installed, and deigo_cell should be in desired the instance count and type' do\n  describe om_deployed_products do\n    its(%w[cf version]) { should match(/2.3.9/) }\n  end\n  describe om_resource_jobs do\n    its(%w[cf diego_cell instances]) { should be \u003e 10 }\n    its(%w[cf diego_cell instance_type id]) { should eq 'm3.medium' }\n  end\nend\n```\n\n### Running in Concourse\n\nAdd the following task to your pipeline and map the location of your tests to the `specs` input. if your test is located in a subdir you need to pass that too `SPECS_SUBDIR: PATH/../`\n\nYou should read the inspec EULA and if you agree flip the `EULA: true`\n\n```yaml\n---\nresources:\n- name: cf-inspec-tasks\n  type: git\n  source:\n    uri: https://github.com/ahelal/cf-inspec.git\n    branch: master\n\n- name: source-code\n  type: git\n  source:\n    uri: https://github.com/\u003cORG\u003e/\u003cCODE\u003e\n    branch: master\n\njobs:\n- name: run-inspec\n  plan:\n  - get: cf-inspec-tasks\n  - get: source-code\n  - task: run-inspec\n    file: cf-inspec-tasks/task/task.yml\n    input_mapping:\n      specs: source-code\n    params:\n      OM_TARGET: ((OM_TARGET))\n      OM_USERNAME: ((OM_USERNAME))\n      OM_PASSWORD: ((OM_PASSWORD))\n      SPECS_SUBDIR: test/examples/om\n      INSPEC_CACHE_TIME: 0\n      EULA: true\n```\n\n### API caching\n\nIf you have many tests API calls might be slow. You can enable caching to increase test speed.\n* `INSPEC_CACHE_TIME` defaults to `0` seconds\n* `INSPEC_CACHE_DIR` defaults to `~/.inspec_cache`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahelal%2Fcf-inspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahelal%2Fcf-inspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahelal%2Fcf-inspec/lists"}