Skip to content

Commit

Permalink
feat(attack1): add rule to detect nsenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarapuce committed Jan 5, 2024
1 parent 3408ae6 commit a19f96f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Release Rulesfile
on: push
name: Release Rulesfile for scenario 1
on:
push:
branches:
- feat/attack1

jobs:

Release-Rulesfile:
Expand All @@ -11,13 +15,13 @@ jobs:
packages: write

env:
RULESET_FILE: custom_falco_rules.yaml
RULESET_FILE: custom_rules1.yaml
# Used to setup Auth and OCI artifact location
OCI_REGISTRY: ghcr.io
# Assuming we are in the main branch, our OCI artifact will
# look something like ghcr.io/user/repo/custom-rules:main
OCI_ARTIFACT_NAME: custom-rules
OCI_ARTIFACT_VERSION: ${{ github.ref_name }}
OCI_ARTIFACT_VERSION: attack1

steps:
- name: Checkout Falcoctl Repo
Expand Down
2 changes: 0 additions & 2 deletions custom_falco_rules.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions custom_rules1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- macro: container
condition: container.id != host

- macro: spawned_process
condition: evt.type = execve and evt.dir=<

- rule: run_nsenter
desc: nsenter is executed in a container
condition: container and proc.name = nsenter and spawned_process and proc.pname exists and not proc.pname in (bash, docker)
output: "nsenter used in container (user=%user.name container_id=%container.id container_name=%container.name shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline)"
priority: WARNING

0 comments on commit a19f96f

Please sign in to comment.