Comments (3)
Currently decision of payloads are done in following way:
We decide if payloads are enabled via :
- at least single protocol definition in scope configuration file used protocol definition mechanism
or - payloads are enabled see e.g.: SCOPE_PAYLOAD_ENABLE)
The decision where to put payloads are done in following way (if payloads are enabled via above):
- if cribl is enabled and
SCOPE_PAYLOAD_TO_DISK
environment variable is not set totrue
we will send the payloads via cribl transport channel (via event transport channel) - if cribl is enabled and
SCOPE_PAYLOAD_TO_DISK
environment variable is set totrue
we will send the payloads to disk - if cribl is not enabled we will send the payloads to disk
I need to modify mechanism above.
Initial support is done in #1595.
Proposal (waiting for feedback):
This will set payload to event channel:
scope run --payloads -e tcp://localhost:9999 run -- nc -lp 10001
This will set payload to disk:
SCOPE_PAYLOAD_TO_DISK=true scope run --payloads -e tcp://localhost:9999 run -- nc -lp 10001
My doubts are if we should introduced another env variable configruation option since event channel is enabled by default there therefore it requried to often use SCOPE_PAYLOAD_TO_DISK=true
in case of saving payloads on disk
from appscope.
TODO:
- add support for payloaddest in cli arguments
- extend the payload configuration in
scope.yml
with destinanation file/event
from appscope.
I have modified my solution to following model:
This will set payload to disk:
scope run --payloads -e tcp://localhost:9999 -- nc -lp 10001
This will set payload to event transport type:
scope run --payloads --payloadsdest="event" -e tcp://localhost:9999 -- nc -lp 10001
# Alternatively You can use
SCOPE_PAYLOAD_DEST=event scope run --payloads -e tcp://localhost:9999 -- nc -lp 10001
This will set payload to cribl transport type:
scope run --payloads --payloadsdest="event" -c tcp://localhost:9999 -- nc -lp 10001
# Alternatively You can use
SCOPE_PAYLOAD_DEST=event scope run --payloads -c tcp://localhost:9999 -- nc -lp 10001
The payloads destination can be modified in the configuration file as well:
# Settings for the `payloads` feature
#
payload:
# Enable payload capture
# Type: boolean
# Values: true, false
# Default: false
# Override: $SCOPE_PAYLOAD_ENABLE
#
# This can produce large amounts of data from I/O-intensive programs and
# should be considered carefully before being enabled.
#
# See `protocol` for a way to enable this for specific protocols instead of
# all traffic.
#
enable: false
# Determine the payload type destination
# Type: string
# Values: "dir", "event"
# Default: "dir"
# Override: $SCOPE_PAYLOAD_DEST
#
#
# This allows to specify the payload destination
# - "event" allows to send the payloads to same location as events
# - "dir" allows to use directory to store payload files
#
type: "dir"
# Directory for payload files
# Type: string
# Values: (directory path)
# Default: /tmp
# Override: $SCOPE_PAYLOAD_DIR
#
# Consider using a performant filesystem to reduce I/O performance impacts.
#
# Applies when dest is "dir".
#
dir: '/tmp'
Important
The change which is worth to get feedback:
This will set payload to disk:
scope run --payloads -c tcp://localhost:9999 -- nc -lp 10001
While previously the payloads were sended to events (cribl) in this case
WIth current changes the following commands will send payloads to cribl:
scope run --payloads -c tcp://localhost:9999 --payloadsdest="event" -- nc -lp 10001
SCOPE_PAYLOAD_DEST=event scope run --payloads -c tcp://localhost:9999 -- nc -lp 10001
from appscope.
Related Issues (20)
- Mount the socket dir not the socket file
- ld.so.preload and scope in the PATH HOT 1
- Go build error with ld.so.preload enabled HOT 2
- top on Fedora error HOT 1
- Config is not getting set correctly in rules file or in attach when using filter --add HOT 6
- scope attach --inspect <pid> from container to host can return error when successful HOT 1
- Warning when scoping an an application that has the s bit set
- Use symbolic link to avoid two appscope libraries in one process
- [Bug]: Missing payload (request) using `host` app HOT 1
- Timeouts seen with appscope/edge integration HOT 2
- DNS tunelling/exfiltration POC HOT 3
- File system obfuscation
- LD_PRELOAD is not set in some cases when exec'ing into a container that was started after a scope rule was added
- Unable to exec into container after re-adding a scope rule HOT 4
- Connection Graph HOT 1
- [Bug]: Sending payloads with cribl/event transport type - inconsistency with channel type
- Memory Snapshot on Command HOT 1
- Attempt to mount non-existent directory from host into container HOT 2
- Updates needed to CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appscope.