πŸ–₯️
Dev Bible
  • Getting Started
    • πŸ‘‹Introduction
    • πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§Meet The Team
    • πŸŽ‰Setting Up Your Workspace
    • πŸ‘¨β€πŸŽ“Recommended Courses
    • πŸͺ΄Environments
    • 🎯Coding Best Practices
    • πŸ‘©β€πŸ’»Awesome AWS
    • 🐍Awesome Python
  • Security
    • πŸ§˜β€β™‚οΈZen of Security
    • πŸ’‘Man in the Middle (MITM) Attacks
    • 🧰Cryptographic Tools
      • πŸ•ΆοΈSSH KeyGen and Agent
      • πŸ₯·GNU Privacy Guard (gpg)
    • πŸ•΅οΈAuthentication
      • πŸ–₯️EC2
      • πŸ‘ΎGitHub
    • 🎟️Authorization
      • πŸ¦Έβ€β™‚οΈSingle Sign-On
      • πŸ†”Identity and Access Management
    • πŸ”Tamper Resistance
      • πŸ“Git Commits
    • πŸ“šReference Materials
  • Consulting
    • ✨Event-Driven Architecture
      • πŸŒ„Day 1
      • πŸŒ…Day 2
    • πŸ“šReference Materials
    • πŸ“₯/tmp
Powered by GitBook
On this page
  • Authentication (Not Authorization)
  • Tamper Detection with Cryptographic Signatures
  • Public Key Infrastructure (PKI)
  • Fingerprints and Public Keys
  1. Security

Man in the Middle (MITM) Attacks

Understanding MITM Attacks and how to prevent them.

PreviousZen of SecurityNextCryptographic Tools

Last updated 11 months ago

Broadly speaking, defense against MITM attacks is rooted in Authentication and Tamper detection.

  • Authentication: How can we verify the user accessing a resource is the user intended to have permissions on that resource?

  • Temper Detection: How can we detect when the data we access has been altered by an unauthorized actor?

Below shows how MITM attacks can work, and Mallory is up to no good.

Simply put, authentication is the process of verifying who someone is, whereas authorization is the process of verifying what specific applications, files, and data a user has access to.

The default behavior of most connections is to only authenticate the server. Lack of mutual authentication exposes the system to MITM attacks.

Alright, let's take a look at how to use this knowledge next.

Cryptographic signatures allow authors to sign their work so that users can verify that the source code has not been modified since it was packaged. Authors should work to make their public credentials readily accessible so consumers can securely download signed and untampered data.

Public Key Infrastructure (PKI)

A PKI binds public keys to public identities.

Public key infrastructure (ie Transport Layer Security) allows signatures between clients and servers via certificates. A trusted third-party Certificate Authority (CA) issues and verifies the certificates.

From Wikipedia:

PKI is a big topic, but the major takeaway here is a system where public signatures (keys) are linked to public identities. This system works to resolve vulnerabilities in authentication and tamper detection.

Fingerprints and Public Keys

Both keys in the private/public key pair are capable of generating the exact same fingerprint.

A fingerprint is just a short version of a public key. This makes for a convenient way to identify keys.

Compare the example public key and fingerprint from that key:

# public key
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEdTcR5uS1hg8ZzTuQDcm+rSewDgYBzmddJFRq3cOrVY kshultz@permitzip.com

# fingerprint
SHA256:6dvH2tSNL6vDYVSkDyWdTM8v6K+23WHSSkwLUTYLtZQ

(Not Authorization)

(sited from )

The authentication process may vary depending on the level of security required for a specific use case. We use public/private key pairs during the SSH authentication process to access our git repositories as well as our EC2 instances. The tools in Linux are used for these purposes.

is a way to securely access resources through cryptographic private/public key pairs for authorization into a secure shell connection.

We connect to our through SSH.

We connect to through SSH (mandatory SSH enforced).

Tamper Detection with

Gadget Engineering requires all . Unsigned commits will be rejected from all pull requests.

A public key infrastructure (PKI) is a set of roles, policies, hardware, software, and procedures needed to create, manage, distribute, use, store and revoke and manage ...

In , a PKI is an arrangement that binds** **public keys with respective identities of entities (like people and organizations).

Fingerprints and public keys are very similar in that they are public ways to verify, sign, or authenticate. Fingerprints and public keys are like digital ID cards (GitHub publishes theirs ).

πŸ’‘
Authentication
SailPoint
ssh-keygen and ssh-agent
Secure Shell (SSH)
EC2 instances
Git repositories
Cryptographic Signatures
commits to be signed using gpg keys
digital certificates
public-key encryption
cryptography
here
Mallory with No Chill
Schematic Public Key Infrastructure