Interface ModuleHost
interface ModuleHost {
binfmts?: { register(format: BinfmtSpec): () => void };
commands?: {
install(name: string, source: string): Promise<void>;
remove(name: string): Promise<void>;
};
fstypes?: () => FsTypes;
log: {
error(message: string): void;
info(message: string): void;
warn(message: string): void;
};
syscalls?: {
define(
name: string,
handler: (
call: SyscallCall,
...args: (string | number)[],
) => number | void | Promise<number | void>,
): () => void;
policy(
policy: (
call: { exe?: string; pid: number; syscall: string; uid: number },
) => boolean | void,
): () => void;
};
dmesg(line: string): void;
evaluate(source: string): Promise<unknown>;
keys(): Promise<TrustedKey[]>;
}
binfmts?: { register(format: BinfmtSpec): () => void };
commands?: {
install(name: string, source: string): Promise<void>;
remove(name: string): Promise<void>;
};
fstypes?: () => FsTypes;
log: {
error(message: string): void;
info(message: string): void;
warn(message: string): void;
};
syscalls?: {
define(
name: string,
handler: (
call: SyscallCall,
...args: (string | number)[],
) => number | void | Promise<number | void>,
): () => void;
policy(
policy: (
call: { exe?: string; pid: number; syscall: string; uid: number },
) => boolean | void,
): () => void;
};
dmesg(line: string): void;
evaluate(source: string): Promise<unknown>;
keys(): Promise<TrustedKey[]>;
}
Properties
Optionalbinfmts
binfmts?: { register(format: BinfmtSpec): () => void }
Optionalcommands
Optionalfstypes
log
log: {
error(message: string): void;
info(message: string): void;
warn(message: string): void;
}
error(message: string): void;
info(message: string): void;
warn(message: string): void;
}
Optionalsyscalls
syscalls?: {
define(
name: string,
handler: (
call: SyscallCall,
...args: (string | number)[],
) => number | void | Promise<number | void>,
): () => void;
policy(
policy: (
call: { exe?: string; pid: number; syscall: string; uid: number },
) => boolean | void,
): () => void;
}
define(
name: string,
handler: (
call: SyscallCall,
...args: (string | number)[],
) => number | void | Promise<number | void>,
): () => void;
policy(
policy: (
call: { exe?: string; pid: number; syscall: string; uid: number },
) => boolean | void,
): () => void;
}
Adds a syscall (the handler gets its caller already described) and returns the function that takes it away; throws if the name is taken
Methods
dmesg
-
Kernel log line (dmesg)
Parameters
- line: string
Returns void
evaluate
keys
-
The public keys in
/etc/modules-keys, read each time a module is checkedReturns Promise<TrustedKey[]>
The registry
mount -treads (seeModuleContext.filesystem)