最新 追記

雑記帳


2015-09-11 (Fri) [長年日記]

[OSX] System Integrity Protectionを無効にする方法

自分はDvorak配列を使っている関係で、ローマ字カナ変換の時に、カ行の文字を入力する際には、k[aiueo]と入力するのではなく、c[aiueo]と入力している。ことえりでは、ローマ字変換テーブルを変更するためには、/System/Library/Input Methods/JapaneseIM.app/Contents/Resources/RomajiRule_Default.txtを書き換えないといけない。

しかし、OSX 10.11(El Capitan)から、システムボリュームに対して、root権限でも書き込みができなくなった。(参照)。そのため、ことえりのローマ字変換テーブルを、普通の方法では書き換えることができなくなってしまった。

ではどうするのかというと、System Integrity Protectionを無効にして書き換えればよい。System Integrity Protectionを無効にするには、csrutilを使う。

% csrutil
usage: csrutil <command>
Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.
Available commands:

    clear
        Clear the existing configuration. Only available in Recovery OS.
    disable
        Disable the protection on the machine. Only available in Recovery OS.
    enable
        Enable the protection on the machine. Only available in Recovery OS.
    status
        Display the current configuration.

    netboot
        add <address>
            Insert a new IPv4 address in the list of allowed NetBoot sources.
        list
            Print the list of allowed NetBoot sources.
        remove <address>
            Remove an IPv4 address from the list of allowed NetBoot sources.

しかし、単に実行しても無効にすることはできない。

% sudo csrutil disable
csrutil: failed to modify system integrity configuration. This tool needs to be executed from the Recovery OS.

Recovery OSでなければならない。ということで、OSX起動時に、Command + Rを押しっぱなしにして、Recovery OSを起動する。そのあと、Terminalを起動して、csrutil disableを実行すればよい。

その状態で、当該ファイルを書き換えれることができる。ことえりのローマ字変換テーブルを、事前に準備しておき、コピーすればよい。

これでようやく、El Capitanのライブ変換を、いつものキー配列で使うことができるようになった。


2015-09-15 (Tue) [長年日記]

[AWS][Ruby] ELBで使っているSSL証明書の署名アルゴリズムをチェックする

SSL証明書の署名アルゴリズムとして使われているSHA-1については、すでに安全ではないということで、利用しないように対応が進められている。

サービスをAWSで提供している場合に、ELBで使用している証明書の署名アルゴリズムに何が使われているのかが知りたかったため、ツールを作った。

https://github.com/muramasa64/cecha

gemを使ってインストールできる。

$ gem install cecha

対象となるAWSアカウントのprofileがすでにある場合は、下記のようにする。

$ cecha list --profile your_profile --region ap-northeast-1

すると、下記のような出力が得られる(列はタブで区切られている)。

012345678901	ap-northeast-1	dev-elb	443	dev.example.com	sha1WithRSAEncryption
012345678901	ap-northeast-1	prod-elb	443	prod.example.com	sha256WithRSAEncryption

出力される項目は、AWSアカウント番号、リージョン、ELB名、ELBポート、証明書名、署名アルゴリズムである。

この場合、一行目に出力されているdev-elbで使われている証明書の署名アルゴリズムが、SHA-1を使っていることがわかる。このような場合には、証明書を更新する必要があるだろう。