misp-modules/install/index.html

947 lines
33 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="MISP Modules Project">
<meta name="author" content="MISP Project">
<link rel="canonical" href="https://www.misp-project.org/install/">
<link rel="prev" href="../import_mod/">
<link rel="next" href="../contribute/">
<link rel="icon" href="../img/favicon.ico">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.45">
<title>Install Guides - MISP Modules Documentation</title>
<link rel="stylesheet" href="../assets/stylesheets/main.0253249f.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#install-from-pip" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="MISP Modules Documentation" class="md-header__button md-logo" aria-label="MISP Modules Documentation" data-md-component="logo">
<img src="../img/misp.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
MISP Modules Documentation
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Install Guides
</span>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/MISP/misp-modules/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
MISP/misp-modules
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="MISP Modules Documentation" class="md-nav__button md-logo" aria-label="MISP Modules Documentation" data-md-component="logo">
<img src="../img/misp.png" alt="logo">
</a>
MISP Modules Documentation
</label>
<div class="md-nav__source">
<a href="https://github.com/MISP/misp-modules/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
MISP/misp-modules
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Modules
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Modules
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../action_mod/" class="md-nav__link">
<span class="md-ellipsis">
Action Modules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../expansion/" class="md-nav__link">
<span class="md-ellipsis">
Expansion Modules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../export_mod/" class="md-nav__link">
<span class="md-ellipsis">
Export Modules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../import_mod/" class="md-nav__link">
<span class="md-ellipsis">
Import Modules
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Install Guides
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Install Guides
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#install-from-pip" class="md-nav__link">
<span class="md-ellipsis">
Install from pip
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#install-from-cloned-repository" class="md-nav__link">
<span class="md-ellipsis">
Install from cloned repository
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#install-the-systemd-unit" class="md-nav__link">
<span class="md-ellipsis">
Install the systemd unit
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#run-the-tests" class="md-nav__link">
<span class="md-ellipsis">
Run the tests
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#build-the-documentation" class="md-nav__link">
<span class="md-ellipsis">
Build the documentation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#run-misp-modules" class="md-nav__link">
<span class="md-ellipsis">
Run MISP modules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#run-misp-modules-in-docker" class="md-nav__link">
<span class="md-ellipsis">
Run MISP modules in Docker
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#install-misp-module-on-an-offline-instance" class="md-nav__link">
<span class="md-ellipsis">
Install misp-module on an offline instance
</span>
</a>
<nav class="md-nav" aria-label="Install misp-module on an offline instance">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#if-misp-modules-is-available-on-pypi" class="md-nav__link">
<span class="md-ellipsis">
If misp-modules is available on PyPI
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#if-misp-modules-is-not-available-on-pypi" class="md-nav__link">
<span class="md-ellipsis">
If misp-modules is not available on PyPI
</span>
</a>
<nav class="md-nav" aria-label="If misp-modules is not available on PyPI">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#using-poetry-bundle" class="md-nav__link">
<span class="md-ellipsis">
Using poetry bundle
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#using-poetry-export" class="md-nav__link">
<span class="md-ellipsis">
Using poetry export
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../contribute/" class="md-nav__link">
<span class="md-ellipsis">
Contribute
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
About
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
About
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../license/" class="md-nav__link">
<span class="md-ellipsis">
License
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#install-from-pip" class="md-nav__link">
<span class="md-ellipsis">
Install from pip
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#install-from-cloned-repository" class="md-nav__link">
<span class="md-ellipsis">
Install from cloned repository
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#install-the-systemd-unit" class="md-nav__link">
<span class="md-ellipsis">
Install the systemd unit
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#run-the-tests" class="md-nav__link">
<span class="md-ellipsis">
Run the tests
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#build-the-documentation" class="md-nav__link">
<span class="md-ellipsis">
Build the documentation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#run-misp-modules" class="md-nav__link">
<span class="md-ellipsis">
Run MISP modules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#run-misp-modules-in-docker" class="md-nav__link">
<span class="md-ellipsis">
Run MISP modules in Docker
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#install-misp-module-on-an-offline-instance" class="md-nav__link">
<span class="md-ellipsis">
Install misp-module on an offline instance
</span>
</a>
<nav class="md-nav" aria-label="Install misp-module on an offline instance">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#if-misp-modules-is-available-on-pypi" class="md-nav__link">
<span class="md-ellipsis">
If misp-modules is available on PyPI
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#if-misp-modules-is-not-available-on-pypi" class="md-nav__link">
<span class="md-ellipsis">
If misp-modules is not available on PyPI
</span>
</a>
<nav class="md-nav" aria-label="If misp-modules is not available on PyPI">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#using-poetry-bundle" class="md-nav__link">
<span class="md-ellipsis">
Using poetry bundle
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#using-poetry-export" class="md-nav__link">
<span class="md-ellipsis">
Using poetry export
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1>Install Guides</h1>
<h2 id="install-from-pip">Install from pip<a class="headerlink" href="#install-from-pip" title="Permanent link">&para;</a></h2>
<p>It is strongly recommended to use a virtual environment (see here for instructions <a href="https://docs.python.org/3/tutorial/venv.html">https://docs.python.org/3/tutorial/venv.html</a>).</p>
<p>Once the virtual environment is loaded just use the command:</p>
<div class="highlight"><pre><span></span><code>pip<span class="w"> </span>install<span class="w"> </span>misp-modules
</code></pre></div>
<p>Note that the dependencies will require a number of system packages installed. On Ubuntu these packages are <code>libpoppler-cpp-dev</code>, <code>libzbar0</code>, and <code>tesseract-ocr</code>. For an updated list, check the github action used to test the build inside <code>.github/workflows</code>.</p>
<p>Because PyPI does not support git for direct dependencies, the following packages will not be installed by default <code>otdreader</code>, <code>google-search-api</code>, <code>trustar</code>, <code>pydnstrails</code>, <code>pyonyphe</code>. You can either install them manually or let the modules depending on them gracefully fail.</p>
<div class="highlight"><pre><span></span><code>pip<span class="w"> </span>install<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>git+https://github.com/cartertemm/ODTReader.git<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>git+https://github.com/abenassi/Google-Search-API<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>git+https://github.com/SteveClement/trustar-python.git<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>git+https://github.com/sebdraven/pydnstrails.git<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>git+https://github.com/sebdraven/pyonyphe.git
</code></pre></div>
<p>You can now run <code>misp-modules</code> by invoking it (you might need to reload the virtual environment to update the search path used for executables).</p>
<div class="highlight"><pre><span></span><code>misp-modules
</code></pre></div>
<h2 id="install-from-cloned-repository">Install from cloned repository<a class="headerlink" href="#install-from-cloned-repository" title="Permanent link">&para;</a></h2>
<p>In this case the only requirement is to install <code>poetry</code>. Normally you just need to run <code>pip install poetry</code>, but see here for more alternatives <a href="https://python-poetry.org/docs/#installation">https://python-poetry.org/docs/#installation</a>.</p>
<p>Once <code>poetry</code> is installed, you can clone the repository and install <code>misp-modules</code> as follows:</p>
<div class="highlight"><pre><span></span><code>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/MISP/misp-modules.git<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">cd</span><span class="w"> </span>misp-modules
git<span class="w"> </span>submodule<span class="w"> </span>update<span class="w"> </span>--init
poetry<span class="w"> </span>install<span class="w"> </span>--with<span class="w"> </span>unstable
</code></pre></div>
<p>The switch <code>--with unstable</code> will also install dependencies available only on <code>git</code> repositories (which are manually installed when using pip).</p>
<p>Note that the dependencies will require a number of system packages installed. On Ubuntu these packages are <code>libpoppler-cpp-dev</code>, <code>libzbar0</code>, and <code>tesseract-ocr</code>. For an updated list, check the github action used to test the build inside <code>.github/workflows</code>.</p>
<h2 id="install-the-systemd-unit">Install the systemd unit<a class="headerlink" href="#install-the-systemd-unit" title="Permanent link">&para;</a></h2>
<p>To run <code>misp-modules</code> as a service on a distribution based on systemd, you need to create the unit as follows and store it in a file <code>/etc/systemd/system/misp-modules.service</code>:</p>
<div class="highlight"><pre><span></span><code><span class="o">[</span>Unit<span class="o">]</span>
<span class="nv">Description</span><span class="o">=</span>MISP<span class="w"> </span>modules
<span class="o">[</span>Service<span class="o">]</span>
<span class="nv">Type</span><span class="o">=</span>simple
<span class="nv">User</span><span class="o">=</span>apache
<span class="nv">Group</span><span class="o">=</span>apache
<span class="nv">ExecStart</span><span class="o">=</span>/path/to/venv/bin/misp-modules<span class="w"> </span>-l<span class="w"> </span><span class="m">127</span>.0.0.1<span class="w"> </span>-s
<span class="nv">Restart</span><span class="o">=</span>always
<span class="nv">RestartSec</span><span class="o">=</span><span class="m">10</span>
<span class="o">[</span>Install<span class="o">]</span>
<span class="nv">WantedBy</span><span class="o">=</span>multi-user.target
</code></pre></div>
<p>Then, enable the misp-modules service and start it:
<div class="highlight"><pre><span></span><code>systemctl<span class="w"> </span>daemon-reload
systemctl<span class="w"> </span><span class="nb">enable</span><span class="w"> </span>--now<span class="w"> </span>misp-modules
</code></pre></div></p>
<h2 id="run-the-tests">Run the tests<a class="headerlink" href="#run-the-tests" title="Permanent link">&para;</a></h2>
<p>To run tests you need to install misp-modules from the cloned repository, run the server, and then run the tests. You can do all these step with <code>poetry</code>.</p>
<div class="highlight"><pre><span></span><code>poetry<span class="w"> </span>install<span class="w"> </span>--with<span class="w"> </span>unstable
poetry<span class="w"> </span>run<span class="w"> </span>misp-modules
</code></pre></div>
<p>And in another terminal:</p>
<div class="highlight"><pre><span></span><code>poetry<span class="w"> </span>run<span class="w"> </span>pytest
</code></pre></div>
<h2 id="build-the-documentation">Build the documentation<a class="headerlink" href="#build-the-documentation" title="Permanent link">&para;</a></h2>
<p>To build the documentation you can use the provided <code>Makefile</code>.
Inside you will find three targets:</p>
<ul>
<li>
<p><code>generate_docs</code>: install the depdendency and generate the documentation.</p>
</li>
<li>
<p><code>generate_docs</code>: build the documentation using <code>mkdocs</code>.</p>
</li>
<li>
<p><code>deploy</code>: deploy the documentation using <code>mkdocs gh-deploy</code>.</p>
</li>
<li>
<p><code>test-docs</code>: run a local server exposing the newly built documentation.</p>
</li>
</ul>
<p>Note: you can either run the targets using <code>poetry</code> (default), or using the Docker image <code>squidfunk/mkdocs-material</code> by setting the environment variable <code>USE_DOCKER=true</code>.</p>
<h2 id="run-misp-modules">Run MISP modules<a class="headerlink" href="#run-misp-modules" title="Permanent link">&para;</a></h2>
<p>If you installed it using pip, you just need to execute the command <code>misp-modules</code> (source the virtual environment a second time to update the search paths). If you installed it from the cloned repository, just use poetry, i.e., <code>poetry run misp-modules</code>.</p>
<h2 id="run-misp-modules-in-docker">Run MISP modules in Docker<a class="headerlink" href="#run-misp-modules-in-docker" title="Permanent link">&para;</a></h2>
<p>You can find an up-to-date container image and related documentation at the following repository: <a href="https://github.com/MISP/misp-docker">https://github.com/MISP/misp-docker</a> .</p>
<h2 id="install-misp-module-on-an-offline-instance">Install misp-module on an offline instance<a class="headerlink" href="#install-misp-module-on-an-offline-instance" title="Permanent link">&para;</a></h2>
<h3 id="if-misp-modules-is-available-on-pypi">If <code>misp-modules</code> is available on PyPI<a class="headerlink" href="#if-misp-modules-is-available-on-pypi" title="Permanent link">&para;</a></h3>
<p>Once <code>misp-modules</code> is available on PyPI, you can just download all the necessary packages:</p>
<div class="highlight"><pre><span></span><code>mkdir<span class="w"> </span>wheels
pip<span class="w"> </span>wheel<span class="w"> </span>misp-modules<span class="w"> </span>--no-cache-dir<span class="w"> </span>-w<span class="w"> </span>./wheels
</code></pre></div>
<p>Move the <code>wheels</code> directory to the target system, and install them there:</p>
<div class="highlight"><pre><span></span><code>pip<span class="w"> </span>install<span class="w"> </span>--no-cache-dir<span class="w"> </span>--use-deprecated<span class="o">=</span>legacy-resolver<span class="w"> </span>/wheels/*.whl
</code></pre></div>
<p>Once again, using a virtual environment is recommended.</p>
<h3 id="if-misp-modules-is-not-available-on-pypi">If <code>misp-modules</code> is not available on PyPI<a class="headerlink" href="#if-misp-modules-is-not-available-on-pypi" title="Permanent link">&para;</a></h3>
<p>You have two choices, the first approach uses <code>poetry export</code> to export the entire virtual environment so you can copy and run it on the target system; the second one uses <code>poetry bundle</code> to export a <code>requirements.txt</code> file.</p>
<h4 id="using-poetry-bundle">Using <code>poetry bundle</code><a class="headerlink" href="#using-poetry-bundle" title="Permanent link">&para;</a></h4>
<p>This is quite straightforward but it assumes your target system is relatively similar (same distribution, architecture, libaries).</p>
<div class="highlight"><pre><span></span><code>poetry<span class="w"> </span>install<span class="w"> </span>--with<span class="w"> </span>unstable
poetry<span class="w"> </span>self<span class="w"> </span>add<span class="w"> </span>poetry-plugin-bundle
poetry<span class="w"> </span>bundle<span class="w"> </span>venv<span class="w"> </span>/destination/path/
</code></pre></div>
<h4 id="using-poetry-export">Using <code>poetry export</code><a class="headerlink" href="#using-poetry-export" title="Permanent link">&para;</a></h4>
<p>This is a bit more convoluted and it is similar to how you would install <code>misp-modules</code> on an offline instance.</p>
<p>Just follow those instructions but replace the package <code>misp-modules</code> with <code>-r requirements.txt</code>.</p>
<p>Before doing so you need to generate the <code>requirements.txt</code> file. Due to the fact we are still supporting Python 3.8 and that Poetry still has some limitations (soon to be resolved) you need to need to replace the line <code>python = "&gt;=3.8.*,&lt;3.13"</code> inside <code>pyproject.toml</code> with your exact version (just run <code>python --version</code>).</p>
<p>The following <code>sed</code> command does everything for you.</p>
<div class="highlight"><pre><span></span><code>sed<span class="w"> </span>-i<span class="w"> </span><span class="s2">&quot;s/^python = .*/python = \&quot;</span><span class="k">$(</span>python<span class="w"> </span>-c<span class="w"> </span><span class="s1">&#39;import platform; print(platform.python_version())&#39;</span><span class="k">)</span><span class="s2">\&quot;/&quot;</span><span class="w"> </span>pyproject.toml
</code></pre></div>
<p>Then, run the following commands to generate your very own <code>requirements.txt</code>.</p>
<div class="highlight"><pre><span></span><code>poetry<span class="w"> </span>lock
poetry<span class="w"> </span>self<span class="w"> </span>add<span class="w"> </span>poetry-plugin-export
poetry<span class="w"> </span><span class="nb">export</span><span class="w"> </span>--with<span class="w"> </span>unstable<span class="w"> </span>--without-hashes<span class="w"> </span>-f<span class="w"> </span>requirements.txt<span class="w"> </span>-o<span class="w"> </span>requirements.txt
</code></pre></div>
<p>Note that <code>misp-modules</code> will not be part of the <code>requirements.txt</code> file and you will need to create the wheel yourself:</p>
<div class="highlight"><pre><span></span><code>poetry<span class="w"> </span>build<span class="w"> </span>--output<span class="w"> </span>./wheels
</code></pre></div>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright &copy; 2019-2024 MISP Project
</div>
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
<div class="md-social">
<a href="https://twitter.com/MISPProject" target="_blank" rel="noopener" title="twitter.com" class="md-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253"/></svg>
</a>
<a href="https://github.com/MISP" target="_blank" rel="noopener" title="github.com" class="md-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1M480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2m-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3m-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../assets/javascripts/bundle.83f73b43.min.js"></script>
</body>
</html>