Comments (1)
Hi,
I added an option to dump_policy_bpf tool to output the bpf filter as array initializer using standard Linux macros.
Example:
mypolicy.kafel:
ALLOW { read }
DEFAULT DENY
mypolicy.c
#include <linux/filter.h>
#include <linux/seccomp.h>
#include <stddef.h>
int main(int argc, char* argv[]) {
struct sock_filter policy[] = {
#include "mypolicy.kafel.h"
};
struct sock_fprog prog;
prog.len = sizeof(policy)/sizeof(policy[0]);
prog.filter = policy;
...
return 0;
}
Makefile:
.SUFFIXES: .kafel
%.kafel.h: %.kafel
$KAFEL_DIR/tools/dump_policy_bpf/dump_policy_bpf -c $< > $@
from kafel.
Related Issues (19)
- Support "#include" statements for general/shared policy files HOT 1
- no 'stat' at x86-64? HOT 2
- Bitwise OR seems to be missing HOT 1
- Support SECCOMP_RET_KILL_PROCESS action HOT 1
- Tests depend on system configuration, fail if SIGSYS dumps core HOT 1
- __X32_SYSCALL_BIT not checked HOT 2
- heap corruption HOT 2
- Reduce libkafel.so size
- Add a tag HOT 1
- member access operator HOT 3
- Incorrect PBF generation when `if` branch invalidates `else` location HOT 1
- segv in grow_errors_buffer HOT 1
- Fail to build dump_bpf_policy binary on x86 box HOT 1
- Using fields in structs HOT 1
- Release a new version HOT 1
- Missing syscalls from amd64 HOT 2
- Cant build under CentOS 7 HOT 5
- Support SECCOMP_RET_LOG action HOT 3
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 kafel.