apt firewall demo - michaelmworthington/codesamples GitHub Wiki

Introduction

This page walks through the steps to set up NXRM and a Ubuntu Docker container to test Apt Firewall using http://archive.ubuntu.com/ubuntu/

See the official docs at  https://help.sonatype.com/repomanager3/formats/apt-repositories

Table of Contents

Prerequisites

  • IQ Server installed and running
  • NXRM 3 installed and running and configured with the IQ Server
  • Docker for Mac installed and running

Step 1. Create a new Proxy Repository in NXRM

Use http://archive.ubuntu.com/ubuntu/ as the Remote URL. Set the distribution to "bionic"

Step 2. Enable Firewall for the New Proxy Repo

Step 3. Run the Docker Image in Interactive Mode

docker run -it --rm ubuntu:bionic

Step 4. Clear the default Apt sources and add the apt repo for NXRM

rm /etc/apt/sources.list
rm -f /var/lib/apt/lists/*
echo deb http://host.docker.internal:8083/nexus/repository/apt-ubuntu.com-proxy/ bionic main > /etc/apt/sources.list
apt-get update

Step 5. Use apt-get to Install a package

apt-get instal vim

Step 6. Browse the Proxy Repo

Step 7. Go to the Firewall Report

Repo List

IQ Server Report

Step 8. Test Quarantine

wget 1.19.4 has CVE-2019-5953 with CVSS 9.8, so you'll need to have Quarantine enabled in the capability you created in step 2 and Proxy=Fail in your Security-Critical policy in IQ Server

apt-get install wget

Console Output

Repo List

IQ Server Report

Step 9. Notes

The NXRM Tree View shows the Quarantined component:

You can reproduce the 403 - Quarantined error by clicking on the "Path" link: http://host.docker.internal:8083/nexus/repository/apt-ubuntu.com-proxy/pool/main/w/wget/wget_1.19.4-1ubuntu2_amd64.deb

You can view the component information panel (CIP) right in NXRM

Not supported

⚠️ **GitHub.com Fallback** ⚠️