GET /api/v1/files/1139
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1139,
    "sha1": "5457bda781baf02a7f394e9f9e4e60eedd252ea0",
    "playbook": {
        "id": 15,
        "items": {
            "plays": 4,
            "tasks": 279,
            "results": 219,
            "hosts": 1,
            "files": 110,
            "records": 0
        },
        "labels": [],
        "started": "2020-01-31T15:49:56.286406Z",
        "ended": "2020-01-31T15:58:51.284585Z",
        "duration": "00:08:54.998179",
        "name": null,
        "ansible_version": "2.8.8",
        "status": "failed",
        "path": "/home/zuul/src/opendev.org/openstack/openstack-ansible/playbooks/setup-hosts.yml"
    },
    "content": "---\n# Copyright 2016, Rackspace US, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n- name: Ensure debsums is installed\n  apt:\n    name: debsums\n    state: present\n  when: security_check_package_checksums | bool\n\n- name: Gather debsums report\n  shell: \"debsums > {{ temp_dir }}/debsums.txt\"\n  changed_when: False\n  failed_when: False\n  when:\n    - security_check_package_checksums | bool\n    - not check_mode | bool\n\n- name: V-71855 - Get files with invalid checksums (apt)\n  shell: \"grep -v OK$ {{ temp_dir }}/debsums.txt | awk '{ print $1 }'\"\n  register: invalid_checksum_files\n  changed_when: False\n  when:\n    - security_check_package_checksums | bool\n    - not check_mode | bool\n    - ansible_os_family | lower == 'debian'\n  tags:\n    - high\n    - V-71855\n\n- name: V-71855 - Create comma-separated list\n  set_fact:\n    invalid_checksum_files_violations: \"{{ invalid_checksum_files.stdout_lines | default([]) | join(', ') }}\"\n  when:\n    - security_check_package_checksums | bool\n    - invalid_checksum_files is defined\n    - invalid_checksum_files.stdout is defined\n  tags:\n    - high\n    - V-71855\n\n- name: V-71855 - The cryptographic hash of system files and commands must match vendor values (apt)\n  debug:\n    msg: >\n      The following files have checksums that differ from the checksum provided\n      with their package. Each of these should be verified manually to ensure\n      they have not been modified by an unauthorized user:\n      {{ invalid_checksum_files_violations }}\n  when:\n    - security_check_package_checksums | bool\n    - ansible_os_family | lower == 'debian'\n    - invalid_checksum_files is defined\n    - invalid_checksum_files.stdout is defined\n  tags:\n    - high\n    - V-71855\n\n# See the documentation for V-71977 for more details on this check.\n- name: Search for AllowUnauthenticated in /etc/apt/apt.conf.d/\n  command: grep -r '^[^#].*AllowUnauthenticated \\\"true\\\"' /etc/apt/apt.conf.d/\n  register: gpgcheck_result\n  changed_when: False\n  failed_when: False\n  check_mode: no\n\n- name: V-71977 - Package management tool must verify authenticity of packages\n  debug:\n    msg: \"Remove AllowUnauthenticated from files in /etc/apt/apt.conf.d/ to ensure packages are verified.\"\n  when:\n    - security_enable_gpgcheck_packages | bool\n    - gpgcheck_result.rc == 0\n  tags:\n    - high\n    - V-71977\n\n- name: V-71979 - Package management tool must verify authenticity of locally-installed packages\n  lineinfile:\n    dest: /etc/dpkg/dpkg.cfg\n    regexp: \"^(#)?no-debsig\"\n    line: \"#no-debsig\"\n    state: present\n  when:\n    - security_enable_gpgcheck_packages_local | bool\n  tags:\n    - high\n    - V-71979\n\n- name: V-71987 - Clean requirements/dependencies when removing packages (dpkg)\n  lineinfile:\n    dest: /etc/apt/apt.conf.d/security-autoremove\n    regexp: \"^(#)?APT::Get::AutomaticRemove\"\n    line: \"APT{{ '::' }}Get{{ '::' }}AutomaticRemove \\\"0\\\";\"\n    state: present\n    create: yes\n  when:\n    - security_package_clean_on_remove | bool\n    - ansible_os_family | lower == 'debian'\n  tags:\n    - low\n    - packages\n    - V-71987\n\n- name: Enable automatic package updates (apt)\n  copy:\n    src: 20auto-upgrades\n    dest: /etc/apt/apt.conf.d/20auto-upgrades\n  when:\n    - ansible_os_family | lower == 'debian'\n    - security_rhel7_automatic_package_updates | bool\n  tags:\n    - packages\n    - cat2\n    - V-71999\n",
    "created": "2020-01-31T15:51:38.652167Z",
    "updated": "2020-01-31T15:51:38.652205Z",
    "path": "/home/zuul/src/opendev.org/openstack/ansible-hardening/tasks/rhel7stig/apt.yml"
}