feat(ssh-honeypot): implement Cowrie SSH honeypot deployment pipeline#5
Open
hariram4862 wants to merge 2 commits intoc2siorg:mainfrom
Open
feat(ssh-honeypot): implement Cowrie SSH honeypot deployment pipeline#5hariram4862 wants to merge 2 commits intoc2siorg:mainfrom
hariram4862 wants to merge 2 commits intoc2siorg:mainfrom
Conversation
RachanaB5
added a commit
to RachanaB5/honeynet
that referenced
this pull request
Mar 29, 2026
- Add modular aws-honeypot (VPC, Cowrie on 2222, SSM, optional flow logs) - Add per-region env tfvars, deploy/validate scripts, backend example - Document open work in docs/ISSUES.md (c2siorg#4 remote state, c2siorg#5 multi-cloud, etc.) - CI workflow for terraform fmt and validate Closes contributor-tracked items 1-3 in docs/ISSUES.md Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement Cowrie SSH Honeypot Deployment Pipeline
Overview
This PR introduces the first functional honeypot deployment workflow for the Honeynet project and addresses Issue #4.
The implementation establishes an automated pipeline capable of provisioning cloud infrastructure and configuring an operational Cowrie SSH honeypot instance.
This work serves as the initial building block for the distributed Honeynet deployment framework described in the project objectives.
The deployment pipeline integrates:
The goal is to enable reproducible deployment of honeypot nodes in cloud environments.
Scope of This PR
This pull request introduces the initial automated deployment pipeline for a Cowrie SSH honeypot.
The implementation includes:
• Terraform infrastructure configuration for AWS EC2
• Ansible automation for honeypot installation
• Cowrie SSH honeypot deployment
• Automated deployment script to orchestrate the pipeline
• Repository structure for infrastructure and configuration management
Currently, the honeypot is configured to run on port 2222, which is exposed through the EC2 security group for attacker interaction.
The default SSH service on port 22 remains reserved for administrative access, and port redirection or multi-port honeypot deployment will be introduced in future improvements.
This PR establishes the first deployable honeypot node in the Honeynet project.
Alignment with Honeynet Project Objectives
This contribution directly supports the core objectives of the Honeynet project:
Automated Deployment
Infrastructure provisioning and configuration are fully automated using Terraform and Ansible.
Distributed Architecture Foundation
The deployment workflow is modular and designed to support future multi-region honeypot deployments.
Data Collection
Cowrie captures attacker interaction data including:
Scalability
Terraform configuration allows future expansion to deploy multiple honeypot nodes across geographic regions.
System Architecture
The honeypot deployment pipeline integrates infrastructure provisioning with configuration management.
Network Interaction Model
The deployed instance emulates an SSH service using Cowrie.
Attacker | v Port 2222 SSH | v Cloud VM | v Cowrie SSH Honeypot | v Attack LogsCowrie captures attacker behavior and stores logs locally.
Example logs include:
Repository Structure
The repository is organized to separate infrastructure provisioning, configuration automation, and documentation.
Deployment Methodology
The honeypot deployment process consists of three stages.
Stage 1 — Infrastructure Provisioning
Terraform provisions the cloud environment.
Resources created:
Terraform configuration files:
terraform/main.tfterraform/provider.tfterraform/variables.tfterraform/terraform.tfvarsTerraform initializes the infrastructure and provisions the honeypot host.
Stage 2 — Configuration Automation
After infrastructure provisioning, Ansible configures the honeypot node.
The playbook performs the following tasks:
Ansible files:
ansible/inventory.iniansible/playbooks/install_honeypot.ymlStage 3 — Honeypot Initialization
Once deployed, Cowrie runs as an SSH honeypot service.
Cowrie emulates a vulnerable SSH server and records attacker activity.
Captured information includes:
This data provides insight into attacker behavior.
Deployment Workflow
The honeypot deployment is orchestrated using the deployment script:
scripts/deploy_honeypots.shThis script is executed from the developer's local machine and automates the full infrastructure provisioning and configuration workflow.
Deployment Pipeline
Environment
Development and testing environment used for this implementation:
Prerequisites
Before running the deployment, ensure the following tools are installed on the local development machine:
AWS Configuration
Terraform uses AWS credentials configured locally.
Configure AWS CLI:
Provide the following details:
Terraform will automatically use these credentials during infrastructure provisioning.
Deployment Script (Local Machine)
From the root directory of the repository, run the deployment script.
Linux / macOS
Windows (WSL or Git Bash)
This script performs the following operations:
After completion, the EC2 instance will contain a fully configured Cowrie honeypot.
Verification
Once deployment is complete, the honeypot functionality can be verified using the following steps.
Step 1 — Test SSH Interaction (Local Machine)
Attempt to connect to the honeypot from your local machine:
The Cowrie honeypot presents a simulated SSH server environment designed to mimic a vulnerable system.
When prompted for credentials, you may enter any password.
Cowrie records the authentication attempt and simulates a shell session in order to capture attacker behavior.
All login attempts, commands, and session interactions are logged for analysis.
Step 2 — Verify Honeypot Service and Logs (EC2 Instance)
Connect to the EC2 instance:
Check Cowrie service status
Verify Cowrie is listening on port 2222
ss -tulnp | grep 2222Monitor Cowrie logs
tail -f ~/cowrie/var/log/cowrie/cowrie.logThese logs will display captured attacker interactions including:
Example Honeypot Activity
Typical captured events include:
This confirms that the Cowrie honeypot is functioning correctly and capturing attacker behavior.
Resource Cleanup
To avoid leaving cloud resources running after testing, destroy the infrastructure using Terraform.
Navigate to the Terraform directory:
cd terraformThen run:
This will remove the EC2 instance and all associated infrastructure created during deployment.
Future Improvements
The current implementation establishes the first operational honeypot node and automated deployment pipeline.
Future enhancements will extend this work to support the broader Honeynet project objectives:
These improvements will move the system toward a scalable, distributed honeynet platform.
Summary
This PR introduces the first operational deployment pipeline for the Honeynet project, enabling automated provisioning and configuration of a Cowrie SSH honeypot node.
The implementation demonstrates how infrastructure provisioning and configuration management can be combined to build a scalable honeynet deployment framework.
This work establishes the foundation required to expand the system into a distributed honeynet architecture.
Closes #4