For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

Disabled Ansible URI certificate validation misconfiguration detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_ANSIBLE_1

Category - Subcategory

Public Exposure - Encryption And Protocols

Provider

OTHER

Severity

MEDIUM

Framework

Ansible

Impact

This rule detects whether Ansible URI tasks enforce certificate validation, thereby enhancing the security of your HTTPS requests. Disabling certificate validation in URI tasks can expose the system to various security issues, including man-in-the-middle (MITM) attacks.

How to Fix

Attribute: uri.validate_certs

To mitigate this risk, ensure that the validate_certs`` attribute is set to true`` in your Ansible URI tasks. This setting ensures that SSL certificates are properly validated during HTTPS requests, enhancing the security of your system.

Secure Code Example:

The above example ensures that the SSL certificate of the specified URL is validated by setting validate_certs to true in Ansible URI tasks. [source,go]

  • name: Example hosts: all gather_facts: False tasks:

    • name: disabled uri: url: https://www.example.com return_content: yes

  •    validate_certs: false
  •    validate_certs: true
    register: this
    failed_when: "'AWESOME' not in this.content"

Last updated

Was this helpful?