{"action":"created","issue":{"url":"https://api.github.com/repos/OpenSCAP/openscap/issues/727","repository_url":"https://api.github.com/repos/OpenSCAP/openscap","labels_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/727/labels{/name}","comments_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/727/comments","events_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/727/events","html_url":"https://github.com/OpenSCAP/openscap/pull/727","id":223961558,"number":727,"title":"Comments in generated remedition bash snippets","user":{"login":"mpreisler","id":753153,"avatar_url":"https://avatars2.githubusercontent.com/u/753153?v=3","gravatar_id":"","url":"https://api.github.com/users/mpreisler","html_url":"https://github.com/mpreisler","followers_url":"https://api.github.com/users/mpreisler/followers","following_url":"https://api.github.com/users/mpreisler/following{/other_user}","gists_url":"https://api.github.com/users/mpreisler/gists{/gist_id}","starred_url":"https://api.github.com/users/mpreisler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpreisler/subscriptions","organizations_url":"https://api.github.com/users/mpreisler/orgs","repos_url":"https://api.github.com/users/mpreisler/repos","events_url":"https://api.github.com/users/mpreisler/events{/privacy}","received_events_url":"https://api.github.com/users/mpreisler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jan-cerny","id":9050916,"avatar_url":"https://avatars0.githubusercontent.com/u/9050916?v=3","gravatar_id":"","url":"https://api.github.com/users/jan-cerny","html_url":"https://github.com/jan-cerny","followers_url":"https://api.github.com/users/jan-cerny/followers","following_url":"https://api.github.com/users/jan-cerny/following{/other_user}","gists_url":"https://api.github.com/users/jan-cerny/gists{/gist_id}","starred_url":"https://api.github.com/users/jan-cerny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jan-cerny/subscriptions","organizations_url":"https://api.github.com/users/jan-cerny/orgs","repos_url":"https://api.github.com/users/jan-cerny/repos","events_url":"https://api.github.com/users/jan-cerny/events{/privacy}","received_events_url":"https://api.github.com/users/jan-cerny/received_events","type":"User","site_admin":false},"assignees":[{"login":"jan-cerny","id":9050916,"avatar_url":"https://avatars0.githubusercontent.com/u/9050916?v=3","gravatar_id":"","url":"https://api.github.com/users/jan-cerny","html_url":"https://github.com/jan-cerny","followers_url":"https://api.github.com/users/jan-cerny/followers","following_url":"https://api.github.com/users/jan-cerny/following{/other_user}","gists_url":"https://api.github.com/users/jan-cerny/gists{/gist_id}","starred_url":"https://api.github.com/users/jan-cerny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jan-cerny/subscriptions","organizations_url":"https://api.github.com/users/jan-cerny/orgs","repos_url":"https://api.github.com/users/jan-cerny/repos","events_url":"https://api.github.com/users/jan-cerny/events{/privacy}","received_events_url":"https://api.github.com/users/jan-cerny/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/OpenSCAP/openscap/milestones/12","html_url":"https://github.com/OpenSCAP/openscap/milestone/12","labels_url":"https://api.github.com/repos/OpenSCAP/openscap/milestones/12/labels","id":2251140,"number":12,"title":"1.2.15","description":"","creator":{"login":"mpreisler","id":753153,"avatar_url":"https://avatars2.githubusercontent.com/u/753153?v=3","gravatar_id":"","url":"https://api.github.com/users/mpreisler","html_url":"https://github.com/mpreisler","followers_url":"https://api.github.com/users/mpreisler/followers","following_url":"https://api.github.com/users/mpreisler/following{/other_user}","gists_url":"https://api.github.com/users/mpreisler/gists{/gist_id}","starred_url":"https://api.github.com/users/mpreisler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpreisler/subscriptions","organizations_url":"https://api.github.com/users/mpreisler/orgs","repos_url":"https://api.github.com/users/mpreisler/repos","events_url":"https://api.github.com/users/mpreisler/events{/privacy}","received_events_url":"https://api.github.com/users/mpreisler/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":5,"state":"open","created_at":"2017-01-13T20:47:14Z","updated_at":"2017-04-24T21:49:48Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-04-24T21:49:48Z","updated_at":"2017-04-27T16:43:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenSCAP/openscap/pulls/727","html_url":"https://github.com/OpenSCAP/openscap/pull/727","diff_url":"https://github.com/OpenSCAP/openscap/pull/727.diff","patch_url":"https://github.com/OpenSCAP/openscap/pull/727.patch"},"body":"We have plans to generate remediation roles in SSG. Some of these scripts will be very large. It makes sense to add some more context information to the generate fixes, this commit does just that.\r\n\r\nRight now it only adds comments but I want to improve this to print remediation status or even status bar in the future. Let me know what you think.\r\n\r\nExample:\r\n```\r\n$ ./run ./utils/.libs/oscap xccdf generate fix --template urn:xccdf:fix:script:sh --profile pci-dss ~/d/scap-security-guide/build/ssg-rhel7-xccdf.xm\r\n\r\n...\r\n\r\n# BEGIN fix for 'chronyd_or_ntpd_specify_remote_server' (93 / 94)\r\n\r\nvar_multiple_time_servers=\"0.rhel.pool.ntp.org,1.rhel.pool.ntp.org,2.rhel.pool.ntp.org,3.rhel.pool.ntp.org\"\r\n\r\nif ! `/usr/sbin/pidof ntpd`; then\r\n  if ! `grep -q ^server /etc/chrony.conf` ; then\r\n    if ! `grep -q '#[[:space:]]*server' /etc/chrony.conf` ; then\r\n      for i in `echo \"$var_multiple_time_servers\" | tr ',' '\\n'` ; do\r\n        echo -ne \"\\nserver $i iburst\" >> /etc/chrony.conf\r\n      done\r\n    else\r\n      sed -i 's/#[ ]*server/server/g' /etc/chrony.conf\r\n    fi\r\n  fi\r\nelse\r\n  if ! `grep -q ^server /etc/ntp.conf` ; then\r\n    if ! `grep -q '#[[:space:]]*server' /etc/ntp.conf` ; then\r\n      for i in `echo \"$var_multiple_time_servers\" | tr ',' '\\n'` ; do\r\n        echo -ne \"\\nserver $i iburst\" >> /etc/ntp.conf\r\n      done\r\n    else\r\n      sed -i 's/#[ ]*server/server/g' /etc/ntp.conf\r\n    fi\r\n  fi\r\nfi\r\n# END fix for 'chronyd_or_ntpd_specify_remote_server'\r\n\r\n# BEGIN fix for 'chronyd_or_ntpd_specify_multiple_servers' (94 / 94)\r\n\r\nvar_multiple_time_servers=\"0.rhel.pool.ntp.org,1.rhel.pool.ntp.org,2.rhel.pool.ntp.org,3.rhel.pool.ntp.org\"\r\n\r\nif ! `/usr/sbin/pidof ntpd`; then\r\n  if [ `grep -c '^server' /etc/chrony.conf` -lt 2 ]; then \r\n    if ! `grep -q '#[[:space:]]*server' /etc/chrony.conf` ; then\r\n      for i in `echo \"$var_multiple_time_servers\" | tr ',' '\\n'` ; do\r\n        echo -ne \"\\nserver $i iburst\" >> /etc/chrony.conf\r\n      done\r\n    else\r\n      sed -i 's/#[ ]*server/server/g' /etc/chrony.conf\r\n    fi\r\n  fi\r\nelse\r\n  if [ `grep -c '^server' /etc/ntp.conf` -lt 2 ]; then\r\n    if ! `grep -q '#[[:space:]]*server' /etc/ntp.conf` ; then\r\n      for i in `echo \"$var_multiple_time_servers\" | tr ',' '\\n'` ; do\r\n        echo -ne \"\\nserver $i iburst\" >> /etc/ntp.conf\r\n      done\r\n    else\r\n      sed -i 's/#[ ]*server/server/g' /etc/ntp.conf\r\n    fi\r\n  fi\r\nfi\r\n# END fix for 'chronyd_or_ntpd_specify_multiple_servers'\r\n```\r\n\r\nTODO: Support ansible and other fix systems, not just bash."},"comment":{"url":"https://api.github.com/repos/OpenSCAP/openscap/issues/comments/297771793","html_url":"https://github.com/OpenSCAP/openscap/pull/727#issuecomment-297771793","issue_url":"https://api.github.com/repos/OpenSCAP/openscap/issues/727","id":297771793,"user":{"login":"mpreisler","id":753153,"avatar_url":"https://avatars2.githubusercontent.com/u/753153?v=3","gravatar_id":"","url":"https://api.github.com/users/mpreisler","html_url":"https://github.com/mpreisler","followers_url":"https://api.github.com/users/mpreisler/followers","following_url":"https://api.github.com/users/mpreisler/following{/other_user}","gists_url":"https://api.github.com/users/mpreisler/gists{/gist_id}","starred_url":"https://api.github.com/users/mpreisler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpreisler/subscriptions","organizations_url":"https://api.github.com/users/mpreisler/orgs","repos_url":"https://api.github.com/users/mpreisler/repos","events_url":"https://api.github.com/users/mpreisler/events{/privacy}","received_events_url":"https://api.github.com/users/mpreisler/received_events","type":"User","site_admin":false},"created_at":"2017-04-27T16:43:03Z","updated_at":"2017-04-27T16:43:03Z","body":"This is now ready for merging. We could add progress `echo` statements in the bash snippets but that will break some of the tests. For now let's just have comments."}}
{"actor":{"display_login":"mpreisler"}}