Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Fix openat. #201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions integration_test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PORT="${PORT-9123}"
BASEDIR="${BASEDIR-/tmp}"
SKIP_CLEANUP="${SKIP_CLEANUP}"
SANITIZE="${SANITIZE}"
PCAP_URL="ftp://ftp.ll.mit.edu/outgoing/darpa/data/2000/LLS_DDOS_1.0/data_and_labeling/tcpdump_inside/LLS_DDOS_1.0-inside.dump.gz"

set -e
cd $(dirname $0)
Expand All @@ -27,9 +28,7 @@ source ../lib.sh
function PullDownTestData {
if [ ! -f $BASEDIR/steno_integration_test.pcap ]; then
Info "Pulling down pcap data"
# Test data pulled from
# http://www.ll.mit.edu/mission/communications/cyber/CSTcorpora/ideval/data/2000/LLS_DDOS_1.0.html
curl -L 'http://www.ll.mit.edu/mission/communications/cyber/CSTcorpora/ideval/data/2000/LLS_DDOS_1.0/data_and_labeling/tcpdump_inside/LLS_DDOS_1.0-inside.dump.gz' > $BASEDIR/steno_integration_test.pcap.gz
curl -L "$PCAP_URL" > $BASEDIR/steno_integration_test.pcap.gz
gunzip $BASEDIR/steno_integration_test.pcap.gz
fi
}
Expand Down
5 changes: 5 additions & 0 deletions stenotype/stenotype.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ void DropPacketThreadPrivileges() {
ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 2,
SCMP_A1(SCMP_CMP_EQ, O_WRONLY | O_CREAT | O_DSYNC | O_DIRECT),
SCMP_A2(SCMP_CMP_EQ, 0600));
SECCOMP_RULE_ADD(
ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 3,
SCMP_A0(SCMP_CMP_EQ, AT_FDCWD),
SCMP_A2(SCMP_CMP_EQ, O_WRONLY | O_CREAT | O_DSYNC | O_DIRECT),
SCMP_A3(SCMP_CMP_EQ, 0600));
SECCOMP_RULE_ADD(ctx, SCMP_ACT_ALLOW, SCMP_SYS(getsockopt), 0);
SECCOMP_RULE_ADD(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rename), 0);
#ifdef TESTIMONY
Expand Down