{"action":"opened","issue":{"url":"https://api.github.com/repos/inspec/inspec/issues/3396","repository_url":"https://api.github.com/repos/inspec/inspec","labels_url":"https://api.github.com/repos/inspec/inspec/issues/3396/labels{/name}","comments_url":"https://api.github.com/repos/inspec/inspec/issues/3396/comments","events_url":"https://api.github.com/repos/inspec/inspec/issues/3396/events","html_url":"https://github.com/inspec/inspec/issues/3396","id":360360187,"node_id":"MDU6SXNzdWUzNjAzNjAxODc=","number":3396,"title":"Global Attributes not visible in included controls?","user":{"login":"Paladin","id":84123,"node_id":"MDQ6VXNlcjg0MTIz","avatar_url":"https://avatars3.githubusercontent.com/u/84123?v=4","gravatar_id":"","url":"https://api.github.com/users/Paladin","html_url":"https://github.com/Paladin","followers_url":"https://api.github.com/users/Paladin/followers","following_url":"https://api.github.com/users/Paladin/following{/other_user}","gists_url":"https://api.github.com/users/Paladin/gists{/gist_id}","starred_url":"https://api.github.com/users/Paladin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paladin/subscriptions","organizations_url":"https://api.github.com/users/Paladin/orgs","repos_url":"https://api.github.com/users/Paladin/repos","events_url":"https://api.github.com/users/Paladin/events{/privacy}","received_events_url":"https://api.github.com/users/Paladin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-14T15:50:47Z","updated_at":"2018-09-14T15:50:47Z","closed_at":null,"author_association":"NONE","body":"### 🎛 Description\r\n\r\n 🐛 bug report\r\n\r\nThe bug is either in the code or my understanding, cannot prove which, making this possibly a bug report on me, rather than the code.\r\n\r\n### 🌍 InSpec and Platform Version\r\n\r\n2.2.101\r\n\r\n### 🤔 Replication Case\r\n\r\n1) create two profiles, for the sake of this example, call them A and B\r\n2) set an attribute in the inspec.yml of A\r\n3) set a dependency in A for B\r\n4) include_controls B in A\r\n5) From B, attempt to read the attribute you set in A's inspec.yml\r\n\r\nMy understanding says it should be able to read it. My observation is that B gets whatever it sets as default for the call to read the attribute.\r\n\r\nFor simple example: If profile A's inspec.yml contains:\r\n\r\n```\r\nattributes:\r\n  - host: 'fred'\r\n```\r\n\r\nand the included control from B pulls it with:\r\n\r\n`target = attribute('host', default: 'sam')`\r\n\r\nthen the included control from B will have 'sam' in target, where my understanding of global attributes would indicate it should have 'fred', since there is nothing in B's inspec.yml that overrides it.\r\n\r\nAm I misunderstanding it or is this a bug in global attributes?\r\n"}}
{"actor":{"display_login":"Paladin"}}