Skip to content

Commit bd6f501

Browse files
committed
Use Porchetta-Industries/CrackMapExec to test Rust
The resyncgg/ripgen tool is no longer being installed on our Kali AMIs (cisagov/kali-packer), and CrackMapExec is the only other assessment tool we install that uses Rust.
1 parent 81e484d commit bd6f501

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

molecule/rust/converge.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,41 @@
22
- name: Converge
33
hosts: all
44
tasks:
5-
- name: Install resyncgg/ripgen
6-
# We do prepend the name of the role to the role variables, but
7-
# Molecule does its own role discovery with inconsistent naming.
8-
# This is the reason for the noqa below.
5+
# CrackMapExec itself requires that git be installed because some
6+
# of its Python dependencies are pulled directly via git.
7+
#
8+
# The following CrackMapExec dependencies require the specified
9+
# packages be installed:
10+
# * gssapi requires the krb5-config executable from the
11+
# libkrb5-dev package
12+
- name: Install CrackMapExec dependencies
13+
ansible.builtin.package:
14+
name:
15+
- git
16+
- libkrb5-dev
17+
18+
# We do prepend the name of the role to the role variables, but
19+
# Molecule does its own role discovery with inconsistent naming.
20+
# This is the reason for the noqa below.
21+
- name: Install Porchetta-Industries/CrackMapExec
922
ansible.builtin.include_role: # noqa var-naming[no-role-prefix]
1023
name: ansible-role-assessment-tool
24+
# The fact that CrackMapExec has Python dependencies that are
25+
# pulled directly via git means that this role cannot possibly
26+
# pass idempotence.
27+
tags:
28+
- molecule-idempotence-notest
1129
vars:
12-
assessment_tool_archive_src: https://github.com/resyncgg/ripgen/tarball/main
13-
assessment_tool_install_dir: /tools/ripgen
30+
assessment_tool_archive_src: >
31+
https://github.com/Porchetta-Industries/CrackMapExec/tarball/master
32+
# This is not a cargo project, although it requires a Rust
33+
# compiler.
34+
assessment_tool_cargo_build: false
35+
assessment_tool_install_dir: /tools/CrackMapExec
36+
assessment_tool_pip_packages:
37+
- .
38+
# Although this is a Python project, the dependency aardwolf
39+
# requires a Rust compiler to build its native code.
1440
assessment_tool_rust: true
1541
assessment_tool_unarchive_extra_opts:
1642
- --strip-components=1

molecule/rust/tests/test_rust.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Standard Python Libraries
44
import os
5-
import stat
65

76
# Third-Party Libraries
87
import pytest
@@ -16,7 +15,7 @@
1615
@pytest.mark.parametrize(
1716
"d",
1817
[
19-
"/tools/ripgen",
18+
"/tools/CrackMapExec",
2019
],
2120
)
2221
def test_directories(host, d):
@@ -37,17 +36,3 @@ def test_directories(host, d):
3736
def test_packages(host, pkg):
3837
"""Test that appropriate packages were installed."""
3938
assert host.package(pkg).is_installed
40-
41-
42-
@pytest.mark.parametrize(
43-
"path",
44-
[
45-
"/tools/ripgen/target/release/ripgen",
46-
],
47-
)
48-
def test_build_product(host, path):
49-
"""Test that the build product exists."""
50-
product = host.file(path)
51-
assert product.exists
52-
assert product.is_file
53-
assert product.mode | stat.S_IXUSR

0 commit comments

Comments
 (0)