Skip to content

Commit

Permalink
Merge branch 'master' into atomic-runner-service
Browse files Browse the repository at this point in the history
  • Loading branch information
clr2of8 authored Jun 19, 2024
2 parents 11e06f7 + ba84224 commit 15e10ce
Show file tree
Hide file tree
Showing 12 changed files with 609 additions and 588 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check-installation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Check installation
on: pull_request

jobs:
install-invoke:
name: Install Invoke-Atomic
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Lint
on: pull_request

jobs:
install-invoke:
name: Install Invoke-Atomic
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: publish-release
on:
push:
tags: [ 'v*.*.*' ]
tags: ['v*.*.*']
jobs:
publish-powershell-gallery:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- name: publishing
run: |
Install-Module -Name powershell-yaml -Force
Publish-Module -Path '.' -NuGetApiKey ${{ secrets.PGALLERY }}
shell: pwsh

build-docker-containers:
name: Build and Publish Containers
runs-on: ${{ matrix.os }}
Expand All @@ -41,13 +39,12 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker Build
run: |
docker build docker -f ${{ matrix.file }} -t ${{ matrix.tag }}
docker build docker -f ${{ matrix.file }} -t ${{ matrix.tag }}
docker build docker -f ${{ matrix.file }} -t ${{ matrix.latest }}
- name: Docker Push
run: |
docker push ${{ matrix.tag }}
docker push ${{ matrix.latest }}
publish-manfiest:
name: Publish Manifest
runs-on: ubuntu-latest
Expand Down Expand Up @@ -78,4 +75,3 @@ jobs:
run: |
docker manifest push redcanary/invoke-atomicredteam:${{ github.sha }}
docker manifest push redcanary/invoke-atomicredteam:latest
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: fix-byte-order-marker
- repo: https://github.com/google/yamlfmt
rev: "v0.11.0"
hooks:
- id: yamlfmt
2 changes: 1 addition & 1 deletion Invoke-AtomicRedTeam.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
} # End of PSData hashtable

} # End of PrivateData hashtable
}
}
110 changes: 55 additions & 55 deletions Private/AtomicClassSchema.ps1
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
class AtomicDependency {
[String] $description
[String] $prereq_command
[String] $get_prereq_command
}

class AtomicInputArgument {
[String] $description
[String] $type
[String] $default
}

class AtomicExecutorBase {
[String] $name
[Bool] $elevation_required

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.Name
}
}

class AtomicExecutorDefault : AtomicExecutorBase {
[String] $command
[String] $cleanup_command
}

class AtomicExecutorManual : AtomicExecutorBase {
[String] $steps
[String] $cleanup_command
}

class AtomicTest {
[String] $name
[String] $auto_generated_guid
[String] $description
[String[]] $supported_platforms
# I wish this didn't have to be a hashtable but I don't
# want to change the schema and introduce a breaking change.
[Hashtable] $input_arguments
[String] $dependency_executor_name
[AtomicDependency[]] $dependencies
[AtomicExecutorBase] $executor

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.name
}
}

class AtomicTechnique {
[String[]] $attack_technique
[String] $display_name
[AtomicTest[]] $atomic_tests
}
class AtomicDependency {
[String] $description
[String] $prereq_command
[String] $get_prereq_command
}

class AtomicInputArgument {
[String] $description
[String] $type
[String] $default
}

class AtomicExecutorBase {
[String] $name
[Bool] $elevation_required

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.Name
}
}

class AtomicExecutorDefault : AtomicExecutorBase {
[String] $command
[String] $cleanup_command
}

class AtomicExecutorManual : AtomicExecutorBase {
[String] $steps
[String] $cleanup_command
}

class AtomicTest {
[String] $name
[String] $auto_generated_guid
[String] $description
[String[]] $supported_platforms
# I wish this didn't have to be a hashtable but I don't
# want to change the schema and introduce a breaking change.
[Hashtable] $input_arguments
[String] $dependency_executor_name
[AtomicDependency[]] $dependencies
[AtomicExecutorBase] $executor

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.name
}
}

class AtomicTechnique {
[String[]] $attack_technique
[String] $display_name
[AtomicTest[]] $atomic_tests
}
1 change: 0 additions & 1 deletion Public/Get-PreferredIPAddress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ function Get-PreferredIPAddress($isWindows) {
return ''
}
}

2 changes: 1 addition & 1 deletion Public/Invoke-AtomicRunner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ function Invoke-AtomicRunner {
Rename-ThisComputer $tr $artConfig.basehostname

}
}
}
2 changes: 1 addition & 1 deletion Public/Invoke-KickoffAtomicRunner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ function LogRunnerMsg ($message) {
finally {
$mutex.ReleaseMutex()
}
}
}
Loading

0 comments on commit 15e10ce

Please sign in to comment.