Résumé
ONYEDIKACHI BERNARDCLOUD · DEVSECOPS · AI
RésuméGet in touch
CASE 30INFRASTRUCTURE AS CODE

IaC Pipeline Provisioning

I built and executed an automated IaC pipeline using Vagrant, Docker, and Ansible that provisioned a database server and web server, configured the application environment, and deployed a functional web application, then assessed where security controls fit into that process.

Status: DEPLOYED · REVIEWED

DOMAIN
Infrastructure as Code
PLATFORM
Vagrant, Docker, Ansible
SEVERITY
Low
OUTCOME
Pipeline deployed and reviewed

TOOLS

VagrantDockerAnsibleMySQLFlaskYAMLBashInfrastructure as CodeLinux
RESULT
BEFOREManual deployment
AFTERAutomated IaC pipeline
01

Objective

I set out to build and run an automated IaC pipeline that provisions a database and web server, configures the application through Ansible, and deploys a working web application, then review where security controls should be applied.

02

Scenario

The environment required a database server and a web server, each running in Docker containers, with Ansible handling the configuration management. I wanted to understand how the entire deployment worked end to end and identify where security decisions were embedded in the automation.

03

What I found

provisioned-containersDEPLOYED
dbserver:    MySQL, internal network (<REDACTED>)
webserver:   Ansible/Flask, internal network (<REDACTED>)
SSH:         Exposed on localhost:2200
Application: Flask on 0.0.0.0:80
FINDING 01LOW

Pipeline deployed successfully with default configurations

The IaC pipeline provisioned two Docker containers on an internal network: a MySQL database server and a Flask web server. Ansible automatically configured the database and application using reusable variables and templates.

The pipeline worked as designed, but the default configuration included hardcoded credentials, broad network bindings, and SSH exposed through port forwarding.

04

What I did

  1. Reviewed the Vagrantfile

    I identified the two containers, their network configuration, Docker images, and provisioning settings.

  2. Reviewed the Ansible playbook

    I traced how the webapp role configured the database and web application components automatically.

  3. Started the pipeline

    I ran vagrant up and verified both containers were running with docker ps.

  4. Tested the application

    I started the Flask application and accessed it through the web server, created an account, and authenticated.

  5. Assessed security posture

    I noted where credentials, network bindings, and access controls could be hardened.

EVIDENCE

TEXT
# Pipeline deployment summary
vagrant up:          Two containers provisioned (dbserver, webserver)
docker ps:           Both containers running
Ansible:             Database and application configured automatically
Flask application:   Started and accessible on port 80
05

Validation

The IaC pipeline provisioned both containers, Ansible configured the application, and the Flask web application was accessible and functional. The full deployment was automated and repeatable.

06

Before and after

ASPECTBEFOREAFTER
Deployment methodManualAutomated IaC pipeline
Database provisioningManual configurationAnsible-managed
Web server provisioningManual configurationAnsible-managed
RepeatabilityNot guaranteedConsistent via Vagrant + Ansible
Security reviewNot performedCredential and network risks identified
07

What I recommend

  1. 01Store database and application credentials in a secrets manager or encrypted Ansible vault, not in plaintext configuration files.
  2. 02Restrict network bindings so services only listen on the interfaces they need.
  3. 03Disable or restrict SSH access to provisioned containers in production.
  4. 04Apply least-privilege principles to every component the pipeline provisions.
  5. 05Review IaC configurations for security before applying them to any environment.

“IaC can turn complex infrastructure and application deployment into a repeatable process, but the same automation must also enforce secure credentials, access controls, and network configurations.”

WHAT I LEARNED

SKILLS IT PROVES

  • Infrastructure as Code
  • Configuration Management
  • Ansible
  • Vagrant
  • Docker
  • DevOps
  • CI/CD
  • Linux Administration
  • Application Deployment
  • Automation
  • Network Configuration
  • Database Configuration
  • Security Hardening
  • Secrets Management
  • Least Privilege
View my labs on GitHub