report.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/usr/bin/bash
  2. op_name="Name Surname"
  3. op_company="Company"
  4. read -p 'Input sanitization data: ' data
  5. #if [ -z $data ]; then
  6. # echo "YOU HAVE TO INPUT THE DATA"
  7. # exit
  8. #fi
  9. start_date=$(echo $data | cut -d "_" -f 1)
  10. end_date=$(echo $data | cut -d "_" -f 2)
  11. system_serial=$(echo $data | cut -d "_" -f 3)
  12. disk_model=$(echo $data | cut -d "_" -f 4)
  13. disk_serial=$(echo $data | cut -d "_" -f 5)
  14. disk_type=$(echo $data | cut -d "_" -f 6)
  15. disk_status=$(echo $data | cut -d "_" -f 7)
  16. sign=$(echo $data | cut -d "_" -f 8)
  17. cat <<EOF > report_temp.md
  18. ---
  19. title: ! '**Disk sanitization report**'
  20. date: $(date)
  21. ---
  22. # Person performing sanitization:
  23. - **Name:** $op_name
  24. - **Organization:** $op_company
  25. # Media information:
  26. - **Make/Model:** $disk_model
  27. - **Serial number:** $disk_serial
  28. - **Media type:** $disk_type
  29. - **Source (ie user name or PC serial):** $system_serial
  30. - **Data backed up:** [ ]Yes [ ]No [X]Unknown
  31. # Sanitization details:
  32. - **Method type:** [X]Clear [ ]Purge [ ]Damage [ ]Destruct
  33. - **Method used:** [ ]Degauss [X]Overwrite [ ]Block Erase [ ]Crypto Erase [ ]Other:
  34. - **Method details:** one random pass and one zero pass as per NIST 800-88 *1
  35. - **Tools used:** shred on HDD and SDD, embedded zeroing on NVME
  36. - **Verification status:** $disk_status
  37. - **Verification Method:** [ ]Full [X]Quick Sampling [ ]Other:
  38. - **Notes:** sample of portion of the disk
  39. - **Operation start:** $start_date
  40. - **Operation end:** $end_date
  41. - **Operation signature (sha1):** $sign
  42. # Media Destintation:
  43. - [ ]Internal Reuse [X]External Reuse [ ]Recycling Facility [ ]Manufacturer [ ]Other (specify in details)
  44. - **Details:**
  45. # Signature:
  46. I attest that the information provided on this statement is accurate to the best of my knowledge:
  47. - Signature:
  48. - Date:
  49. EOF
  50. pandoc report_temp.md -o report_$system_serial.pdf -V geometry:margin=1in --pdf-engine=xelatex
  51. rm report_temp.md
  52. echo "- - -"
  53. echo "your report is in $(pwd)/report_$system_serial.pdf"
  54. xdg-open report_$system_serial.pdf