How To – Michael T. DeWitt https://michaeldewitt.com Solutions For Your Digital Needs! Tue, 09 Sep 2025 20:01:44 +0000 en-US hourly 1 https://wordpress.org/?v=7.1 https://michaeldewitt.com/wp-content/uploads/2024/08/DS_Icon_Logo2-100x100.png How To – Michael T. DeWitt https://michaeldewitt.com 32 32 Automate My Workflow: Streamline Your YouTube Shorts Factory with n8n https://michaeldewitt.com/2025/08/22/pimp-my-workflow-trick-out-your-youtube-shorts-factory-with-n8n/ https://michaeldewitt.com/2025/08/22/pimp-my-workflow-trick-out-your-youtube-shorts-factory-with-n8n/#comments Fri, 22 Aug 2025 21:54:23 +0000 https://michaeldewitt.com/?p=1108 Introduction

Content creators and tech teams alike are stuck in a loop.

You either spend hundreds on tools like Synthesia or Pictory or waste time manually creating video content. But what if there was a smarter way?

If you’re in IT, DevOps, software, or AI—this guide is for you. We’ll show you how to build your own automated video system using n8n, Ollama, Edge-TTS, ComfyUI, and MoviePy. No subscriptions. Full control. All open source.

By the end of this guide, you’ll have a working YouTube Shorts engine that generates, edits, and uploads content while you sleep.


What is a YouTube Shorts Factory (and Why Build One Yourself)?

A YouTube Shorts factory is an automated pipeline that takes a topic, generates a script, creates visuals and audio, stitches everything into a short video, and uploads it to YouTube.

Most people pay $200+ a month for this. You’re going to do it for free with tools like:

  • n8n – Automates everything.
  • Ollama + Llama 3 – Generates scripts using local AI.
  • Edge-TTS – Converts text to natural voiceovers.
  • ComfyUI – Generates images from prompts.
  • MoviePy – Creates video files.
  • YouTube Node in n8n – Uploads your Shorts.

If you’re in tech, learning to connect open-source tools like these will sharpen your automation skills, improve your productivity, and give you complete control.


How to Build Your Own YouTube Shorts Factory

Step 1: Set Up Your Custom n8n Instance

This is your automation brain.

  1. Create a folder and add two files:
    • docker-compose.yml
    • Dockerfile

docker-compose.yml

version: '3.8'
services:
  n8n:
    build: .
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=changeme123
      - GENERIC_TIMEZONE=America/New_York
    volumes:
      - ./n8n_data:/home/node/.n8n
    extra_hosts:
      - "host.docker.internal:host-gateway"

Dockerfile

FROM n8nio/n8n:latest

USER root
RUN apt-get update \
 && apt-get install -y --no-install-recommends python3 python3-pip ffmpeg ca-certificates \
 && rm -rf /var/lib/apt/lists/* \
 && pip3 install --no-cache-dir edge-tts moviepy
USER node
  1. In the terminal, run:
docker-compose up -d
  1. Open http://localhost:5678 in your browser and log in with:
    • Username: admin
    • Password: changeme123

Now your automation engine is live.


Step 2: Build the Workflow in n8n

Your workflow will look like this:

[Trigger] → [Ollama Script] → [Edge-TTS Voice]
                   ↓
     [ComfyUI Generate Image] → [MoviePy Assemble]
                                   ↓
                            [YouTube Upload]

Step 3: Generate the Script with Ollama

  1. Install Ollama locally:
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull llama3
  1. Add an HTTP Request node in n8n.

Set it to:

  • POST to http://host.docker.internal:11434/api/generate
  • Add a header: Content-Type: application/json
  • Use this body:
{
  "model": "llama3",
  "prompt": "Write an engaging 30-second YouTube Shorts script about {{ $json.topic }}. Hook the viewer, surprise them, and end with a strong CTA. 75-100 words.",
  "stream": false
}

Now Ollama generates engaging, unique scripts for every video topic you feed it.


Step 4: Convert Script to Voice with Edge-TTS

  1. Add an Execute Command node.
  2. Use this command (writes text to file to avoid quote issues):
printf "%s" {{ $json.response.toString().jsonEscape() }} > /home/node/.n8n/script_{{ $runIndex }}.txt \
&& edge-tts --voice "en-US-AriaNeural" --text-file "/home/node/.n8n/script_{{ $runIndex }}.txt" \
--write-media "/home/node/.n8n/audio_{{ $runIndex }}.mp3"

Edge-TTS gives you realistic voiceovers in over 100 languages. Everything is saved to your shared folder.


Step 5: Generate Images with ComfyUI

  1. Clone and install ComfyUI:
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
pip install -r requirements.txt
  1. Download your chosen model (e.g., SDXL Base) with a Hugging Face token if needed:
cd models/checkpoints
huggingface-cli download stabilityai/stable-diffusion-xl-base-1.0 --include "*.safetensors"
  1. Configure ComfyUI to save images into your n8n shared folder by editing extra_model_paths.yaml:
comfyui:
  base_path: ./ 
  output_directory: ../n8n_data/ComfyUI_Output
  1. Start ComfyUI:
python main.py --listen --port 8188
  1. In n8n, use a sequence of nodes:
    • HTTP POST to /prompt with a workflow JSON (passing your text prompt in)
    • HTTP GET to /history/<client_id> to retrieve the filename

Prompt example:

{{ $node['HTTP Request'].json.response }}, cinematic lighting, high quality, 4k

This ensures you get the actual filename when the image is ready.


Step 6: Assemble the Video with MoviePy

  1. Save this script as ./n8n_data/create_video.py on your host:
from moviepy.editor import *
import argparse

def make_even(x):
    return int(x) if int(x) % 2 == 0 else int(x) - 1

parser = argparse.ArgumentParser()
parser.add_argument('--image', required=True)
parser.add_argument('--audio', required=True)
parser.add_argument('--output', default='shorts_video.mp4')
args = parser.parse_args()

audio = AudioFileClip(args.audio)
img = ImageClip(args.image).set_duration(audio.duration)

target_w, target_h = 1080, 1920
img = img.resize(height=target_h)

bg = ColorClip(size=(target_w, target_h), color=(0,0,0)).set_duration(audio.duration)
x = (target_w - img.w) // 2
y = (target_h - img.h) // 2

final = CompositeVideoClip([bg, img.set_position((x, y))]).set_audio(audio).fadein(0.5).fadeout(0.5)

final_w, final_h = make_even(final.w), make_even(final.h)
if (final.w, final.h) != (final_w, final_h):
    final = final.resize(newsize=(final_w, final_h))

final.write_videofile(args.output, fps=30, codec='libx264', audio_codec='aac', verbose=False)
  1. In n8n, use an Execute Command node:
python3 /home/node/.n8n/create_video.py \
--image "/home/node/.n8n/ComfyUI_Output/{{ $node['Retrieve Generated Image'].json.filename }}" \
--audio "/home/node/.n8n/audio_{{ $runIndex }}.mp3" \
--output "/home/node/.n8n/final_video_{{ $runIndex }}.mp4"

This gives you a complete short video—synced audio, proper 9:16 framing, and polished formatting.


Step 7: Upload to YouTube Automatically

  1. Add a YouTube Node in n8n.
  2. Connect your account with OAuth.
  3. Use these config values:
  • Operation: Upload
  • Title: {{ $json.topic }} - Mind-Blowing Facts!
  • Description: {{ $node['HTTP Request'].json.response }} 🔔 Subscribe for more! #Shorts #{{ $json.topic }}
  • Tags: {{ ['shorts', $json.topic, 'facts'] }}
  • Category: 22
  • Privacy: public
  • Video File Path: /home/node/.n8n/final_video_{{ $runIndex }}.mp4

Now your video uploads automatically.


Tips and Reminders for Building This System

  • Use host.docker.internal + extra_hosts for Linux containers to access host services like Ollama.
  • Ollama and ComfyUI run locally; Edge-TTS requires internet.
  • Add a Google Sheet or database for automated topic scheduling.
  • Use Whisper AI to auto-generate subtitles if needed.
  • Always test with safe sample topics before scaling up.

Closing Thoughts

You’ve just built an entire automated content system that others pay hundreds for—without paying a dime.

It’s fully customizable, scalable, and entirely yours. Whether you’re creating tech content, educational Shorts, or AI-powered storytelling—this workflow can handle it all.

Just imagine how much money I could save your company……. with my automation skills.

]]>
https://michaeldewitt.com/2025/08/22/pimp-my-workflow-trick-out-your-youtube-shorts-factory-with-n8n/feed/ 4
RHEL Hardening: Because ‘YOLO’ Is Not a Security Strategy https://michaeldewitt.com/2025/03/01/rhel-hardening-because-yolo-is-not-a-security-strategy/ https://michaeldewitt.com/2025/03/01/rhel-hardening-because-yolo-is-not-a-security-strategy/#comments Sat, 01 Mar 2025 20:03:40 +0000 https://michaeldewitt.com/?p=894

Securing your Red Hat Enterprise Linux (RHEL) system is essential to protect sensitive data and maintain operational stability. Implementing strong security measures reduces vulnerabilities and strengthens your system against potential threats. Below are key steps to effectively harden your RHEL environment.


1. Keep Your System Updated

Regular updates ensure that security patches and performance improvements are applied.

sudo yum update -y

Keeping your system updated helps prevent exploitation of known vulnerabilities.


2. Minimize Installed Packages

Reducing the number of installed packages decreases the system’s attack surface. During installation, select a minimal setup, and remove unnecessary software:

sudo yum remove package-name

Less software means fewer potential vulnerabilities.


3. Configure User Accounts and Authentication

Implement strong password policies and limit administrative access.

  • Disable Root Login via SSH:

    sudo vi /etc/ssh/sshd_config
    

    Set:

    PermitRootLogin no
    
  • Enforce Strong Password Policies:

    sudo vi /etc/security/pwquality.conf
    

    Adjust minlen, dcredit, ucredit, and other values to strengthen password complexity.

These changes reduce the risk of unauthorized access.


4. Implement Firewall and Network Security

Use firewalld to control incoming and outgoing traffic:

sudo systemctl start firewalld
sudo systemctl enable firewalld

Configure zones and services according to your network’s needs. Also, disable unnecessary network services to limit entry points.


5. Enable SELinux

SELinux enforces mandatory access controls.

  • Check Status:

    sestatus
    
  • Set to Enforcing Mode:

    sudo vi /etc/selinux/config
    

    Ensure:

    SELINUX=enforcing
    

Enforcing mode helps prevent unauthorized actions by restricting process capabilities.


6. Secure SSH Access

Make SSH more secure by adjusting key configurations.

  • Disable Password Authentication:

    sudo vi /etc/ssh/sshd_config
    

    Set:

    PasswordAuthentication no
    
  • Change SSH Port:

    sudo vi /etc/ssh/sshd_config
    

    Set:

    Port 2222
    

Key-based authentication and a non-default port reduce the likelihood of brute-force attacks.


7. Configure System Logging and Auditing

Implement system-wide logging and auditing to detect and respond to suspicious activities.

  • Install and Configure auditd:

    sudo yum install audit
    sudo systemctl start auditd
    sudo systemctl enable auditd
    
  • Regularly Review Logs:

    sudo ausearch -m avc,user_avc,selinux_err,user_selinux_err -ts today
    

Reviewing logs regularly can help you catch and investigate unusual activity early.


8. Enable FIPS Mode

FIPS mode ensures that only approved cryptographic algorithms are used.

  • Enable FIPS Mode:

    sudo fips-mode-setup --enable
    
  • Verify FIPS Mode:

    fips-mode-setup --check
    

This is particularly important for organizations that require compliance with regulatory standards.


9. Implement File System Encryption

Protect sensitive data with disk encryption.

  • Install LUKS:

    sudo yum install cryptsetup
    
  • Set Up Encrypted Partition:

    sudo cryptsetup luksFormat /dev/sdX
    sudo cryptsetup luksOpen /dev/sdX encrypted_partition
    sudo mkfs.ext4 /dev/mapper/encrypted_partition
    sudo mount /dev/mapper/encrypted_partition /mnt
    

Encrypting storage ensures that data remains protected, even if physical drives are compromised.


 

]]>
https://michaeldewitt.com/2025/03/01/rhel-hardening-because-yolo-is-not-a-security-strategy/feed/ 2
Tenant-Tenant Bang Bang: Smooth Profile Moves with User Profile Wizard https://michaeldewitt.com/2024/11/25/tenant-tenant-bang-bang-smooth-profile-moves-with-user-profile-wizard/ https://michaeldewitt.com/2024/11/25/tenant-tenant-bang-bang-smooth-profile-moves-with-user-profile-wizard/#respond Mon, 25 Nov 2024 21:34:49 +0000 https://michaeldewitt.com/?p=809

I’ve created a saying. It goes, “Repetition is second only to documentation.” I say this, because there was a point in my career I had Azure’s web layout pretty well memorized. Step away for a few months, only to come back to other things they changed or removed or renamed.

Thankfully, I take really good notes and create excellent documentation. Because of those factors, I was able to figure out the steps I needed to take. But this also gave me an opportunity to publish to my site a more recent set of instructions. No idea how long they will stay relevant though.

Lets get started!

How to Use the Corporate Edition of User Profile Wizard to Migrate a User Profile Between Azure Tenants

Transitioning user profiles between Azure tenants can be a challenging task, especially during company mergers, rebranding, or restructuring. The User Profile Wizard Corporate Edition simplifies this process, allowing seamless profile migration without disrupting user workflows. Here’s a step-by-step guide to help you migrate a user profile between two Azure tenants using this robust tool.


What Is the User Profile Wizard Corporate Edition and Why It Matters

The User Profile Wizard Corporate Edition, developed by ForensiT, is a powerful tool designed for IT administrators to migrate user profiles between domains or tenants efficiently. Its core benefit lies in retaining user-specific settings like desktop layouts, applications, and files while minimizing the risks of data loss or extended downtime. This makes it an indispensable tool for organizations undergoing tenant migrations.


Step-by-Step Guide to Migrating a User Profile Between Azure Tenants

Step 1: Prepare Your Environment

Before initiating the migration, ensure the following prerequisites are met:

  • Administrative Rights: You must have administrative access on both the source and destination tenants.

  • Licenses: Ensure you have a valid license for the Corporate Edition of User Profile Wizard.

  • Backup: Create a backup of the user profiles to prevent accidental data loss.

  • Network Connectivity: Confirm network connectivity to both Azure tenants for seamless operation.


Step 2: Install the User Profile Wizard Corporate Edition

  1. Download the Tool: Visit ForensiT’s official site and download the Corporate Edition.

  2. Install the Application: Follow the on-screen instructions to install the software on the target device.


Step 3: Set Up Source and Target Azure Tenants

  1. Source Tenant Configuration:

    • Log in to the source Azure tenant and document user profile details.

    • Ensure the profile is accessible and not locked by any application.

  2. Target Tenant Preparation:

    • Create user accounts in the destination Azure tenant with necessary permissions.

    • If needed, synchronize the user accounts via Azure AD Connect.


Step 4: Configure Migration Settings in User Profile Wizard

  1. Launch the Application: Open the User Profile Wizard and select the migration mode.

  2. Specify Source and Destination:

    • Enter the domain name of the source Azure tenant.

    • Provide the domain name or tenant ID of the destination Azure tenant.

  3. Select Profiles to Migrate:

    • Choose the user profile(s) to migrate.

    • Use filters to streamline the selection process, especially in environments with multiple user profiles.

  4. Map User Accounts:

    • Map the source user profile to the corresponding user account in the target Azure tenant.

    • The wizard supports automatic and manual mapping.


Step 5: Execute the Migration

  1. Start the Migration Process:

    • Click on the “Migrate” button to initiate the process.

    • Monitor the progress through the tool’s interface.

  2. Validate Migration:

    • Log in to the target Azure tenant with the migrated user profile credentials.

    • Check if desktop settings, application configurations, and files are intact.


Step 6: Post-Migration Tasks

  1. Verify Data Integrity:

    • Confirm all user data has been transferred correctly.

    • Check for any missing files or corrupted data.

  2. Update Policies:

    • Apply group policies or settings as required in the destination tenant.

    • Ensure compliance with organizational IT standards.

  3. Clean Up:

    • Remove temporary files or cached data from the source tenant.

    • Decommission the source profile if it’s no longer needed.


Tips and Best Practices for a Smooth Migration

  • Test Before Full Rollout: Always perform a trial migration with a test account to identify potential issues.

  • Documentation: Keep detailed records of the migration process, including any errors and their resolutions.

  • User Communication: Notify affected users in advance to minimize disruptions.

  • Leverage Support: Use ForensiT’s support resources or documentation for complex scenarios.


Closing and Call-to-Action

Migrating user profiles between Azure tenants doesn’t have to be daunting. With the User Profile Wizard Corporate Edition, you can streamline the process and ensure data continuity. By following this guide, you’ll navigate the migration with confidence and efficiency.

Need more resources or support? Visit ForensiT to explore their comprehensive documentation and additional tools tailored to your migration needs.

]]>
https://michaeldewitt.com/2024/11/25/tenant-tenant-bang-bang-smooth-profile-moves-with-user-profile-wizard/feed/ 0
How to Deploy an Azure Web App: A Step-by-Step Guide https://michaeldewitt.com/2024/08/30/how-to-deploy-an-azure-web-app-a-step-by-step-guide/ https://michaeldewitt.com/2024/08/30/how-to-deploy-an-azure-web-app-a-step-by-step-guide/#respond Fri, 30 Aug 2024 19:21:52 +0000 https://michaeldewitt.com/?p=630

Deploying an Azure Web App is a crucial task for developers and businesses looking to scale their applications in a cloud environment. Azure offers a streamlined and efficient way to host web apps, making it a popular choice among tech professionals. This guide will walk you through the process of deploying an Azure Web App, whether you’re a seasoned developer or just getting started with cloud services.

What is an Azure Web App and Why Does it Matter?

Azure Web Apps are part of Microsoft’s Azure App Service, a fully managed platform for building, deploying, and scaling web apps. This service supports various programming languages like .NET, Java, Node.js, and Python, among others. It allows developers to focus on coding while Azure handles the infrastructure, scaling, and security aspects.

Deploying your application to Azure ensures high availability, scalability, and integration with other Azure services. Whether you’re running a small personal project or a large-scale enterprise application, Azure Web Apps provide a reliable and efficient way to manage your web presence.

How to Deploy an Azure Web App

Follow these steps to deploy your application to Azure. This process assumes you have an Azure account and some basic familiarity with Azure services.

Step 1: Set Up Your Azure Environment

Before you start deploying, make sure you have the following:

  • An active Azure subscription.

  • Azure CLI installed on your local machine. You can download it from the official Azure CLI page.

  • A code editor like Visual Studio Code.

  • A project you want to deploy (e.g., a Node.js, .NET, or Python application).

Step 2: Create a Resource Group

Resource groups in Azure are containers that hold related resources for an Azure solution. You can manage the resources inside a group collectively, which makes administration easier.

To create a resource group, open your terminal and run:

az group create --name myResourceGroup --location "East US"

Replace myResourceGroup with a name that makes sense for your project, and choose a location that is geographically close to your users.

Step 3: Create an App Service Plan

An App Service Plan defines the region, number of workers, and pricing tier for your web app. Run the following command to create a service plan:

az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku FREE

The --sku FREE option selects the free tier. For production applications, consider using higher-tier plans based on your needs.

Step 4: Create the Web App

With the service plan in place, you can now create your web app. Run:

az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name myUniqueAppName

Replace myUniqueAppName with a unique name for your app, as this will be part of your app’s URL.

Step 5: Deploy Your Application Code

Now that your app is set up, it’s time to deploy your code. If you’re using Git, you can deploy directly from your repository. First, configure Azure to use your Git repository:

az webapp deployment source config-local-git --name myUniqueAppName --resource-group myResourceGroup

This command will provide you with a Git URL to push your code. Add this URL as a remote in your local Git repository:

git remote add azure <Git-URL>
git push azure main

Replace <Git-URL> with the URL provided by Azure and main with the branch you want to deploy.

Step 6: Monitor and Manage Your App

Once deployed, you can monitor and manage your app through the Azure Portal. Azure provides tools for scaling your app, setting up alerts, and viewing logs.

To open your app in the browser, you can use:

az webapp browse --name myUniqueAppName --resource-group myResourceGroup

Step 7: Scale Your Web App (Optional)

If you need to handle more traffic or require better performance, Azure makes it easy to scale your app. You can scale up by moving to a higher pricing tier or scale out by increasing the number of instances.

To scale up:

az appservice plan update --name myAppServicePlan --resource-group myResourceGroup --sku B1

To scale out:

az webapp scale --name myUniqueAppName --resource-group myResourceGroup --min-instances 2 --max-instances 5

This command scales your app to use between 2 and 5 instances.

Tips and Reminders for Deploying Azure Web Apps

  • Backup and Recovery: Always set up backups for your web app, especially for production environments. Azure provides easy-to-use backup services.

  • Security: Ensure your app is secure by setting up HTTPS, configuring authentication, and regularly updating your app and dependencies.

  • Continuous Integration/Continuous Deployment (CI/CD): Integrate your Azure Web App with a CI/CD pipeline using Azure DevOps or GitHub Actions for automated deployments.

Conclusion

Deploying an Azure Web App is a straightforward process that brings many benefits, including scalability, security, and integration with other Azure services. By following this guide, you can set up and deploy your application with ease, allowing you to focus on development rather than infrastructure management.

For more detailed guidance on specific languages or frameworks, check out Microsoft’s official documentation.


Ready to take your web app to the next level? Contact me today for a consultation on optimizing your Azure deployment for performance and security.

]]>
https://michaeldewitt.com/2024/08/30/how-to-deploy-an-azure-web-app-a-step-by-step-guide/feed/ 0
How to Use Kali Linux for Effective Penetration Testing https://michaeldewitt.com/2024/06/15/how-to-use-kali-linux-for-effective-penetration-testing/ https://michaeldewitt.com/2024/06/15/how-to-use-kali-linux-for-effective-penetration-testing/#respond Sat, 15 Jun 2024 20:03:54 +0000 https://michaeldewitt.com/?p=579

How to Use Kali Linux for Effective Penetration Testing

Kali Linux is a powerful tool in the arsenal of any cybersecurity professional. Its vast array of pre-installed tools makes it an ideal platform for penetration testing, also known as ethical hacking. Whether you’re a seasoned professional or a newcomer to the field, understanding how to use Kali Linux effectively can significantly enhance your penetration testing capabilities.

In this guide, we’ll walk you through the key steps to get started with Kali Linux for penetration testing. We’ll cover everything from setting up your environment to executing a basic penetration test, ensuring you’re well-equipped to assess the security of systems and networks.


Step 1: Setting Up Your Kali Linux Environment

Before diving into penetration testing, it’s crucial to set up your Kali Linux environment correctly. Here’s how to get started:

Download and Install Kali Linux:

  • Head to the official Kali Linux website and download the appropriate ISO file for your system. Kali Linux is compatible with various platforms, including bare metal, virtual machines, and cloud instances.

  • If you’re new, using a virtual machine (VM) setup via tools like VMware or VirtualBox is recommended. This provides a safe environment to test without risking your primary system.

Update and Upgrade Your System:

  • After installation, it’s essential to update and upgrade the system. Open the terminal and run the following commands:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
  • This ensures that all tools and the operating system itself are up to date, reducing the risk of encountering bugs or outdated software during your tests.

Create a Snapshot (If Using a VM):

  • Before making significant changes or conducting tests, create a snapshot of your VM. This allows you to revert to a clean state if something goes wrong during your tests.


Step 2: Familiarize Yourself with Essential Tools

Kali Linux comes with a comprehensive suite of tools designed for various aspects of penetration testing. Here are a few essential tools you should get familiar with:

Nmap:

  • A network scanning tool that allows you to discover hosts and services on a computer network by sending packets and analyzing the responses.

  • To perform a simple scan, use:

    nmap -sP 192.168.1.1/24
  • This command scans the specified IP range and lists active devices.

Metasploit Framework:

  • An exploit development and execution platform that enables you to find, exploit, and validate vulnerabilities.

  • Start Metasploit by typing:

    msfconsole
  • From here, you can search for exploits, payloads, and auxiliary modules relevant to your target.

Wireshark:

  • A network protocol analyzer that lets you capture and interactively browse the traffic running on a computer network.

  • Useful for analyzing traffic and detecting anomalies during penetration testing.

Burp Suite:

  • A web vulnerability scanner that is particularly useful for testing the security of web applications.

  • Launch Burp Suite and start intercepting HTTP requests to identify vulnerabilities such as SQL injection, XSS, and more.


Step 3: Planning Your Penetration Test

A successful penetration test starts with thorough planning. Here’s how to approach it:

Define the Scope:

  • Identify the systems, networks, or applications that are within the testing scope. Clearly define what is off-limits to avoid any unauthorized testing, which could lead to legal issues.

Gather Information (Reconnaissance):

  • Begin with passive reconnaissance to gather as much information as possible about the target without directly interacting with it. Tools like whois, nslookup, and theHarvester are excellent for this stage.

Identify Vulnerabilities:

  • Use tools like Nmap, Nikto, or OpenVAS to scan the target for open ports, running services, and potential vulnerabilities. Document your findings meticulously, as this will guide the exploitation phase.


Step 4: Executing the Penetration Test

With your tools in hand and plan in place, it’s time to execute the penetration test. Follow these steps:

Gaining Access:

  • Use Metasploit or manual exploitation techniques to gain access to the target system. For example, if Nmap revealed a vulnerable SSH service, you might use Metasploit to exploit it and gain shell access.

Maintaining Access:

  • Once access is gained, set up a backdoor or a persistent method to maintain access. Tools like Netcat or Weevely can be used for this purpose.

Covering Tracks:

  • To avoid detection, clear logs and remove any traces of your activities. Tools like metasploit’s log clearing modules or manual log editing can be employed here.

Reporting:

  • After completing the test, generate a detailed report documenting all the steps, findings, and vulnerabilities discovered. Highlight the critical issues and provide recommendations for remediation.


Step 5: Post-Penetration Testing Activities

After the test, it’s crucial to restore any changes made during the test and ensure the target environment is secure. Here’s what to do:

Clean Up:

  • Remove any backdoors, tools, or artifacts left on the target system. Ensure that the system is in its original state.

Review Findings:

  • Review the results with the target organization (if applicable) and provide actionable insights to improve their security posture.

Continuous Learning:

  • Penetration testing is an evolving field. Stay updated with the latest tools, techniques, and vulnerabilities by following cybersecurity forums, attending conferences, and practicing regularly in environments like Hack The Box or TryHackMe.


Conclusion

Kali Linux is an indispensable tool for penetration testers, offering a robust platform with a wealth of tools to test and secure systems. By following the steps outlined in this guide, you can effectively utilize Kali Linux to conduct thorough and ethical penetration tests, helping to secure systems and networks against potential threats.

Remember, penetration testing should always be performed responsibly and within the legal boundaries set by the target organization. Happy testing!

]]>
https://michaeldewitt.com/2024/06/15/how-to-use-kali-linux-for-effective-penetration-testing/feed/ 0
How to Set Up Jenkins: A Step-by-Step Guide https://michaeldewitt.com/2024/04/07/how-to-set-up-jenkins-a-step-by-step-guide/ https://michaeldewitt.com/2024/04/07/how-to-set-up-jenkins-a-step-by-step-guide/#respond Sun, 07 Apr 2024 21:39:23 +0000 https://michaeldewitt.com/?p=656

Jenkins is a powerful open-source automation server that helps streamline the software development process by automating the build, testing, and deployment of applications. Setting up Jenkins for the first time might seem daunting, but with this step-by-step guide, you’ll have your Jenkins server up and running in no time.

Introduction

In today’s fast-paced development environment, automation is key to delivering high-quality software quickly. Jenkins, a leader in continuous integration and continuous delivery (CI/CD), is an essential tool for automating the parts of your development workflow. In this guide, we’ll walk you through the process of setting up Jenkins from scratch.

What You’ll Need

Before we dive into the setup, here’s what you’ll need:

  • A machine to install Jenkins on (this can be a local server, cloud server, or your personal computer)

  • Java Development Kit (JDK) installed (Jenkins requires Java to run)

  • Administrator access to the machine

Step 1: Install Java

Jenkins is a Java-based application, so the first step is to ensure that you have Java installed. If you already have Java installed, you can skip this step.

For Ubuntu/Debian:

sudo apt update
sudo apt install openjdk-11-jdk

For CentOS/RHEL:

sudo yum install java-11-openjdk-devel

For Windows:

  1. Download the JDK installer from the Oracle website.

  2. Run the installer and follow the on-screen instructions.

To verify the installation, open a terminal or command prompt and type:

java -version

This should display the installed Java version.

Step 2: Install Jenkins

With Java installed, you can now move on to installing Jenkins. Jenkins provides installation packages for various operating systems.

For Ubuntu/Debian:

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins

For CentOS/RHEL:

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
sudo yum install jenkins

For Windows:

  1. Download the Jenkins Windows installer from the official Jenkins website.

  2. Run the installer and follow the installation wizard.

Once Jenkins is installed, start the Jenkins service.

For Ubuntu/Debian:

sudo systemctl start jenkins
sudo systemctl enable jenkins

For CentOS/RHEL:

sudo systemctl start jenkins
sudo systemctl enable jenkins

For Windows:

Jenkins should start automatically after installation. If it doesn’t, you can start it manually through the Services panel.

Step 3: Access Jenkins

Now that Jenkins is running, you can access it via your web browser. By default, Jenkins runs on port 8080. Open your browser and go to:

http://localhost:8080

If you installed Jenkins on a remote server, replace localhost with the server’s IP address.

Step 4: Unlock Jenkins

The first time you access Jenkins, you’ll be asked to unlock it using an initial admin password. To find this password, follow these steps:

For Linux:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

For Windows:

  1. Navigate to C:\Program Files (x86)\Jenkins\secrets\.

  2. Open the initialAdminPassword file.

Copy the password and paste it into the Jenkins unlock page.

Step 5: Install Suggested Plugins

After unlocking Jenkins, you’ll be prompted to install plugins. Jenkins offers a variety of plugins to extend its functionality. It’s recommended to install the suggested plugins for a start.

  • Click on Install suggested plugins.

  • Jenkins will start downloading and installing the plugins. This may take a few minutes.

Step 6: Create an Admin User

Once the plugins are installed, you’ll be prompted to create your first admin user. Fill out the required fields:

  • Username

  • Password

  • Full Name

  • Email Address

Click Save and Continue when done.

Step 7: Configure the Jenkins URL

Next, you’ll need to configure the Jenkins URL. This is the URL where your Jenkins server can be accessed. Jenkins automatically detects the correct URL, but you can adjust it if necessary.

  • Verify the URL and click Save and Finish.

Step 8: Start Using Jenkins

Congratulations! Jenkins is now set up and ready to use. Click on Start using Jenkins to go to the Jenkins dashboard.

Step 9: Set Up Your First Job (Optional)

Now that Jenkins is up and running, you might want to set up your first job to get a feel for how Jenkins works.

  1. On the Jenkins dashboard, click on New Item.

  2. Enter a name for your job, select Freestyle project, and click OK.

  3. In the job configuration page, you can set up various build steps, source control integration, and post-build actions.

  4. Once configured, click Save and then Build Now to trigger the job.

Conclusion

Setting up Jenkins is the first step towards automating your software development pipeline. With Jenkins installed, you can now start exploring its powerful features and integrate it with other tools in your development ecosystem.

Jenkins is highly customizable, with hundreds of plugins available to tailor it to your specific needs. Whether you’re looking to automate your builds, run tests, or deploy your applications, Jenkins has got you covered.


Ready to take the next step? Check out our guide on creating CI/CD pipelines in Jenkins and start automating your workflow today!

]]>
https://michaeldewitt.com/2024/04/07/how-to-set-up-jenkins-a-step-by-step-guide/feed/ 0
How to Create CI/CD Pipelines in Jenkins: A Step-by-Step Guide https://michaeldewitt.com/2024/03/13/how-to-create-ci-cd-pipelines-in-jenkins-a-step-by-step-guide/ https://michaeldewitt.com/2024/03/13/how-to-create-ci-cd-pipelines-in-jenkins-a-step-by-step-guide/#respond Wed, 13 Mar 2024 22:00:00 +0000 https://michaeldewitt.com/?p=665

Continuous Integration and Continuous Delivery (CI/CD) pipelines are critical for automating and streamlining the software development process. Jenkins, as one of the most popular CI/CD tools, makes it easy to set up and manage these pipelines. In this guide, we’ll walk you through the process of creating a CI/CD pipeline in Jenkins, from start to finish.

Introduction

In today’s agile development environment, speed and reliability are crucial. CI/CD pipelines automate the integration, testing, and deployment of code changes, ensuring that your software is always in a releasable state. Jenkins is the tool of choice for many teams due to its flexibility, extensive plugin ecosystem, and ease of use. In this tutorial, we’ll show you how to create a Jenkins pipeline that can automate your build, test, and deployment processes.

What You’ll Need

Before we begin, make sure you have the following:

  • A running Jenkins server (if you haven’t set up Jenkins yet, follow our Jenkins setup guide)

  • Access to a version control system (e.g., GitHub, GitLab, Bitbucket)

  • A basic understanding of Jenkins pipelines and scripting

Step 1: Create a New Pipeline Project

Log in to Jenkins: Open your Jenkins dashboard by navigating to http://localhost:8080 or your server’s IP address.

Create a New Item: On the Jenkins dashboard, click on New Item.

Name Your Pipeline: Enter a name for your pipeline. Make sure it’s descriptive enough to identify the project.

Select Pipeline: Choose Pipeline from the list of item types and click OK.

Step 2: Configure the Pipeline

Once your pipeline project is created, you’ll need to configure it.

Define the Pipeline Script

Scroll Down to the Pipeline Section: In the project configuration page, scroll down to the Pipeline section.

Select Pipeline Script: You can define your pipeline in two ways:

  • Pipeline script: Write your pipeline script directly in the Jenkins UI.

  • Pipeline script from SCM: Pull your pipeline script from your version control system (recommended for larger projects).

For this tutorial, we’ll use the Pipeline script option.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Script Breakdown

  • Agent: Specifies where the pipeline will run. agent any means it can run on any available agent.

  • Stages: The pipeline is divided into stages, each representing a phase in the CI/CD process.

    • Checkout: Clones the repository from your version control system.

    • Build: Compiles the project.

    • Test: Runs automated tests and archives the results.

    • Deploy: Deploys the application.

  • Post: Contains actions that run at the end of the pipeline, such as cleaning up the workspace.

Step 3: Save and Build the Pipeline

Save Your Configuration: Once you’ve entered your pipeline script, click Save at the bottom of the configuration page.

Build the Pipeline: On your pipeline’s main page, click Build Now. Jenkins will run the pipeline as defined in your Jenkinsfile.

Step 4: Monitor the Pipeline

After triggering the build, Jenkins will execute each stage of your pipeline. You can monitor the progress and results from the Jenkins dashboard.

Blue Ocean (Optional)

For a more visual representation of your pipeline, Jenkins offers a plugin called Blue Ocean. It provides an intuitive interface for viewing and managing pipelines. To install and use Blue Ocean:

Install the Plugin: Go to Manage Jenkins > Manage Plugins. Search for Blue Ocean and install it.

Access Blue Ocean: Once installed, you can access Blue Ocean by clicking on the Open Blue Ocean link on the Jenkins dashboard.

Blue Ocean displays your pipeline stages in a visual pipeline view, making it easier to see what’s happening at each step.

Step 5: Automate Triggering the Pipeline

Jenkins allows you to automate the triggering of your pipeline based on various events, such as code commits or scheduled intervals.

Triggering on Git Commits

To trigger your pipeline every time a change is pushed to your Git repository:

Go to Project Configuration: Edit your pipeline project configuration.

Build Triggers Section: Scroll down to the Build Triggers section.

Enable Poll SCM: Check the Poll SCM option and enter a schedule using cron syntax (e.g., H/5 * * * * to poll every 5 minutes).

Webhook Integration: Alternatively, you can set up a webhook in your Git repository to notify Jenkins of changes instantly.

Scheduled Builds

If you prefer to run your pipeline at regular intervals:

Build Triggers Section: In the same Build Triggers section, enable the Build periodically option.

Set Schedule: Define a cron schedule for when the pipeline should run.

Step 6: Customize and Extend Your Pipeline

Once you have a basic pipeline set up, you can extend it to fit your specific needs:

  • Add More Stages: Introduce additional stages for linting, security checks, or deployment to different environments.

  • Parallel Execution: Run multiple stages in parallel to speed up the pipeline.

  • Notifications: Integrate Jenkins with Slack, email, or other communication tools to receive alerts on pipeline status.

  • Artifacts and Reports: Archive build artifacts and generate reports as part of your pipeline.

Conclusion

Creating a CI/CD pipeline in Jenkins is a powerful way to automate your software development process, ensuring that every change is integrated, tested, and deployed efficiently. With the steps outlined in this guide, you should be well on your way to setting up a robust CI/CD pipeline tailored to your project’s needs.

Jenkins’ flexibility allows for endless customization, making it a valuable tool in any DevOps toolkit. Whether you’re just starting or looking to optimize your existing processes, Jenkins can help you achieve faster and more reliable software delivery.

]]>
https://michaeldewitt.com/2024/03/13/how-to-create-ci-cd-pipelines-in-jenkins-a-step-by-step-guide/feed/ 0