fetch_security_inputs.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Include security variable file security_vars.yml
  16. include_vars: "{{ security_vars_filename }}"
  17. no_log: true
  18. tags: init
  19. - name: Validate input parameters of security vars are not empty
  20. fail:
  21. msg: "{{ input_security_failure_msg }}"
  22. register: input_base_check
  23. tags: [ validate, security ]
  24. when:
  25. - domain_name | length < 1 or
  26. realm_name | length < 1
  27. - name: Validate the domain name
  28. assert:
  29. that:
  30. - domain_name is regex("^(?!-)[A-Za-z0-9-]+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Za-z]{2,}$")
  31. success_msg: "{{ dom_name_success_msg }}"
  32. fail_msg: "{{ dom_name_fail_msg }}"
  33. tags: [ validate, security ]
  34. - name: Validate the realm name
  35. assert:
  36. that:
  37. - realm_name is regex("^(?!-)[A-Z0-9-]+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Z]{2,}$")
  38. - '"." in realm_name'
  39. success_msg: "{{ realm_success_msg }}"
  40. fail_msg: "{{ realm_fail_msg }}"
  41. tags: [ validate, security ]
  42. - name: Validate max_failures
  43. assert:
  44. that:
  45. - max_failures | int == max_failures_default_value
  46. success_msg: "{{ max_failures_success_msg }}"
  47. fail_msg: "{{ max_failures_fail_msg }}"
  48. tags: [ validate, security ]
  49. - name: Validate failure_reset_interval
  50. assert:
  51. that:
  52. - failure_reset_interval | int
  53. - failure_reset_interval | int <= failure_reset_interval_max_value
  54. - failure_reset_interval | int >= failure_reset_interval_min_value
  55. success_msg: "{{ failure_reset_interval_success_msg }}"
  56. fail_msg: "{{ failure_reset_interval_fail_msg }}"
  57. tags: [ validate, security ]
  58. - name: Validate lockout_duration
  59. assert:
  60. that:
  61. - lockout_duration | int
  62. - lockout_duration | int <= lockout_duration_max_value
  63. - lockout_duration | int >= lockout_duration_min_value
  64. success_msg: "{{ lockout_duration_success_msg }}"
  65. fail_msg: "{{ lockout_duration_fail_msg }}"
  66. tags: [ validate, security ]
  67. - name: Validate session_timeout
  68. assert:
  69. that:
  70. - session_timeout | int
  71. - session_timeout | int <= session_timeout_max_value
  72. - session_timeout | int >= session_timeout_min_value
  73. success_msg: "{{ session_timeout_success_msg }}"
  74. fail_msg: "{{ session_timeout_fail_msg }}"
  75. tags: [ validate, security ]
  76. - name: Validate alert_email_address
  77. assert:
  78. that:
  79. - email_search_key in alert_email_address
  80. - alert_email_address | length < email_max_length
  81. success_msg: "{{ alert_email_success_msg }}"
  82. fail_msg: "{{ alert_email_fail_msg }}"
  83. tags: [ validate, security ]
  84. when: alert_email_address | length > 1
  85. - name: Warning - alert_email_address is empty
  86. debug:
  87. msg: "{{ alert_email_warning_msg }}"
  88. tags: security
  89. when: alert_email_address | length < 1