Skip to content

Commit 8785ffe

Browse files
author
John Doe
committed
docs: Update README
1 parent 05b6aa8 commit 8785ffe

File tree

21 files changed

+41
-41
lines changed

21 files changed

+41
-41
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ When use commandline, `hakoniwa-run` will load a default policy configuration na
2626
[KISS-policy.toml] to ensure a minimal mount namespace created, use `--policy-file`
2727
to use your custom version.
2828

29-
```sh
29+
```console
3030
$ hakoniwa run --verbose -- /bin/bash
3131
[2022-08-21T09:14:11Z INFO hakoniwa::cli::run] Configuration: "KISS-policy.toml"
3232
[2022-08-21T09:14:11Z INFO hakoniwa::executor] Mount point: host_path: "/tmp/hakoniwa-EJemcsRL", container_path: "/"
@@ -121,13 +121,13 @@ More examples can be found in [hakoniwa/examples].
121121

122122
First, clone this repository and build the docker image:
123123

124-
```sh
124+
```console
125125
$ make prodcontainer
126126
```
127127

128128
Then, run `hakoniwa` command in the container:
129129

130-
```sh
130+
```console
131131
$ docker run --privileged --group-add keep-groups --rm -it hakoniwa-prodcontainer:latest hakoniwa run --verbose -- /bin/bash
132132
[2023-11-04T09:24:27Z INFO hakoniwa::cli::run] Configuration: "KISS-policy.toml"
133133
[2023-11-04T09:24:27Z INFO hakoniwa::executor] Mount point: host_path: "/tmp/hakoniwa-yBV2slf6", container_path: "/"

hakoniwa-cli/examples/apps-firefox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
## Firefox
55

6-
```sh
6+
```console
77
$ hakoniwa run --policy-file ./policy.toml -- /usr/bin/firefox
88
```

hakoniwa-cli/examples/apps-kde/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## KDE
55

6-
```sh
6+
```console
77
# KDE - Dolphin
88
$ hakoniwa run --policy-file ./policy.toml -- /usr/bin/dolphin
99

hakoniwa-cli/examples/apps-smplayer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
## SMPlayer
55

6-
```sh
6+
```console
77
$ hakoniwa run --policy-file ./policy.toml -- /usr/bin/smplayer
88
```

hakoniwa-cli/examples/apps-xorg/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Xorg
55

6-
```sh
6+
```console
77
# Xorg - xinput
88
$ hakoniwa run --policy-file ./policy.toml -- /usr/bin/xinput
99
⎡ Virtual core pointer id=2 [master pointer (3)]

hakoniwa-cli/examples/howto-seccomp-syscalls.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Start `audit` service:
77

8-
```sh
8+
```console
99
$ sudo systemctl start auditd
1010
```
1111

@@ -19,7 +19,7 @@ syscalls = []
1919

2020
Use `--verbose` flag to run the COMMAND:
2121

22-
```sh
22+
```console
2323
$ hakoniwa run --policy-file ./policy.toml --verbose -- echo
2424
...
2525
[2022-08-22T09:15:56Z INFO hakoniwa::executor] Seccomp: enabled (syscalls: 0):
@@ -30,7 +30,7 @@ $ hakoniwa run --policy-file ./policy.toml --verbose -- echo
3030

3131
Copy `sudo ausearch ...` and run it:
3232

33-
```sh
33+
```console
3434
$ sudo ausearch -ts 17:15:56 -m seccomp -i
3535
----
3636
type=SECCOMP msg=audit(08/22/2022 17:15:56.273:401) : auid=johndoe uid=johndoe gid=johndoe ses=1 pid=3443 comm=hakoniwa exe=/usr/bin/hakoniwa sig=SIG0 arch=x86_64 syscall=execve compat=0 ip=0x7fb5638f2d1b code=log
@@ -47,7 +47,7 @@ type=SECCOMP msg=audit(08/22/2022 17:15:56.273:470) : auid=johndoe uid=johndoe g
4747

4848
To summarize:
4949

50-
```sh
50+
```console
5151
$ sudo ausearch -ts 17:15:56 -m seccomp -i | awk -F " : " '{ print $2 }' | awk -F "[ =]" '{ print $20 }' | sort | uniq
5252
access
5353
arch_prctl

hakoniwa-cli/examples/howto-xorg-apps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ HOME = {{ os_env "HOME" }}
2424

2525
Then run:
2626

27-
```sh
27+
```console
2828
$ hakoniwa run --policy-file ./policy.toml -- /usr/bin/xterm
2929
```
3030

3131
If you get an error message `Authorization required, but no authorization
3232
protocol specified`. Try this to fix it:
3333

34-
```sh
34+
```console
3535
# To provide access to an application to the graphical server. Use `xhost -` to get things back to normal.
3636
$ xhost +
3737
```

hakoniwa-cli/examples/lang-c/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## GCC with static linking
55

6-
```sh
6+
```console
77
# Compile
88
$ hakoniwa run --setenv PATH=$PATH --work-dir . -- /usr/bin/gcc --static main.c -o main
99

hakoniwa-cli/examples/lang-cpp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## G++ with static linking
55

6-
```sh
6+
```console
77
# Compile
88
$ hakoniwa run --setenv PATH=$PATH --work-dir . -- /usr/bin/g++ --static main.cpp -o main
99

hakoniwa-cli/examples/lang-go/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Go
55

6-
```sh
6+
```console
77
# Compile
88
$ hakoniwa run --setenv HOME=/hako --setenv GOTMPDIR=/hako --work-dir . -- /usr/bin/go build main.go
99

hakoniwa-cli/examples/lang-java/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Java
55

6-
```sh
6+
```console
77
# Compile
88
$ hakoniwa run --work-dir . -- /usr/bin/javac main.java
99

hakoniwa-cli/examples/lang-python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Python3
55

6-
```sh
6+
```console
77
# Run
88
$ hakoniwa run --policy-file ./policy.toml --work-dir . -- /usr/bin/python3 main.py
99
Hello, World!

hakoniwa-cli/examples/lang-ruby/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Ruby
55

6-
```sh
6+
```console
77
# Run
88
$ hakoniwa run --policy-file ./policy.toml --work-dir . -- /usr/bin/ruby main.rb
99
Hello, World!

hakoniwa-cli/examples/lang-typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## TypeScript
55

6-
```sh
6+
```console
77
# Compile
88
$ hakoniwa run --work-dir . -- /usr/bin/tsc main.ts --outFile main.js
99

hakoniwa-cli/examples/seccomp-allowlist/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## allowlist mode
55

6-
```sh
6+
```console
77
$ hakoniwa run --policy-file ./policy.toml --verbose -- /usr/bin/echo "Hako!"
88
[2023-11-03T14:40:16Z INFO hakoniwa::cli::run] Configuration: "./policy.toml"
99
[2023-11-03T14:40:16Z INFO hakoniwa::executor] Mount point: host_path: "/tmp/hakoniwa-hyEJAvtS", container_path: "/"

hakoniwa-cli/examples/seccomp-audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## audit mode
55

6-
```sh
6+
```console
77
$ hakoniwa run --policy-file ./policy.toml --verbose -- /usr/bin/echo "Hako!"
88
[2023-11-03T14:38:35Z INFO hakoniwa::cli::run] Configuration: "./policy.toml"
99
[2023-11-03T14:38:35Z INFO hakoniwa::executor] Mount point: host_path: "/tmp/hakoniwa-NF6FOZOL", container_path: "/"

hakoniwa-cli/examples/seccomp-denylist/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## denylist mode
55

6-
```sh
6+
```console
77
# Wget
88
$ hakoniwa run --policy-file ./policy.toml --verbose -- wget example.com
99
[2023-11-03T14:54:20Z INFO hakoniwa::cli::run] Configuration: "./policy.toml"

hakoniwa-cli/examples/usage-command.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## sh
55

6-
```sh
6+
```console
77
$ hakoniwa run
88
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
99
bash: no job control in this shell
@@ -27,7 +27,7 @@ $
2727

2828
## ls
2929

30-
```sh
30+
```console
3131
$ hakoniwa run -- ls
3232
bin dev lib lib64 proc usr
3333

@@ -47,7 +47,7 @@ bin dev hako lib lib64 proc usr
4747

4848
## pwd
4949

50-
```sh
50+
```console
5151
$ hakoniwa run -- pwd
5252
/
5353

@@ -58,7 +58,7 @@ $ hakoniwa run --work-dir . -- pwd
5858

5959
## ps
6060

61-
```sh
61+
```console
6262
$ hakoniwa run -- ps aux
6363
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
6464
5001 1 0.0 0.0 6904 2104 ? R+ 05:32 0:00 ps aux
@@ -67,7 +67,7 @@ USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
6767

6868
## whoami
6969

70-
```sh
70+
```console
7171
$ hakoniwa run -- whoami
7272
whoami: cannot find name for user ID 5001: No such file or directory
7373

@@ -81,7 +81,7 @@ root
8181

8282
## hostname
8383

84-
```sh
84+
```console
8585
$ hakoniwa run -- hostname
8686
hakoniwa
8787

@@ -92,7 +92,7 @@ myhostname
9292

9393
## ping
9494

95-
```sh
95+
```console
9696
$ hakoniwa run --share-net --ro-bind /etc/resolv.conf -- ping example.com -c 3
9797
PING example.com(2606:2800:220:1:248:1893:25c8:1946 (2606:2800:220:1:248:1893:25c8:1946)) 56 data bytes
9898
64 bytes from 2606:2800:220:1:248:1893:25c8:1946 (2606:2800:220:1:248:1893:25c8:1946): icmp_seq=1 ttl=54 time=252 ms
@@ -107,7 +107,7 @@ rtt min/avg/max/mdev = 176.668/242.301/297.814/49.972 ms
107107

108108
## wget
109109

110-
```sh
110+
```console
111111
$ hakoniwa run --share-net --ro-bind /etc/resolv.conf --work-dir . -- wget example.com
112112
ERROR: could not open HSTS store. HSTS will be disabled.
113113
--2022-08-12 06:25:25-- http://example.com/
@@ -125,7 +125,7 @@ index.html 100%[===================================
125125

126126
## env
127127

128-
```sh
128+
```console
129129
$ hakoniwa run -- env
130130
TERM=xterm-256color
131131

hakoniwa-cli/examples/usage-limit.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Limit the maximum size of the COMMAND's virtual memory
77

8-
```sh
8+
```console
99
# 16MB
1010
$ hakoniwa run --limit-as 16000000 -- stress --vm 1 --vm-bytes 16M
1111
stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
@@ -21,7 +21,7 @@ stress: FAIL: [1] (452) failed run completed in 0s
2121

2222
Limit the maximum size of a core file in bytes that the COMMAND may dump
2323

24-
```sh
24+
```console
2525
# No core file
2626
$ hakoniwa run --limit-core 0 -- echo
2727
```
@@ -31,7 +31,7 @@ $ hakoniwa run --limit-core 0 -- echo
3131

3232
Limit the amount of CPU time that the COMMAND can consume, in seconds
3333

34-
```sh
34+
```console
3535
# Killed in 2s
3636
$ hakoniwa run --limit-cpu 2 -- stress -c 1
3737
stress: info: [1] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd
@@ -51,7 +51,7 @@ Fri Aug 12 09:17:09 AM UTC 2022
5151

5252
Limit the maximum size in bytes of files that the COMMAND may create
5353

54-
```sh
54+
```console
5555
# 2bytes
5656
$ hakoniwa run --limit-fsize 2 -- dd if=/dev/random of=output.txt count=1 bs=4
5757
dd: error writing 'output.txt': File too large
@@ -65,7 +65,7 @@ dd: error writing 'output.txt': File too large
6565

6666
Limit the maximum file descriptor number that can be opened by the COMMAND
6767

68-
```sh
68+
```console
6969
# 2
7070
$ hakoniwa run --limit-nofile 2 -- echo
7171
echo: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 24
@@ -76,7 +76,7 @@ echo: error while loading shared libraries: libc.so.6: cannot open shared object
7676

7777
Limit the amount of wall time that the COMMAND can consume, in seconds
7878

79-
```sh
79+
```console
8080
# Killed in 2s
8181
$ date; hakoniwa run --limit-walltime 2 -- sleep 5; date
8282
Fri Aug 12 09:17:40 AM UTC 2022

hakoniwa-cli/examples/usage-namespace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Retain the NETWORK namespace
77

8-
```sh
8+
```console
99
$ hakoniwa run -- ping 127.0.0.1 -c 3
1010
$ echo $?
1111
2
@@ -26,7 +26,7 @@ rtt min/avg/max/mdev = 0.068/0.074/0.080/0.005 ms
2626

2727
Retain the UTS namespace
2828

29-
```sh
29+
```console
3030
$ hakoniwa run -- hostname
3131
hakoniwa
3232

hakoniwa-cli/examples/usage-verbose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Use verbose output
77

8-
```sh
8+
```console
99
$ hakoniwa run --verbose -- echo "Hako!"
1010
[2022-08-21T10:17:39Z INFO hakoniwa::cli::run] Configuration: "KISS-policy.toml"
1111
[2022-08-21T10:17:39Z INFO hakoniwa::executor] Mount point: host_path: "/tmp/hakoniwa-s8wvt60l", container_path: "/"

0 commit comments

Comments
 (0)