{"action":"created","issue":{"url":"https://api.github.com/repos/xcat2/xcat-core/issues/5371","repository_url":"https://api.github.com/repos/xcat2/xcat-core","labels_url":"https://api.github.com/repos/xcat2/xcat-core/issues/5371/labels{/name}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/issues/5371/comments","events_url":"https://api.github.com/repos/xcat2/xcat-core/issues/5371/events","html_url":"https://github.com/xcat2/xcat-core/pull/5371","id":338153980,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MTU2NTk2","number":5371,"title":"update hwinv table by updatenode -P geinv","user":{"login":"xuweibj","id":15208204,"node_id":"MDQ6VXNlcjE1MjA4MjA0","avatar_url":"https://avatars0.githubusercontent.com/u/15208204?v=4","gravatar_id":"","url":"https://api.github.com/users/xuweibj","html_url":"https://github.com/xuweibj","followers_url":"https://api.github.com/users/xuweibj/followers","following_url":"https://api.github.com/users/xuweibj/following{/other_user}","gists_url":"https://api.github.com/users/xuweibj/gists{/gist_id}","starred_url":"https://api.github.com/users/xuweibj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuweibj/subscriptions","organizations_url":"https://api.github.com/users/xuweibj/orgs","repos_url":"https://api.github.com/users/xuweibj/repos","events_url":"https://api.github.com/users/xuweibj/events{/privacy}","received_events_url":"https://api.github.com/users/xuweibj/received_events","type":"User","site_admin":false},"labels":[{"id":310576581,"node_id":"MDU6TGFiZWwzMTA1NzY1ODE=","url":"https://api.github.com/repos/xcat2/xcat-core/labels/component:hw_control","name":"component:hw_control","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/xcat2/xcat-core/milestones/39","html_url":"https://github.com/xcat2/xcat-core/milestone/39","labels_url":"https://api.github.com/repos/xcat2/xcat-core/milestones/39/labels","id":3371697,"node_id":"MDk6TWlsZXN0b25lMzM3MTY5Nw==","number":39,"title":"2.14.2","description":"","creator":{"login":"zet809","id":8222144,"node_id":"MDQ6VXNlcjgyMjIxNDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/8222144?v=4","gravatar_id":"","url":"https://api.github.com/users/zet809","html_url":"https://github.com/zet809","followers_url":"https://api.github.com/users/zet809/followers","following_url":"https://api.github.com/users/zet809/following{/other_user}","gists_url":"https://api.github.com/users/zet809/gists{/gist_id}","starred_url":"https://api.github.com/users/zet809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zet809/subscriptions","organizations_url":"https://api.github.com/users/zet809/orgs","repos_url":"https://api.github.com/users/zet809/repos","events_url":"https://api.github.com/users/zet809/events{/privacy}","received_events_url":"https://api.github.com/users/zet809/received_events","type":"User","site_admin":false},"open_issues":46,"closed_issues":85,"state":"open","created_at":"2018-05-24T09:29:59Z","updated_at":"2018-07-06T02:54:37Z","due_on":"2018-07-13T07:00:00Z","closed_at":null},"comments":2,"created_at":"2018-07-04T07:07:26Z","updated_at":"2018-07-06T06:07:48Z","closed_at":"2018-07-05T07:56:00Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/5371","html_url":"https://github.com/xcat2/xcat-core/pull/5371","diff_url":"https://github.com/xcat2/xcat-core/pull/5371.diff","patch_url":"https://github.com/xcat2/xcat-core/pull/5371.patch"},"body":"#5345 \r\nRun ``updatenode`` with xcatdebugmode is 1\r\n```\r\n# updatenode c910f03c17k20 -P getinv\r\nc910f03c17k20: vpdupdate is not supported on the pSeries KVM Guest platform\r\nc910f03c17k20: updating VPD database\r\nc910f03c17k20: trying to download postscripts...\r\nc910f03c17k20: postscripts downloaded successfully\r\nc910f03c17k20: trying to get mypostscript from 10.3.17.21...\r\nc910f03c17k20: Wed Jul  4 02:38:48 EDT 2018 Running postscript: getinv\r\nc910f03c17k20: + '[' -z '' ']'\r\nc910f03c17k20: + XCATDEST=\r\nc910f03c17k20: + '[' -z '' ']'\r\nc910f03c17k20: + XCATDEST=10.3.17.21:3001\r\nc910f03c17k20: + tmp_file=/tmp/invinfo.xml\r\nc910f03c17k20: + '[' -r /sys/devices/virtual/dmi/id/product_name ']'\r\nc910f03c17k20: + '[' -r /proc/device-tree/model ']'\r\nc910f03c17k20: + grep -e '^cpu\\s*:' /proc/cpuinfo\r\nc910f03c17k20: + read line\r\nc910f03c17k20: + echo cpu : POWER8E '(raw),' altivec supported\r\nc910f03c17k20: + read line\r\nc910f03c17k20: + echo cpu : POWER8E '(raw),' altivec supported\r\nc910f03c17k20: + read line\r\nc910f03c17k20: + echo cpu : POWER8E '(raw),' altivec supported\r\nc910f03c17k20: + read line\r\nc910f03c17k20: + echo cpu : POWER8E '(raw),' altivec supported\r\nc910f03c17k20: + read line\r\nc910f03c17k20: ++ cat /proc/cpuinfo\r\nc910f03c17k20: ++ grep -e '^cpu\\s*:'\r\nc910f03c17k20: ++ wc -l\r\nc910f03c17k20: + CPUCOUNT=4\r\nc910f03c17k20: ++ cat /tmp/cpumod\r\nc910f03c17k20: ++ awk -F: '{print $2}'\r\nc910f03c17k20: ++ sed -e 's/^ //'\r\nc910f03c17k20: + CPUTYPE='POWER8E (raw), altivec supported'\r\nc910f03c17k20: ++ cat /proc/meminfo\r\nc910f03c17k20: ++ awk '{printf \"%.0fMB\\n\", $2/1024}'\r\nc910f03c17k20: ++ grep MemTotal\r\nc910f03c17k20: + MEMORY=6119MB\r\nc910f03c17k20: ++ grep -v name /proc/partitions\r\nc910f03c17k20: ++ awk 'BEGIN{sep=\"\"} /[^0-9]$/{printf(\"%s%s:%.0fGB\", sep, $4, $3/1024^2) ; sep=\",\"}'\r\nc910f03c17k20: ++ sort -g -k 1,2\r\nc910f03c17k20: + DISKSIZE=sda:40GB\r\nc910f03c17k20: + echo '<xcatrequest>'\r\nc910f03c17k20: + echo '<command>updatehwinv</command>'\r\nc910f03c17k20: + echo '<cpucount>4</cpucount>'\r\nc910f03c17k20: + echo '<cputype>POWER8E (raw), altivec supported</cputype>'\r\nc910f03c17k20: + echo '<memory>6119MB</memory>'\r\nc910f03c17k20: + echo '<disksize>sda:40GB</disksize>'\r\nc910f03c17k20: + echo '</xcatrequest>'\r\nc910f03c17k20: + xml_file=/tmp/hwinv.xml\r\nc910f03c17k20: + rm -f /tmp/hwinv.xml\r\nc910f03c17k20: + '[' '!' -f /tmp/hwinv.xml ']'\r\nc910f03c17k20: + '[' -f /tmp/hwinv.xml ']'\r\nc910f03c17k20: + '[' -f /etc/xcat/cert.pem -a -f /etc/xcat/certkey.pem ']'\r\nc910f03c17k20: + cat /tmp/invinfo.xml\r\nc910f03c17k20: + openssl s_client -connect 10.3.17.21:3001 -quiet\r\nc910f03c17k20: + '[' '!' -f /tmp/hwinv.xml ']'\r\nc910f03c17k20: + grep error /tmp/hwinv.xml\r\nc910f03c17k20: + rm /tmp/cpumod\r\nc910f03c17k20: + rm /tmp/invinfo.xml\r\nc910f03c17k20: postscript: getinv exited with code 0\r\nc910f03c17k20: Running of postscripts has completed.\r\n```\r\nresult:\r\n```\r\n# tabdump hwinv\r\n#node,cputype,cpucount,memory,disksize,comments,disable\r\n\"c910f03c17k20\",\"POWER8E (raw), altivec supported\",\"4\",\"6119MB\",\"sda:40GB\",,\r\n```"},"comment":{"url":"https://api.github.com/repos/xcat2/xcat-core/issues/comments/402935839","html_url":"https://github.com/xcat2/xcat-core/pull/5371#issuecomment-402935839","issue_url":"https://api.github.com/repos/xcat2/xcat-core/issues/5371","id":402935839,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjkzNTgzOQ==","user":{"login":"robin2008","id":13726882,"node_id":"MDQ6VXNlcjEzNzI2ODgy","avatar_url":"https://avatars0.githubusercontent.com/u/13726882?v=4","gravatar_id":"","url":"https://api.github.com/users/robin2008","html_url":"https://github.com/robin2008","followers_url":"https://api.github.com/users/robin2008/followers","following_url":"https://api.github.com/users/robin2008/following{/other_user}","gists_url":"https://api.github.com/users/robin2008/gists{/gist_id}","starred_url":"https://api.github.com/users/robin2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robin2008/subscriptions","organizations_url":"https://api.github.com/users/robin2008/orgs","repos_url":"https://api.github.com/users/robin2008/repos","events_url":"https://api.github.com/users/robin2008/events{/privacy}","received_events_url":"https://api.github.com/users/robin2008/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T06:07:48Z","updated_at":"2018-07-06T06:07:48Z","author_association":"MEMBER","body":"@xuweibj  @zet809 \r\nDo you really consider the security here?  to add `allow` policy here without any ACL (client IP) means everyone could send the data to xcat DB from everywhere. \r\n\r\nAnd here you plugin is to modify DB with any checking, it is very dangerous.  For example,  I just run below from one server which does not in your cluster, and I can update your table\r\n```\r\ntabdump hwinv\r\n#node,cputype,cpucount,memory,disksize,comments,disable\r\n\"c910f03c17k20\",\"POWER8E (raw), altivec supported\",\"4\",\"6119MB\",\"sda:40GB\",,\r\n\"c910f03c05k30\",\"$CPUTYPE\",,,,,   <====  here is my insertion.\r\n```\r\n\r\nSo, please remove the default policy rule for \"updatehwinv\", if user want to use this feature,  he can enable it with more strict ACL to make sure it is secured enough."}}
{"actor":{"display_login":"robin2008"}}