This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
22. ? Hitachi, Ltd. 2017. All rights reserved.
3-5. ツール①: audit2allow
21
audit2allowコマンドで必要なアクセス権を表示
# ausearch -m AVC --start 10/27/16 16:30:00
--end 10/27/16 17:10:00 | audit2allow -a
#============= ftpd_t ==============
#!!!! This avc can be allowed using the boolean 'ftpd_full_access'
allow ftpd_t admin_home_t:file { create getattr lock open write };
#!!!! This avc can be allowed using the boolean 'ftpd_full_access'
allow ftpd_t self:capability dac_override;
簡易スイッチの
紹介
ポリシー変更の指針
コマンド:
ausearch -m AVC --start {日時} --end {日
時} | audit2allow -a
23. ? Hitachi, Ltd. 2017. All rights reserved.
3-6. ツール②: SETroubleShoot
22
SETroubleShoot:syslogに出力される
情報量がかなり多い。
audit2allowと併用がお勧め
Nov 20 10:16:29 nvm000806 setroubleshoot: SELinux is preventing vsftpd from getattr
access on the file /root/sebool_before-upgrade. For complete SELinux messages. run
sealert -l 6ea22166-be22-4603-9be9-3d71320799bc
Nov 20 10:16:29 nvm000806 python: SELinux is preventing vsftpd from getattr access on
the file /root/sebool_before-upgrade.#012#012 Plugin catchall_boolean (89.3
confidence) suggests ***#012#012If you want to determine whether
ftpd can login to local users and can read and write all files on the system, governed by
DAC.#012Then you must tell SELinux about this by enabling the 'ftpd_full_access'
boolean.#012You can read 'None' man page for more details.#012Do#012setsebool -P
ftpd_full_access 1#012#012 Plugin catchall (11.6 confidence) suggests
*#012#012If you believe that vsftpd should be allowed
getattr access on the sebool_before-upgrade file by default.#012Then you should report this
as a bug.#012You can generate a local policy module to allow this
access.#012Do#012allow this access for now by executing:#012# ausearch -c 'vsftpd' --
raw | audit2allow -M my-vsftpd#012# semodule -i my-vsftpd.pp#012
/var/log/messagesへの出力例
詳細表示用の
コマンド
24. ? Hitachi, Ltd. 2017. All rights reserved.
# sealert -l 6ea22166-be22-4603-9be9-3d71320799bc
SELinux is preventing vsftpd from getattr access on the file /root/sebool_before-upgrade.
Plugin catchall_boolean (89.3 confidence) suggests ***
If ftpd がローカルユーザーにログインでき、DAC により管理されているシステムにあるすべてのファイルを読み書きできるかどうか
を指定します。 がしたい
Then 'ftpd_full_access' boolean を有効にすることにより、 これを SELinux に伝える必要があります。
詳細情報については、'None' man ページをご覧下さい。
Do
setsebool -P ftpd_full_access 1
Plugin catchall (11.6 confidence) suggests *
If vsftpd に、 sebool_before-upgrade file の getattr アクセスがデフォルトで許可されるべきです。
Then バグとして報告してください。
ローカルのポリシーモジュールを生成すると、
このアクセスを許可することができます。
Do
allow this access for now by executing:
# ausearch -c 'vsftpd' --raw | audit2allow -M my-vsftpd
# semodule -i my-vsftpd.pp
Additional Information:
Source Context system_u:system_r:ftpd_t:s0-s0:c0.c1023
Target Context unconfined_u:object_r:admin_home_t:s0
Target Objects /root/sebool_before-upgrade [ file ]
Source vsftpd
Source Path vsftpd
Port <Unknown>
Host nvm000806
Source RPM Packages
Target RPM Packages
Policy RPM selinux-policy-3.13.1-102.el7.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name nvm000806
Platform Linux nvm000806 3.10.0-514.el7.x86_64 #1 SMP Wed
Oct 19 11:24:13 EDT 2016 x86_64 x86_64
Alert Count 5
First Seen 2017-08-02 11:44:09 JST
Last Seen 2017-11-20 10:16:24 JST
Local ID 6ea22166-be22-4603-9be9-3d71320799bc
Raw Audit Messages
type=AVC msg=audit(1511140584.25:22660): avc: denied { getattr } for pid=12505 comm="vsftpd" path="/root/sebool_before-upgrade" dev="dm-0"
ino=100663385 scontext=system_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file
3-7. ツール②: SETroubleShoot
23
詳細表示を実行