Ce produit n'est pas pris en charge par le site Datadog que vous avez sélectionné. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Playbooks and tasks that specify a target user with become_user must also enable privilege escalation so actions execute with the intended elevated privileges. Without become: true, commands run as the unprivileged connection user or fail. This can lead to misconfiguration, failed security controls, or unintended access to sensitive resources. Verify the become property is defined and set to true on ansible_playbook and ansible_task resources whenever become_user is present. Resources where become_user is defined but become is missing or false are flagged for correction.
---- hosts:localhostbecome_user:postgresbecome:truetasks:- name:some taskansible.builtin.command:whoamyouchanged_when:false---- hosts:localhosttasks:- name:become from the same scopeansible.builtin.command:whoamibecome:truebecome_user:postgreschanged_when:false
Non-Compliant Code Examples
---- hosts:localhostname:become_user without becomebecome_user:bartasks:- name:Simple helloansible.builtin.debug:msg:hello---- hosts:localhostname:become_user with become falsebecome_user:rootbecome:falsetasks:- name:Simple helloansible.builtin.debug:msg:hello---- hosts:localhosttasks:- name:become and become_user on different tasksblock:- name:Sample becomebecome:trueansible.builtin.command:ls .- name:Sample become_userbecome_user:fooansible.builtin.command:ls .---- hosts:localhosttasks:- name:become falseblock:- name:Sample becomebecome:trueansible.builtin.command:ls .- name:Sample become_userbecome_user:postgresbecome:falseansible.builtin.command:ls .---- hosts:localhosttasks:- name:become_user with become task as falseansible.builtin.command:whoamibecome_user:mongodbbecome:falsechanged_when:false---- hosts:localhosttasks:- name:become_user without becomeansible.builtin.command:whoamibecome_user:mysqlchanged_when:false
1
2
rulesets:- Ansible / Common # Rules to enforce / Common.
Request a personalized demo
Commencer avec Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.