Giter VIP home page Giter VIP logo

ansible-secure-source-demo's Introduction

Demonstration of ansible-sign

To demonstrate Ansible Automation Platforms source validation features:

  1. Copy the public key available in this repository, available here: https://raw.githubusercontent.com/mglantz/ansible-secure-source-demo/main/secure-org_pubkey.asc

  2. Create a new set of credentials, use GPG key as type and paste in the key you copied in step 1. Creating a new set of credentials

  3. Create a new project and define the GPG key, ensure to enable "Update revision on project launch". Create a new project

  4. Create an inventory with your project as source. When adding the source, select "Update on launch" to ensure you force a project sync before inventory is used. Create an inventory

  5. Create a job template using the playbooks/ping.yml playbook connected to the inventory you just created. Create a job template

  6. Run the job template.

  7. Show how the related playbook (ping.yml) now is cryptographically validated before getting run, along side with the inventory source you run against. Review run jobs to show the Source Control Update triggered by your job template run. Review jobs

  8. Show the validation which happened during the Source Control Update of your project. Review logs

How ansible-sign works with Ansible Automation Platform

How ansible-sign works

The workflow for ansible-sign is as follows:

  1. User create a new gpg keypair and exports the public key, for use in AAP. In our example below saved as secure-org_pubkey.asc
$ gpg --generate-key
<Output omitted>
$ gpg --list-keys
[keyboxd]
---------
pub   ed25519 2024-04-19 [SC] [expires: 2027-04-19]
      A0E1F2B2907EC4615A105C268841AA232A1E5C35
uid           [ultimate] Secure Org <[email protected]>
sub   cv25519 2024-04-19 [E] [expires: 2027-04-19]

$ gpg --export --armour A0E1F2B2907EC4615A105C268841AA232A1E5C35 >secure-org_pubkey.asc
  1. User checks out a git repository and potentially creates files to protect (inventory, playbooks, etc)
  2. User creates the MANIFEST.in file and the .ansible-sign directory in the root of the project directory. MANIFEST.in file needs to have an include OR an exclude statement covering all files. Example for our demo repostitory is:
include inventory
recursive-include playbooks *.yml
recursive-include playbooks *.yaml
include *.yml
include *.yaml
include MANIFEST.in
include README.md
include secure-org_pubkey.asc
recursive-include images *.png
exclude .ansible-lint
exclude .gitignore
recursive-exclude .git *
  1. User runs ansible-sign project gpg-sign . inside of the project directory, which causes ansible-sign to read the MANIFEST.in file and generate the .ansible-sign/sha256sum.txt and .ansible-sign/sha256sum.txt.sig

  2. User does a git add on any files changed, including the two files in .ansible-sign/, then commits and pushes the code to the repository.

  3. Validation happens automatically if configured in AAP.

  4. Read more here: https://docs.ansible.com/automation-controller/latest/html/userguide/project-sign.html

ansible-secure-source-demo's People

Contributors

mglantz avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.