trailofbits.yaml.ansible.yum-unencrypted-url.yum-unencrypted-url
trailofbits
Author
unknown
Download Count*
License
Found yum download with unencrypted URL (e.g. HTTP, FTP, etc.)
Run Locally
Run in CI
Defintion
rules:
- id: yum-unencrypted-url
message: Found yum download with unencrypted URL (e.g. HTTP, FTP, etc.)
languages:
- yaml
severity: WARNING
metadata:
category: security
cwe: "CWE-319: Cleartext Transmission of Sensitive Information"
subcategory:
- audit
technology:
- ansible
- yum
confidence: HIGH
likelihood: HIGH
impact: HIGH
references:
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/yum_module.html#parameter-name
license: AGPL-3.0 license
vulnerability_class:
- Mishandled Sensitive Information
patterns:
- pattern-inside: |
$YUM:
...
- metavariable-pattern:
metavariable: $YUM
pattern-either:
- pattern: yum
- pattern: ansible.builtin.yum
- pattern: "$KEY: '$VALUE'"
- metavariable-pattern:
metavariable: $KEY
pattern-either:
- pattern: name
- pattern: pkg
- metavariable-regex:
metavariable: $VALUE
regex: (?i)^(http|ftp)://.*
Examples
yum-unencrypted-url.test.yaml
---
- name: Semgrep tests
hosts: all
tasks:
- name: Positive test
ansible.builtin.yum:
# ruleid: yum-unencrypted-url
name: http://example.com/package.rpm
state: present
- name: Negative test (yum-unencrypted-url and yum-validate-certs-disabled)
ansible.builtin.yum:
# ok: yum-unencrypted-url
name: https://example.com/package.rpm
state: present
Short Link: https://sg.run/Ew4NE