├── app ├── .gitkeep ├── views │ ├── .gitkeep │ └── dashboard │ │ ├── dashboard.html.tpl │ │ └── login.html.tpl ├── models │ ├── .gitkeep │ ├── nodes_membership.scm │ ├── nodes_group.scm │ └── node.scm ├── protocols │ └── .gitkeep └── controllers │ ├── .gitkeep │ └── dashboard.scm ├── conf ├── .gitkeep ├── README ├── plugins.scm └── artanis.conf ├── db ├── .gitkeep ├── sm │ └── .gitkeep └── migration │ └── .gitkeep ├── lib ├── .gitkeep └── chiba │ ├── utils.scm │ ├── linux.scm │ ├── rule-engine │ ├── utils.scm │ ├── action.scm │ └── config.scm │ ├── cli.scm │ ├── rule-engine.scm │ ├── bmc.scm │ └── redfish.scm ├── log └── .gitkeep ├── prv └── .gitkeep ├── pub ├── .gitkeep ├── css │ └── .gitkeep ├── img │ ├── .gitkeep │ ├── upload │ │ └── .gitkeep │ ├── SCL_Grammar.png │ ├── chiba-works.png │ └── chiba-arch.svg └── js │ └── .gitkeep ├── sys ├── .gitkeep ├── i18n │ ├── .gitkeep │ ├── json │ │ └── .gitkeep │ ├── po │ │ └── .gitkeep │ └── sxml │ │ └── .gitkeep └── pages │ └── .gitkeep ├── test ├── .gitkeep ├── unit │ └── .gitkeep ├── benchmark │ ├── .gitkeep │ └── README └── functional │ └── .gitkeep ├── tmp ├── .gitkeep └── cache │ ├── .gitkeep │ ├── README │ ├── migration │ └── .gitkeep │ └── route.cache ├── README ├── scripts └── run-openbmc-simulator.sh ├── ENTRY ├── docs ├── firmware-security-enhancement_jp.md ├── firmware-security-enhancement.md ├── scl.ebnf ├── install_jp.md ├── scl.md ├── install.md └── README_jp.md ├── .gitignore ├── README.md └── LICENSE /app/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /conf/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /conf/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /prv/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pub/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /app/views/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db/sm/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pub/css/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pub/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pub/js/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/i18n/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/pages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/cache/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/cache/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/protocols/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db/migration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pub/img/upload/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/i18n/json/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/i18n/po/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/i18n/sxml/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/benchmark/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/benchmark/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functional/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/cache/migration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pub/img/SCL_Grammar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardenedlinux/chiba/HEAD/pub/img/SCL_Grammar.png -------------------------------------------------------------------------------- /pub/img/chiba-works.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardenedlinux/chiba/HEAD/pub/img/chiba-works.png -------------------------------------------------------------------------------- /tmp/cache/route.cache: -------------------------------------------------------------------------------- 1 | ;; Do not touch anything!!! 2 | ;; All things here should be automatically handled properly!!! 3 | -------------------------------------------------------------------------------- /conf/plugins.scm: -------------------------------------------------------------------------------- 1 | ;; This is a plugin configuration file, don't remove it! 2 | 3 | ;; Uncomment following lines to enable plugins. 4 | ;; Make sure you import the plugin modules here. 5 | (define-module (conf plugins) 6 | #:use-module (artanis oht)) 7 | 8 | ;; (plugin-enable! name handler) 9 | -------------------------------------------------------------------------------- /scripts/run-openbmc-simulator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./qemu-system-arm -m 256 -M romulus-bmc -nographic \ 4 | -drive file=./obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd \ 5 | -net nic \ 6 | -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostfwd=udp:127.0.0.1:2623-:623,hostname=qemu 7 | -------------------------------------------------------------------------------- /ENTRY: -------------------------------------------------------------------------------- 1 | ;; This an Artanis ENTRY file, don't remove it! 2 | 3 | (use-modules (artanis artanis) 4 | ;; Put modules you want to be imported here 5 | ;; only for this file, not controllers/views 6 | 7 | (artanis utils)) 8 | ;; Put whatever you want to be called before server initilization here 9 | 10 | (init-server #:statics '(png gif jpg jpeg ico html js json csv xml css woff woff2 ttf)) 11 | (add-to-load-path (string-append (current-toplevel) "/lib")) 12 | ;; Put whatever you want to be called before server running here 13 | -------------------------------------------------------------------------------- /docs/firmware-security-enhancement_jp.md: -------------------------------------------------------------------------------- 1 | # ファームウェアセキュリティの強化 2 | 3 | ## なぜChibaにとってセキュリティが重要なのか? 4 | 5 | Chibaサーバーは中央管理サーバーであり、不正アクセスに対して敏感です。そのため、セキュリティ強化はChibaサーバーにとって非常に重要な機能です。 6 | 7 | さらに、各OpenBMCノードもセキュリティ強化が必要です。 8 | 9 | ## セキュリティ強化とは? 10 | 11 | セキュリティ強化には以下が含まれます: 12 | - ファームウェア 13 | - OSのランタイム保護 14 | - ネットワークセキュリティ 15 | - ユーザー認証 16 | - データ暗号化 17 | 18 | ## 「デフォルトでのセキュリティ」は難しい 19 | 20 | [ファームウェアベースのマルウェア](https://github.com/hardenedvault/bootkit-samples) 21 | 22 | [新しいLinuxカーネルのエクスプロイト手法](https://github.com/hardenedlinux/grsecurity-101-tutorials/blob/master/threat_model/slubstick.md) 23 | -------------------------------------------------------------------------------- /app/models/nodes_membership.scm: -------------------------------------------------------------------------------- 1 | (import (artanis mvc model) 2 | (chiba utils)) 3 | 4 | (export ) 5 | 6 | ;; Model nodes_membership definition of chiba 7 | ;; Please add your license header here. 8 | ;; This file is generated automatically by GNU Artanis. 9 | (create-artanis-model 10 | nodes_membership 11 | (:deps node group) 12 | (id auto (#:primary-key)) 13 | (node_id int (#:unsigned #:not-null)) ; 2^32 nodes, enough! 14 | (group_id int (#:unsigned #:not-null)) ; 2^32 memberships, enough? 15 | (valid boolean) ; set false to remove the node from group 16 | ); DO NOT REMOVE THIS LINE!!! 17 | -------------------------------------------------------------------------------- /app/models/nodes_group.scm: -------------------------------------------------------------------------------- 1 | (import (artanis mvc model) 2 | (chiba utils)) 3 | 4 | (export ) 5 | 6 | ;; Model nodes_group definition of chiba 7 | ;; Please add your license header here. 8 | ;; This file is generated automatically by GNU Artanis. 9 | 10 | (create-artanis-model 11 | nodes_group 12 | (:deps node) 13 | (id auto (#:primary-key)) 14 | (name char-field (#:maxlen 255 #:not-null)) 15 | (created_at bigint (#:unsigned #:not-null)) 16 | (modified_at bigint (#:unsigned #:not-null)) 17 | (valid boolean) ; set false to remove group 18 | (description longtext) ; necessary? 19 | ) ; DO NOT REMOVE THIS LINE!!! 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .tarball-version 2 | #* 3 | *.info 4 | *.pdf 5 | build.log 6 | build.err* 7 | #configure 8 | obj/* 9 | *.so 10 | *.o 11 | Makefile 12 | .deps 13 | .libs 14 | autom4te.cache 15 | config.h 16 | *.doc 17 | *.x 18 | *.lo 19 | *.la 20 | aclocal.m4 21 | depcomp 22 | missing 23 | mdate-sh 24 | texinfo.tex 25 | *~ 26 | ,* 27 | aclocal.m4 28 | config.build-subdirs 29 | config.cache 30 | config.status 31 | depcomp 32 | mdate-sh 33 | missing 34 | mkinstalldirs 35 | stamp-h1 36 | *.go 37 | cscope.out 38 | cscope.files 39 | *.log 40 | *.aux 41 | *.cp 42 | *.cps 43 | *.dvi 44 | *.fn 45 | *.fns 46 | *.ky 47 | *.pg 48 | *.toc 49 | *.tp 50 | *.vr 51 | *.tps 52 | *.vrs 53 | *.pgs 54 | *.rn 55 | *.rns 56 | *.scan 57 | *.am 58 | *.d 59 | ltmain.sh 60 | libtool 61 | *#*# 62 | doc/screaming-fist.t2p/ 63 | 64 | -------------------------------------------------------------------------------- /app/controllers/dashboard.scm: -------------------------------------------------------------------------------- 1 | ;; Controller dashboard definition of chiba 2 | ;; Please add your license header here. 3 | ;; This file is generated automatically by GNU Artanis. 4 | (define-artanis-controller dashboard) ; DO NOT REMOVE THIS LINE!!! 5 | 6 | (import (app models user) 7 | (web uri) 8 | (ice-9 match) 9 | (chiba utils)) 10 | 11 | (define (gen-login-page rc) 12 | (let ((failed (params rc "failed"))) 13 | (view-render "login" (the-environment)))) 14 | 15 | (dashboard-define 16 | "login" 17 | gen-login-page) 18 | 19 | (dashboard-define 20 | "logout" 21 | (options #:session #t) 22 | (lambda (rc) 23 | (:session rc 'drop) 24 | (rc-set-cookie rc) 25 | (redirect-to rc "/"))) 26 | 27 | (dashboard-define 28 | "/" 29 | (options #:with-auth gen-login-page) 30 | (lambda (rc) 31 | (view-render "dashboard" (the-environment)))) 32 | -------------------------------------------------------------------------------- /docs/firmware-security-enhancement.md: -------------------------------------------------------------------------------- 1 | # Firmware security enhancement 2 | 3 | [日本語](docs/firmware-security-enhancement_jp.md) 4 | 5 | ## Why security is important for Chiba? 6 | 7 | Because Chiba server is a central management server, which is sensitive to unauthorized access. The security enhancement is a critical feature for Chiba server. 8 | 9 | Nevertheless, each OpenBMC node also requires security enhancement. 10 | 11 | ## What are the security enhancements? 12 | 13 | The security enhancements include: 14 | - Firmware 15 | - OS runtime protection 16 | - Network security 17 | - User authentication 18 | - Data encryption 19 | 20 | ## "Security by default" is hard 21 | 22 | [Firmware based malware](https://github.com/hardenedvault/bootkit-samples) 23 | 24 | [Neo Linux kernel exploit method](https://github.com/hardenedlinux/grsecurity-101-tutorials/blob/master/threat_model/slubstick.md) 25 | -------------------------------------------------------------------------------- /app/views/dashboard/dashboard.html.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <@css dashboard.css %> 12 | <@js dashboard.js %> 13 | 14 | 15 | 16 |Welcome to the dashboard
21 |