سؤال

أنا أعمل على خدمة WCF التي ستتواصل عبر Net.TCP إلى N مثيلات تطبيق العميل (يتم تطويره بواسطة مبرمج آخر في مكتبي).

في الوقت الحالي ، أستخدم net.tcp دون أي أمان لأنني شعرت أن إعداد هذا في هذه المرحلة لم يكن ضروريًا ، على الأقل ليس حتى نكون أقرب إلى الخروج.

أثناء تطوير تطبيق WCF ، هل هناك أي ضرر في استخدام الربط القياسي (Net.TCP في حالتي) دون أمان ، ثم بمجرد اكتمال منطق العمل ، تنفذ جميع متطلبات الأمان؟ هل هناك أي أشياء يجب أن أكون على دراية بها قد لا تعمل بعد تنفيذ الأمن؟

هل كانت مفيدة؟

المحلول

على الرغم من أن تصميمك العام يجب أن يفكر في الأمان منذ البداية ، لا أعتقد أنه من الجيد أن نربط مكوناتك بأي استراتيجية أمان معينة. قد ترغب في استخدام بعض مكوناتك بطريقة غير آمنة أو عبر بروتوكول مختلف يوفر خيارات أمان مختلفة.

لذا فإن إجابتي هي نعم ولا. نعم ، أنت بحاجة إلى التفكير في الأمر منذ البداية ، ولكن لا يجب ألا تقترن مكوناتك باحتياجاتك الأمامية.

ومع ذلك ، نظرًا لأنك تعلم أنك ستستخدم net.tcp ، يجب أن تدرك أن أمان النقل يتم تشغيله افتراضيًا لهذا الربط.

لمزيد من المعلومات ، انظر Juval Lowy الرائعة برمجة خدمات WCF, ، الفصل 10. Lowy ، في مكتبة ServiceModelex (تمت مناقشته باستفاضة في الكتاب) يوفر إطارًا رائعًا حقًا يمكنك توصيله بعد إنشاء مكوناتك. حتى لو لم يكن بالضبط ما تبحث عنه ، فيمكنك تخصيصه لتناسب احتياجاتك.

نصائح أخرى

Security should be thought about from the start, and not added on at the end.

Develop a plan for your security, and implement it as you go, rather then at the end.

Reference: Microsoft .NET: Architecting Applications for the Enterprise

http://www.amazon.com/Microsoft®-NET-Architecting-Applications-PRO-Developer/dp/073562609X

You have two choices, bake it in from the beginning, or slap it on at the end. With security in general I would say it really does not work in the icing so you have to make a mess of your cake to get it in there.

However, the way I see your question is you already know you need to do something to solve a security issue, you just have not decided what to do. In that case I would agree with Terry that you should then design around an abstraction that allows you to plugin the eventual solution.

If I were you I would probably do a threat model and use it to consider the inputs and risks presented by your service. This will help you decide what you should do eventually and if your abstraction covers all bases.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top