HDE BLOG

コードもサーバも、雲の上

28th Monthly Technical Session (MTS) Report

28th Monthly Technical Session (MTS) was held on November 18th. MTS is a knowledge sharing event, in which HDE members present some topics and have QA sessions, both in English.

f:id:bagus-rahman:20161128101126j:plain

The moderator of 28th MTS was Bagus.

f:id:bagus-rahman:20161128101348j:plain

The first topic was a workshop of an HDE service, by Hayashi-san. He began by explaining what the service is and the motivation behind its development. So that other members can help test the service, Hayashi-san demonstrated how to install and use the service. He also explained how to uninstall the service. To close the presentation, Hayashi-san asked the audience to contact him if they find some problems in the service or if they have some ideas about improving the service.

f:id:bagus-rahman:20161128102747j:plain

The second topic was a comparison between Amazon Simple Email Service (SES) and an HDE service, by Okubo-san. According to his observation, SES and the HDE service differs in several aspects, which are verifying from addresses, sending emails, moving out of sandbox, handling bounced emails, and suppression list. Okubo-san concluded that SES is a good framework for transactional emails. On the other hand, the HDE service is not a framework, but it's able to send various types of emails.

f:id:bagus-rahman:20161128104330j:plain

The third topic was the logging and monitoring aspect of an HDE Service, by Jeffrey-san. This was a continuation of his presentation in the 25th MTS. Jeffrey-san began by explaining the logging approach that is used in his project. He spent more time explaining monitoring, because there are some issues related to it that he had to resolve. He described each issue and its solutions in detail. Because there was still time, he ended the presentation by explaining an automated task related to monitoring.

f:id:bagus-rahman:20161128115413j:plain

The fourth topic was task automation using Microsoft Azure, by Imaizumi-san. The tasks he intended to automate are the ones related to deploying HDE One services. Imaizumi-san began by explaining the motivation behind implementing this solution. He then showed the system architecture and demonstrated how the solution would work. He ended the presentation by explaining the relationship of his solution with other deployment task automation solutions in HDE.

f:id:bagus-rahman:20161128123123j:plain

The fifth topic was the internals of an HDE service, by Tanabe-san. Because there were lots of technical details to be explained, this presentation was longer than the others. Tanabe-san began by comparing this service with its predecessor. He then introduced the members of the project, and explained what each of the members is working on. He continued by explaining the system architecture and key concepts of the design process. Then, he explained each component of the system in detail. After that, he talked about release, deployment, and monitoring of the service. He ended the presentation by addressing lessons learned and future works.

f:id:bagus-rahman:20161128125123j:plain

The sixth topic was 'Genetics 2.0' by Alice-san. She is one of our current Global Internship Program (GIP) participants. Alice-san has an undergraduate degree in biomedical science and has 4 years worth of work experience in the field of molecular biology. She talked about applications of computer science in genetics. First, there is Cello, with which users can generate DNA sequences that describe logic functions for control of gene expression in bacteria. Second, machine learning is sometimes used in researches, such as to model gene/protein interactions and identify genetic risk factors.

f:id:bagus-rahman:20161128142734j:plain

The last topic was 'Wrap those Naked Variables for Good' by David-san. He is the other one of our current GIP participants. Naked values are values that may sometimes be null. These values are quite troublesome, because functions may not tell that they return such values, they cause Null Pointer Exceptions, and they make codes full of if not null statements. David-san explained a pattern that helps handling this, which is Maybe Box. It tells us that a function might return a value. Just(a) is a box containing a value, while Nothing is an empty box. To handle both cases, we can use map. With this, functions will only be applied to Just(a), never to Nothing.

f:id:bagus-rahman:20161128161023p:plain

As usual, we had a party afterwards.

f:id:bagus-rahman:20161128160631j:plain

DMARCとは

こんにちは。メール配信担当の大久保です。

先日、社内の技術勉強会で、なりすましメールを防ぐための技術 DMARC についてお話させて頂きました。 今回はこの話をまとめてブログ記事にしたいと思います。

DMARC とは

DMARC(Domain-based Message Authentication, Reporting & Conformance)は、 送信ドメイン認証技術であるSPFとDKIMをもちいてなりすましメールの判定を行います。 メール受信者がなりすましメールを受信した場合に、これをドメイン所有者に通知する仕組みと、 なりすましメールをどのように取り扱うべきかをドメイン所有者が宣言する仕組みを提供します。

DMARCは主に2つの機能をメール送信者に提供します。

レポート

メール送信者は、メール受信者から2種類のレポートをもらうことができます。

  • Aggregate Reports : メール送信者のドメインから受信したメール数と認証結果のサマリーレポートです。

  • Failure Reports : 送信ドメイン認証が失敗した場合、リアルタイムに報告されます。 送信IPや、メッセージIDなど認証に失敗したメールを調査するために必要な情報が含まれます。

ポリシー

メール送信者は、SPFとDKIMを用いて自身が送信したメールをメール受信者に認証してもらいます。 認証に失敗した場合、メールをどのように取り扱ってほしいかを3つのポリシーのいずれかで宣言することができます。

  • none : 何もしない。

  • quarantine : 隔離する(迷惑メールフォルダに入れる)。

  • reject : 受信しない(SMTPエラーとする)。

どのように導入するのか

企業ドメインでは複数のシステムからメールを送信していることが考えられ、 送信ドメイン認証に未対応のシステムがあったり、 DKIMキーやSPFが適切に公開されていないなどを理由とした認証エラーが発生するリスクがあります。

このようなリスクを回避し、安全にDMARCを導入するために、以下の手順が推奨されています。

  1. まず最初にDKIMとSPFを導入します。

  2. Gmail や Yahoo メールなどでメールを受信して認証が成功することを確認します。

  3. ポリシーを"none"として、DMARCレコードを公開し、Aggregate Reports を受信します。

  4. Aggregate Reports を分析して全てのメール送信先ドメインの認証結果を確認します。

  5. DKIMとSPFの運用が適切であることが確認できたら、DMARCポリシーを"none"から"quarantine", "reject"へ変更します。

どのようなメリットがあるのか

米国では、2007年に PayPal が DMARC を導入し、なりすましメールを激減させることができたというレポートがあります。

DMARCのゴールは、"reject"を宣言してなりすましメールをユーザーのメールボックスに届けないことですが、 Aggregate Reports を受信し、企業ドメインに対する送信ドメイン認証の対応状況を分析するなど、 メールの到達性を改善するための有効なツールとして利用できるかと思います。

また、Failure Reports を受信することで、 認証エラーの発生を検知し、原因の調査と改善を図るなど送信ドメイン認証の運用を適切に維持できると考えます。

おわりに

DMARCを導入するためには、まず送信ドメイン認証(SPF,DKIM)を導入する必要があります。 私どもが提供するメール配信サービス Customers Mail Cloud は、 既存のメールサーバーにメールリレーの設定をするだけで利用することができ、DKIMとSPFに対応することができます。

DMARCレコードの記述方法や、送信ドメイン認証(SPF, DKIM)の設定など、 Customers Mail Cloud ブログにより詳しく書きました。

blog.smtps.jp

DMARC導入に関するご相談も承っております。 興味がありましたら問い合わせフォームよりお気軽にご相談ください。

27th Monthly Technical Session (MTS) Report

27th Monthly Technical Session (MTS) was held on October 21st. MTS is a knowledge sharing event, in which HDE members present some topics and have a QA session in English.

The moderator of 27th MTS was Hayashi-san. f:id:bagus-rahman:20161026204016j:plain

The first topic was 'Report of CX Summit in Singapore' by Abiko-san. He began by explaining what customer success is and how to measure it. One of customer success measurements is Net Promoter Score (NPS). To put it simply, NPS determines how likely it is for customers to recommend a product or service to others. Abiko-san had joined the summit to learn about how to raise our NPS. f:id:bagus-rahman:20161026204159j:plain

The second topic was 'Brief Introduction of DMARC reports' by Okubo-san. This topic was the continuation of 'Brief Introduction of DMARC', that Okubo-san had presented on the 26th MTS. As a review, DMARC is an email authentication protocol. This time, Okubo-san mainly explained DMARC's aggregate and forensic reports. Aggregate reports describe which emails are authenticated, and which are not. Forensic reports describe emails that doesn't pass the authentication, in finer detail. Both are useful information in maintaining the stability of email service. f:id:bagus-rahman:20161026210019j:plain

The third topic was 'Introduction to Azure AD Connect' by Sumi-san. He focused on explaining how to install Azure AD Connect and how to synchronise data from Active Directory Domain Service to Azure AD. There are similar tools to Azure AD Connect, such as Azure Active Directory Sync (DirSync) and Azure AD Sync. However, these tools will be deprecated soon, on April 13th, 2017. This is one of the reasons why this topic is important. f:id:bagus-rahman:20161026210918j:plain

The fourth topic was presented by Doi-san. This was the third special topic, which had started since the 25th MTS. These topics are a way for us to share knowledge about internal projects. Because of their special nature, these topics are presented in 25 minutes, almost twice as much time as the other topics. This time, Doi-san explained the purpose, architecture, monitoring, deployment, and future works of the project he's working on. f:id:bagus-rahman:20161026211014j:plain

The last topic was 'Wi-Fi Protected Setup' by Michael-san. He is our current Global Internship Program (GIP) participant. This topic is actually a part of his bachelor's thesis. Wi-Fi Protected Setup (WPS) makes connecting to a Wi-Fi access point easier, because users don't need to know its password. Michael-san explained some WPS approaches, which are push-button and PIN. Push-button's weakness is once someone is able to physically access the access point, then they can extract its password. PIN's weakness is it can be guessed using a brute force approach. To solve this, PIN attempt should be limited. f:id:bagus-rahman:20161026211158j:plain

As usual, we had a party afterwards. f:id:bagus-rahman:20161027125039j:plain

第26回 Monthly Technical Session (MTS) レポート

9/16に第26回 Monthly Technical Session (MTS)が行われました。 MTSは、主に技術的な興味関心、また現在行っていることから得られた知見を共有するための取り組みで、司会進行から質疑応答まで全編通して英語で行われる社内勉強会です。

今回の司会はKevinさんでした。

f:id:doi-t:20160916175215j:plain

トップバッッターは古川さん、複数のAWS lamdbaを管理するために選定したツールと、解決し切れなかった現状の課題を共有してくれました。lamvery, apex, Serverless Framework, fluctなど様々ある中、プロジェクトでは10近くあるAWS lambdaをデプロイ先をstagingとproductionとで切り替えながら管理する必要があるため、今回はapexを採用したことを紹介してくれました。しかし、terraformで管理している別のAWSリソースとapexで管理しているAWS lambda間のインテグレーションについては上手く解決できたわけではなく、まだまだ解決策を模索中です。

f:id:doi-t:20160916170858j:plain

2番手の大久保さんには、SPFやDKIMを利用して送信ドメイン認証を行うことができるDMARCプロトコルの紹介をしていただきました。弊社製品のCustomers Mail Cloudが提供する機能の一部である送信者認証も、このプロトコルを基に提供されており、正しく送信者認証を設定するにはDKIM設定を慎重にやる必要があります。発表では、認証の設定が正しいか一目でわかるように、DMARCのレポートを可視化する機能の実装を今後の展望として話してくれました。

f:id:doi-t:20160916172252j:plain

3番手は、先月末にマレーシアで行われたPyCon MY 2016に参加してきたshihanさんが、カンファレンスのレポートをしてくれました。今回、HDEはゴールドスポンサーシップとしてPyCon MY 2016に協賛しました。また、弊社からjonasさんがスピーカーとして登壇したことや、津田さんが来年に行われるPyCon APAC 2017 in Kuala LumpurについてLTを行ったこと、HDEのブースでのGIPインターン案内の様子などを、写真と共にレポートとしてくれました。

f:id:doi-t:20160916172837j:plain

4番手は、ゲストスピーカーとして参加していただいた東さんにinfragisticsを紹介していただきました。infragisticsでは、UI/UXの開発改善を支援するツールやモックアップテスト、シナリオベースのユーザビリティテストなどを手軽に実現するソリューションを提供しています。今回は、ご縁があり、MTSでは珍しく社外からのゲスト枠として発表いただき、After-Partyにも参加していただきました。ありがとうございました。

f:id:doi-t:20160916173945j:plain

5番手のBagusさんには、前回に引き続き、25分枠でプロジェクトの全体像を共有する試みの第2弾として、次期リリースシステムの自動化について共有してもらいました。これまでのリリースシステム自動化は、既存のjenkins jobにjenkins jobを継ぎ足す形でほとんどのリリース作業を自動化することに成功しましたが、システムメンテナンスのコスト、古いjenkins用EC2インスタンスの管理、リリーススピードなど問題を抱えています。次期システムでは、各コンポーネントをAWS lambda+DynamoDB+API Gatewayの構成に置き換えることで、現行システムが抱える問題の解決とさらなる自動化を目指します。

f:id:doi-t:20160916182630j:plain

6番手の篠原さんには、プロジェクトでモバイルUIの開発に用いているRiot.jsの紹介をしていただきました。 WebUIに用いているAngularJSが、複雑な要件に耐える多機能なフレームワークであるのに対して、Riot.jsの強みとして、軽量、高い可読性、レンダリングのスピード、モバイルUIに対して必要十分な機能を持っている点を挙げて両者の違いを紹介していただきました。Q&Aでは、JavaScriptフレームワークの選定基準について白熱した議論が繰り広げられました。

f:id:doi-t:20160916183624j:plain

ラストは現在GIPインターン中のAkiraさん、P2Pベースの分散ファイルシステムであるIPFS (the InterPlanetary File System)の紹介をしていただきました。一度ファイルをアップロードすると全世界に公開されて、二度と消せないこの豪快なシステムは、READMEで自ら It is crazy. と認めています。Q&Aでも、悪意のある人が機密情報をアップロードしたらどうなるんだと言った議論が盛り上がりました。

f:id:doi-t:20160916185639j:plain

終わった後はAfter-Party!! 今回は特に参加者が多い回となりました。また、これが今期最後のMTSでした。来期以降も、様々なトピックを持ち寄って毎月開催を予定しています。

f:id:doi-t:20160916200723j:plain

第25回 Monthly Technical Session (MTS) レポート

8/19に第25回 Monthly Technical Session (MTS)が行われました。 MTSは、主に技術的な興味関心、また現在行っていることから得られた知見を共有するための取り組みで、司会進行から質疑応答まで全編通して英語で行われる社内勉強会です。

f:id:doi-t:20160819211409j:plain

今回の司会はBagusさんでした。

f:id:doi-t:20160422173945j:plain

トップバッターの大久保さんには、HDEにおけるマルチテナント型MTAの実装の変遷を紹介していただきました。サーバリソースをテナント間で共有することで、低価格でMTAを提供することができるようになりましたが、これを実現するにあたって解決しなければならない課題と実装上の工夫を共有してくれました。

f:id:doi-t:20160819171904j:plain

2番手は小河さん、現在開発中のサービスから一部をピックアップしてそのシステム構成を紹介していただきました。クラウドネイティブな実装によって、容易にスケールアウトできるという大きな利点を得た一方で、コンポーネント間でDBスキーマを同期する大変さがある点とその課題を共有してくれました。

f:id:doi-t:20160819173409j:plain

3番手のJonasさんは、シングルサインオンのルールを記述するDSLの実装について話してくれました。ブラウザ上でこのDSLを使用するために、JavaScriptでDSLのコンパイラとランタイムを実装する中で得られた知見や、実装したDSLをデモを通じて紹介してもらいました。LT後のQ&Aでは、早速コンサルチームから機能要望のフィードバックが行われていました。

f:id:doi-t:20160819174929j:plain

4番手は田代さん、Elasticsearchを用いたログ解析について話してくれました。サービスの使用状況を解析して、kibana上で可視化する例や、Google Sheetsと連携してリスト化する例などを紹介していただきました。

f:id:doi-t:20160819182136j:plain

5番手のJeffreyさんは、開発中のサービスについて25分枠で詳細に紹介してくれました。4月に入社したJeffreyさんから、「他のチームが使っているツールや開発しているシステムのアーキテクチャをMTSで発表して欲しい」との要望があったため、ではまずは自分からということで自身が携わっているプロジェクトについて発表いただきました。発表では、プロジェクトで活用しているAWSのサービスやSaaSを紹介した後、システムの全体像から始まり、サービスの仕組み、デプロイメントフロー、ロギング、モニタリング、今後の展望などを説明してくれました。GithubやSlackを通じて、お互いのコードや会話は常時共有されている状態でありますが、時間を取ってシステムの詳細を全員に説明する機会はなかなかありません。そのような中、今回はMTSを通じてプロジェクトの全体像を共有する試みの第一弾となりました。

f:id:doi-t:20160819184508j:plain

6番手のBumiさんには、メールをOutlook Personal Folders (PST) 形式でエクスポートするライブラリの開発について紹介していただきました。エクスポートしたメールをOutlook上で開くには、メールのフォーマットを.pst形式に変換する必要があり、これを行うライブラリを実装するにあたって知る必要がある複雑なPSTのデータ構造について解説してくれました。

f:id:doi-t:20160819191021j:plain

終わった後は、After-Party!

f:id:doi-t:20160819194541j:plain

第24回 Monthly Technical Session (MTS) レポート

7/22に第24回 Monthly Technical Session (MTS)が行われました。 MTSは、主に技術的な興味関心、また現在行っていることから得られた知見を共有するための取り組みで、司会進行から質疑応答まで全編通して英語で行われる社内勉強会です。

今回の司会はjonasさんでした。また、当日はijinさんが飛び入り参加で各LTのQ&Aにも参加いただきました。

f:id:doi-t:20160728101221p:plain

トップバッターの楠本さんは、学生時代に南極で行った研究について紹介してくれました。 現地では南極の大気の情報集めるバルーンと連携して、情報をストレージに溜め込む装置のソフトウェアをメンテナンスしていたそうです。 Q&Aでは、バルーンの回収はどうするのかとの問いに対して、気流に乗って漂うだけで、最後はどこかに落ちる仕様との回答に、一同驚きの様子でした。

f:id:doi-t:20160728101225p:plain

2番手の林さんは、開発バージョンで発生したメモリリークの原因を突き止めるために使用したpythonのツール群 (memory_profiler, Pympler, gc) をデモを交えつつ紹介してくれました。環境の制約によっては各ツールが有効でない場合もあるので、状況や目的に応じて使い分ける必要があります。

f:id:doi-t:20160728101229p:plain

前半のセッションの最後は田邊さん。サーバレスアーキテクチャで実現した監視システムについて。CloudWatch Eventsを契機にAPI Gateway, lambda, SES, SNS, CloudWatch Metricsなどが連携して、閾値を超えた監視項目がslackへ通知される実例を示してくれました。 これによって"誰が監視システムを監視するのか問題"を解消しつつ*1、lambdaによる自由なシステム監視とそのメトリクス可視化という大きなメリットが得られました。

f:id:doi-t:20160728101232p:plain

休憩を挟んで4番手は牧さん。"kubernetes in 20 minutes"というタイトルで、k8sの知見を共有してくれました。k8sとは何か、またk8sに触れるに当たって理解しておく必要があるCluster, Node, Pod, Replica Set, Deployment, Services, Secrets, ConfigMaps, Ingress, DaemonSets, PetSetsなどの概念がどのような役割でお互いどのような関係を持つのかをわかりやすく解説してくれました。アップデートの激しさも相まって、便利だけれども一筋縄ではいかない難しさがあるようです。

f:id:doi-t:20160728101234p:plain

5番手は先月からGIPインターン中のTze-Chenさん。現在大学の研究で使っているHadoopについて。Googleが発表した2つの論文 ( The Google File System , MapReduce: Simplified Data Processing on Large Clusters) によって明らかになったHadoopがどのような目的で作られたのか、facebookが管理する世界最大規模のHadoopクラスタや、MapReduceの仕組みなど、Hadoopの概要を説明してくれました。

f:id:doi-t:20160728101237p:plain

ラストは同じくGIPインターン中のRizkiさんが様々な暗号化手法について。暗号化手法別の分類と歴史的な分類の二つのアプローチで各手法がどのような経緯と特徴を持つのかを解説してくれました。また、実例としてエニグマ暗号機を紹介してくれました。

f:id:doi-t:20160728101240p:plain

発表の後はAfter-Party!! MTSはエンジニア同士の知見共有の場として開かれていますが、このAfter-PartyもまたGIPインターンも含めた社内の誰でも参加可能な交流の場として開かれています。

f:id:doi-t:20160728101243p:plain

ちなみに、この日はPokemon Goのリリース日だったので、会場は完全にPokemon Go試遊会と化していました。

f:id:doi-t:20160728101731j:plain

f:id:doi-t:20160728101736j:plain

*1:それでもなお"誰がAWSを監視するのか問題"があるにせよ!

第23回 Monthly Technical Session (MTS) レポート

6/24に第23回 Monthly Technical Session (MTS)が行われました。

MTSは、主に技術的な興味関心、また現在行っていることから得られた知見を共有するための取り組みで、司会進行から質疑応答も含めて全編通して英語で行われる社内勉強会です。今回も前回に引き続き多彩なトピックを社内で共有することができました。

今回の司会は篠原さんでした。

f:id:doi-t:20160624165517j:plain

まずは中津さんがウェアラブルについて話してくれました。今回は運動中のHEART RATEを監視することで、ペース配分に役立てる例を示してくれました。次は違った角度からのウェアラブル紹介ということでシリーズ化の予定です!

f:id:doi-t:20160624171241j:plain

2人目の柳楽さんはAWS Summit Tokyo 2016のレポートをしてくれました。たくさんあった講演の中からBig Data Pipeline (pdf)とCode Pipeline (pdf)を取り上げて、その内容を共有していただきました。 f:id:doi-t:20160624172627j:plain

3人目はShi Hanさん。"Go i18n"というタイトルで、GoにおけるInternationalizationについて発表してくれました。現時点では選択肢が少なく (i18n4go, go-i18n)、まだまだ発展途上 (Ref. Proposal: Localization support in Go) ということもあり、その苦悩を共有してくれました。当日はQ&AでPythonやJavaScriptとの比較等で白熱した議論となり、後日gettextのGo実装を行うに至りました! f:id:doi-t:20160624174532j:plain

休憩を挟んで4人目のIskandarさんは、Android開発のイントロダクションをしてくれました。世界での普及率、バージョンの歴史と問題、アーキテクチャなどの解説の他に、実装方法の選択肢や具体的な実装例を示してもらいました。 f:id:doi-t:20160624180509j:plain

5人目は最近アルバイトとしてjoinしてくれているNuttさん。タイ語におけるN-gramによる全文検索について、その概要とUnicodeに由来する難しさを紹介してくれました。タイ語は1文字が複数の文字の組み合わせで構成されることから、検索の際にはタイ語に合わせた工夫が必要になるようです。 f:id:doi-t:20160624183146j:plain

最後は、インターンのGavinさん。型システムについて、そもそも型とは何かから始まり、Lambda cubeの解説や、実際問題としてRustやJavaScriptにおける実装がどうなっているのかをデモを通じて説明してくれました。

f:id:doi-t:20160624184958j:plain

この日は、RendongさんとGavinさんのインターン最終日だったので、恒例の修了式を執り行いました。6週間に渡るインターンお疲れ様でした!

f:id:doi-t:20160624190934j:plain