# How to Secure Ansible playbook

**URL:** <https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183>\
**Category:** Ansible Project\
**Created:** [June 15, 2020, 10:55am UTC](https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183 "2020-06-15T10:55:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nihanth\_Joseph](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@Nihanth\_Joseph](https://forum.ansible.com/u/Nihanth_Joseph)\
**Post date:** [June 15, 2020, 10:55am UTC](https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183/1 "2020-06-15T10:55:37Z")

</div>

I need to encrypt my playbook, so once i deploy it to customer environment, they cannot edit or read my file.

I have tired ansible-vault, but for this we need to save password in text file, so ultimately customer can decrypt my source code using that.

I am a java developer, in java we can convert human readable source code to machine readable byte code and deploy to customer environment.  
so how to do this kind in ansible?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 15, 2020, 12:15pm UTC](https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183/2 "2020-06-15T12:15:49Z")

</div>

So your customer has access to the playbooks and vault passwords?

---

<div class="post-metadata">

**Author:** ![Nihanth\_Joseph](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@Nihanth\_Joseph](https://forum.ansible.com/u/Nihanth_Joseph)\
**Post date:** [June 15, 2020, 12:42pm UTC](https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183/3 "2020-06-15T12:42:05Z")

</div>

Actually we don’t want to expose, our code except developers.  
we have separate team (external to our company) to execute our code in customer environment. and we don’t want to show our code to them.

---

<div class="post-metadata">

**Author:** ![Luca\_remix\_tj\_Lorenz](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Luca\_remix\_tj\_Lorenz](https://forum.ansible.com/u/Luca_remix_tj_Lorenz)\
**Post date:** [June 15, 2020, 12:55pm UTC](https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183/4 "2020-06-15T12:55:33Z")

</div>

Hello,

as far as i know, no tool is provided to obfuscate ansible playbooks.  
I can suggest you to publish your work on an instance of AWX and allow  
the external team to run only. Via AWX they have no access to source  
code of playbooks.

Luca

---

<div class="post-metadata">

**Author:** ![Nihanth\_Joseph](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@Nihanth\_Joseph](https://forum.ansible.com/u/Nihanth_Joseph)\
**Post date:** [June 15, 2020, 2:12pm UTC](https://forum.ansible.com/t/how-to-secure-ansible-playbook/33183/5 "2020-06-15T14:12:51Z")

</div>

Thanks, hope this would solve my issue.
