{"action":"created","issue":{"url":"https://api.github.com/repos/inspec/inspec/issues/3176","repository_url":"https://api.github.com/repos/inspec/inspec","labels_url":"https://api.github.com/repos/inspec/inspec/issues/3176/labels{/name}","comments_url":"https://api.github.com/repos/inspec/inspec/issues/3176/comments","events_url":"https://api.github.com/repos/inspec/inspec/issues/3176/events","html_url":"https://github.com/inspec/inspec/issues/3176","id":335943926,"node_id":"MDU6SXNzdWUzMzU5NDM5MjY=","number":3176,"title":"RFC unified attributes","user":{"login":"arlimus","id":1307529,"node_id":"MDQ6VXNlcjEzMDc1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/1307529?v=4","gravatar_id":"","url":"https://api.github.com/users/arlimus","html_url":"https://github.com/arlimus","followers_url":"https://api.github.com/users/arlimus/followers","following_url":"https://api.github.com/users/arlimus/following{/other_user}","gists_url":"https://api.github.com/users/arlimus/gists{/gist_id}","starred_url":"https://api.github.com/users/arlimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arlimus/subscriptions","organizations_url":"https://api.github.com/users/arlimus/orgs","repos_url":"https://api.github.com/users/arlimus/repos","events_url":"https://api.github.com/users/arlimus/events{/privacy}","received_events_url":"https://api.github.com/users/arlimus/received_events","type":"User","site_admin":false},"labels":[{"id":293393202,"node_id":"MDU6TGFiZWwyOTMzOTMyMDI=","url":"https://api.github.com/repos/inspec/inspec/labels/Type:%20RFC","name":"Type: RFC","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/inspec/inspec/milestones/28","html_url":"https://github.com/inspec/inspec/milestone/28","labels_url":"https://api.github.com/repos/inspec/inspec/milestones/28/labels","id":2766650,"node_id":"MDk6TWlsZXN0b25lMjc2NjY1MA==","number":28,"title":"InSpec 3.0","description":"","creator":{"login":"adamleff","id":3221128,"node_id":"MDQ6VXNlcjMyMjExMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/3221128?v=4","gravatar_id":"","url":"https://api.github.com/users/adamleff","html_url":"https://github.com/adamleff","followers_url":"https://api.github.com/users/adamleff/followers","following_url":"https://api.github.com/users/adamleff/following{/other_user}","gists_url":"https://api.github.com/users/adamleff/gists{/gist_id}","starred_url":"https://api.github.com/users/adamleff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamleff/subscriptions","organizations_url":"https://api.github.com/users/adamleff/orgs","repos_url":"https://api.github.com/users/adamleff/repos","events_url":"https://api.github.com/users/adamleff/events{/privacy}","received_events_url":"https://api.github.com/users/adamleff/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":3,"state":"open","created_at":"2017-09-14T20:31:51Z","updated_at":"2018-06-28T13:29:30Z","due_on":"2018-10-01T07:00:00Z","closed_at":null},"comments":3,"created_at":"2018-06-26T18:39:15Z","updated_at":"2018-07-01T14:38:25Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description\r\n\r\nCurrently attributes are defined on a per-file basis:\r\n\r\n```ruby\r\n> controls/a.rb\r\nuser = attribute('user', required: true)\r\n...\r\n```\r\n\r\nFor attributes that are shared across files, this leads to a lot of duplication and potential overrides:\r\n\r\n```ruby\r\n> controls/b.rb\r\nuser = attribute('user', required: true)\r\n...\r\n```\r\n\r\n### Goals\r\n\r\n- define attributes in one place only and make them accessible across all inspec files\r\n- prevent accidental attribute overrides \r\n\r\n### Design\r\n\r\n`inspec.yml` will define the attributes:\r\n\r\n```yaml\r\nattributes:\r\n- name: NAME\r\n  required: [false]/true\r\n  type: [any]/string/int/numeric/boolean/regex/array/hash\r\n  default: []\r\n```\r\n\r\nAttributes are then used in regular control files:\r\n\r\n```\r\nattribute(NAME)\r\n```\r\n\r\n**Full example:**\r\n\r\n`inspec.yml` contains:\r\n\r\n```yaml\r\nattributes:\r\n- name: port\r\n  type: int\r\n  default: 443\r\n```\r\n\r\n`controls/example.rb` contains:\r\n\r\n```ruby\r\ncontrol ssl(port: attribute('port')) do\r\n  it { should be_enabled }\r\nend\r\n```\r\n\r\n### References\r\n\r\nhttps://github.com/inspec/inspec/issues/719\r\n"},"comment":{"url":"https://api.github.com/repos/inspec/inspec/issues/comments/401610979","html_url":"https://github.com/inspec/inspec/issues/3176#issuecomment-401610979","issue_url":"https://api.github.com/repos/inspec/inspec/issues/3176","id":401610979,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTYxMDk3OQ==","user":{"login":"aaronlippold","id":1486440,"node_id":"MDQ6VXNlcjE0ODY0NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1486440?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronlippold","html_url":"https://github.com/aaronlippold","followers_url":"https://api.github.com/users/aaronlippold/followers","following_url":"https://api.github.com/users/aaronlippold/following{/other_user}","gists_url":"https://api.github.com/users/aaronlippold/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlippold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlippold/subscriptions","organizations_url":"https://api.github.com/users/aaronlippold/orgs","repos_url":"https://api.github.com/users/aaronlippold/repos","events_url":"https://api.github.com/users/aaronlippold/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlippold/received_events","type":"User","site_admin":false},"created_at":"2018-07-01T14:38:25Z","updated_at":"2018-07-01T14:38:25Z","author_association":"CONTRIBUTOR","body":"@arlimus et all, one thing we would like to add to this is the long awaited ability to pass attribute values ( such as `user` or `password` ) via the CLI directly. ( i.e. not using a file ) so we can ease the integration into the CI/CD pipeline. We have the ability now via a json file but being able to pass single attribute values via the cli would be very useful. We do this in kitchen-inspec now but don't have support in the CLI for it."}}
{"actor":{"display_login":"aaronlippold"}}