ソフトウェア開発キット(ソフトウェアかいはつキット、英語: Software Development Kit、SDK)は一般に、特定のソフトウェアパッケージ、ソフトウェアフレームワーク、ハードウェアプラットフォーム、コンピュータシステム、ゲーム機、オペレーティングシステムなどのためのアプリケーションを作成するためにソフトウェア技術者が使用する開発ツールのセットを意味する。
onePK の動作環境を俯瞰視すると、以下のように図示することが出来ます。C / Java / Python のいずかで書かれた onePK アプリケーションを実行すると onePK API プレゼンテーション層へ命令が伝わります。これが onePK API インフラストラクチャー層で各 OS ごとの命令に変換され、相手がどの OS であっても(サポート対象であれば)任意の命令が実行されることになるそうです。
onePK と Cisco ルータ間は前述の通り、TLS 方式で保護された通信が行われます。正式には公開 CA 局から発行された証明書を使うべきだと思いますが、今回はあくまで「検証」なので、Cisco ルータ自身で自己証明書を発行します。最初に show crypto pki certificates を実行し、既定の状態では証明書が無いことを確認しておきます。
12
R1# show crypto pki certificates
R1#
show onep status を実行して onePK の状態を確認しておきます。まだ何も設定していない為、トランスポートが「Transport: tls; Status: disabled」と、無効になっています。
1 2 3 4 5 6 7 8 91011121314151617181920212223
R1# show onep status
Status: enabled by: Container Installed
Version: 1.3.0
Transport: tls; Status: disabled
Transport: tipc; Status: running; Port: 15003
Session Max Limit: 10
CPU Interval: 0 seconds
CPU Falling Threshold: 0%
CPU Rising Threshold: 0%
History Buffer: Enabled
History Buffer Purge: Oldest
History Buffer Size: 32768 bytes
History Syslog: Disabled
History Archived Session: 0
History Max Archive: 16
Trace buffer debugging level is info
Service Set: Base State: Enabled Version 1.3.0
Service Set: Vty State: Disabled Version 0.1.0
Service Set: OneFW State: Disabled Version 0.1.0
Service Set: Mediatrace State: Disabled Version 1.0.0
Service Set: AdvancedRouting State: Disabled Version 1.0.0
R1(config)# onep
R1(config-onep)# transport type tls disable-remotecert-validation
show crypto pki certificates を確認すると、自己証明書(IOS-Self-Signed-Certificate)が発行されているのが分かります。
1 2 3 4 5 6 7 8 9101112131415
R1# show crypto pki certificates
Router Self-Signed Certificate
Status: Available
Certificate Serial Number (hex): 01
Certificate Usage: General Purpose
Issuer:
cn=IOS-Self-Signed-Certificate-3877283833
Subject:
Name: IOS-Self-Signed-Certificate-3877283833
cn=IOS-Self-Signed-Certificate-3877283833
Validity Date:
start date: 00:21:58 JST Dec 27 2014
end date: 09:00:00 JST Jan 1 2020
Associated Trustpoints: TP-self-signed-3877283833
Storage: nvram:IOS-Self-Sig#1.cer
show onep status を実行すると、トランスポートが TLS になっており、自己証明書を参照していることが分かります。
1 2 3 4 5 6 7 8 9101112131415161718192021222324
R1# show onep status
Status: enabled by: Config,Container Installed
Version: 1.3.0
Transport: tls; Status: running; Port: 15002; localcert: TP-self-signed-3877283833; client cert validation disabled
Certificate Fingerprint SHA1: 5C9BFCDE F106B9BB EA76AAE9 582A1B6B BBA9CD7D
Transport: tipc; Status: running; Port: 15003
Session Max Limit: 10
CPU Interval: 0 seconds
CPU Falling Threshold: 0%
CPU Rising Threshold: 0%
History Buffer: Enabled
History Buffer Purge: Oldest
History Buffer Size: 32768 bytes
History Syslog: Disabled
History Archived Session: 0
History Max Archive: 16
Trace buffer debugging level is info
Service Set: Base State: Enabled Version 1.3.0
Service Set: Vty State: Disabled Version 0.1.0
Service Set: OneFW State: Disabled Version 0.1.0
Service Set: Mediatrace State: Disabled Version 1.0.0
Service Set: AdvancedRouting State: Disabled Version 1.0.0
但し、このままでは自己証明書を利用することが出来ません。証明書には onePK 接続を受け付けるアドレスを埋め込む必要がある為です。よって、IOS 上で証明書を登録(enroll)し直します。「% Include an IP address in the subject name?」に yes と回答し、onePK 接続を受け付けるアドレスを入力し、enroll し直します。
12345
R1(config)# crypto pki enroll TP-self-signed-1978128535
% Include the router serial number in the subject name? [yes/no]: no
% Include an IP address in the subject name? [no]: yes
Enter Interface name or IP Address[]: 10.100.4.254
Generate Self Signed Router Certificate? [yes/no]: yes
再度、show crypto pki certificates を実行すると、今回は IP アドレスが追加登録されていることが分かります。
1 2 3 4 5 6 7 8 91011121314151617
R1# show crypto pki certificates
Router Self-Signed Certificate
Status: Available
Certificate Serial Number (hex): 01
Certificate Usage: General Purpose
Issuer:
ipaddress=192.168.253.22+hostname=R1.example.local
cn=IOS-Self-Signed-Certificate-3877283833
Subject:
Name: R1.example.local
IP Address: 192.168.253.22
ipaddress=192.168.253.22+hostname=R1.example.local
cn=IOS-Self-Signed-Certificate-3877283833
Validity Date:
start date: 00:54:07 JST Dec 27 2014
end date: 09:00:00 JST Jan 1 2020
Associated Trustpoints: TP-self-signed-3877283833