問題タブ [data-security]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
filestream - System.IO - BinaryReader/Writer はファイルの内容を正確に読み書きしますか? (抽象的な概念)
私は C# に比較的慣れていないので、wxMaxima で設計したテキスト暗号化アルゴリズムを、Visual Studio フォームを使用して C# のバイナリ暗号化プログラムに適応させようとしています。私はバイナリ ファイルの読み取り/書き込みに慣れていないため、ファイル ストリームを読み書きしようとすると何が起こるかについての知識が不足しています。
たとえば、これまで行ってきたようにテキスト ファイルを暗号化する代わりに、実行可能ファイルまたはその他の形式のバイナリ ファイルを暗号化するとします。
ここに私が理解できないいくつかの質問があります:
ファイル ストリームを開いて binaryreader を使用すると、ファイル内のすべての完全な複製が読み込まれますか? たとえば、ファイル全体を読み取り、元のファイルを削除してから、古い名前で新しいファイルを作成し、バイナリ ストリーム全体を書き戻せるようにしたいと考えています。これで元のファイルが正確に再現されますか?それとも、別の方法で説明しなければならない何らかの破損が発生するのでしょうか?
これは暗号化プログラムであるため、元のファイルを削除する前に低レベルの「フォーマット」を行う機能を追加して、ハードディスクの物理データを組み合わせても理論的にはアクセスできないようにしたいと考えていました。binarywriter を使用して元のファイルの一部を意味不明な部分で上書きすると、それはハードディスクの同じ場所に配置されますか、それともファイルが断片化され、実際には FAT を介してハードディスクの他の部分にリダイレクトされますか? 明らかに、ハードディスク上の元のクラスターを上書きしないのであれば、元のファイルを意味のないもので上書きしても意味がありません。
mongodb - カスタマイズされた承認ポリシーを定義する最良の方法
MongoDB を使用してプロジェクトを開発しています。たとえば、次の形式のドキュメントがある場合、ロールに基づいてユーザーへのデータの可視性を制限できるシナリオがあります。
「admin」ロールを持つユーザーは「testme1」と「testme2」の両方を表示できますが、「guest」は「testme2」のみを表示できます。これらの承認ルールを動的に定義して、ラッパー API がルールに従ってのみデータを取得するようにする最善の方法は何ですか。私のアプローチは、ユーザーにルールを定義するためのWeb「UI」を提供し、ユーザーの宣言に基づいてサーバーに「XML」ファイルを保持することです。誰かがより良いアイデアを持っているかどうか、また、これを行うためのデータベースレベルのアプローチがあるかどうかを教えてください
c# - エラーまたは使用できない API の場合にオブジェクトの内容を保存する方法
実行された操作の数と種類を追跡する必要があるアプリケーションを作成しています。すべての操作が完了すると、このデータが API に送信されます。この API はデータを保存し、このデータを使用して、会社はアプリケーションが実行した作業量をユーザーに請求できます。
以下のコードは、私のコードの非常に単純化された実装です。
TicksCounter クラスは、クロス スレッド アクセスとその他のいくつかの問題を内部的に処理します。そして、私のコードはそのまま正常に動作しています。
ただし、私の問題はTicksCounter
、アプリケーションがクラッシュした場合や API が利用できない場合に、の内容を保護する良い方法を見つけられないことです。
API が使用できない場合にカウンターの内容を保存する状況を構築したい。それから間隔を置いて、コンテンツを API に投稿し続けようとします。API が再び使用可能になると、これは成功し、このオブジェクトを忘れることができます。アプリケーションがクラッシュした場合、またはユーザーが故意にアプリケーションを終了した場合 (タスクマネージャーを使用してみましょう)、これと同じ状況を適用したいと思います。時間、API に。
これで、アプリケーションの終了時に常に正しいデータを保持するための 100% 信頼できるアプローチは存在しないことがわかりました。ティックの最小限の損失が許可されます。
私の考え
バイナリ シリアル化を使用してハード ドライブ上のファイルにすべての内部コンテンツを保存するコードを TicksCounter クラスに追加することを考えていました。これは、10 の倍数のティックが追加されるたびに発生します。
私の問題は、ハードドライブに保存していて、これを頻繁に行うため、これは非常に高価な操作のように見えることです。多くの重い作業を実行する Windows サービスを実行しているため、最小限のパフォーマンスの低下は問題ではありません。しかし、私はより良い正しい解決策を探しています。
この状況では、どのようなアプローチが適切でしょうか? それとも、私のアプローチに固執する必要がありますか?
sql-server - SQL Server データの変更とセキュリティ
私たちの環境では、sa でログインするすべてのユーザーがテーブル データを変更できます。
誰が変更したか、どのIPから変更したかなど、変更されたデータをキャプチャするトリガーを作成します
ただし、問題は、特定のテーブルでトリガーを無効にした後にユーザーがデータを変更できることです。そのため、トリガーは起動せず、ユーザーはシームレスにデータを変更できます。
データの変更をキャプチャしてログに記録する最良の方法を教えてください。そのため、誰もセキュリティをバイパスできません。変更データをキャプチャする別の方法を探しているので、sa アカウントを無効にしないでください。はいの場合は、SQL Server 2005/2008 に安全な方法が存在しますか? ありがとう
web-applications - Parse.com はどこまで保護されていますか?
私は最近、データを保存するための Android アプリを開発した Parse.com に出会いました。しかし今は、以前に保存した同じデータを使用して Web アプリケーションを開発する必要があります。
しかし、私の問題は、パースがJavaScriptファイルの「アプリキー」と「Javaスクリプトキー」に言及するように求めていることです。ちなみに、同じ Java スクリプト ファイル内のテーブル名と列名についても言及する必要があります。つまり、データベースへのアクセス全体を、私のデータから 1 クリックでアクセスできるランダムな人物に与えているということです。
では、どうすればより安全にできますか?
android - デバイスのパスワード変更後に AndroidKeyStore が消去される
私は現在、クライアントサーバーアーキテクチャに基づくAndroidアプリケーションに取り組んでいます。データのセキュリティのために、データの暗号化と署名に公開鍵と秘密鍵のペアを使用しています。キーペアの保存に AndroidKeyStore を使用しています。以下は、鍵ペアを生成するコードです。
このコードを実行すると、キーストア関連ファイル (CERT および PKEY ファイル) が「/data/misc/keystore/user_0/」ディレクトリに生成されます。セキュリティ上の理由から、auth-token などのアプリケーションの機密データを暗号化し、Shared Pref に保存しています。
ただし、ユーザーがデバイスのパスワードまたは PIN を変更すると、キーストアの暗号化に使用されるマスターキーがデバイスの資格情報を使用して生成されるため、キーストア ファイルが削除されます。
この問題を修正するために、公開鍵と秘密鍵のペアを RAM に保持し、パスワードが変更されたときにしようとしました。DeviceAdminReceiver の onPasswordChanged(Context context, Intent intent) メソッドから、以下のコードを実行しています。
ただし、このコードの後、'/data/misc/keystore/user_0/'
ディレクトリに CERT ファイルのみが作成され、秘密鍵を使用して復号化すると、無効な署名エラーが発生します。
また、公開鍵をサーバーと共有し、データを秘密鍵で暗号化したため、新しい鍵ペアを作成することはより良い解決策ではありません。
では、デバイスのパスワードを変更した後、公開秘密鍵のペアを保持するにはどうすればよいですか? 回避策がない場合、AndroidKeyStore の正確な用途は何ですか? どこで使用できますか?
java - Windows 上の Java でのデータに対するアクセス制御の実装
Java FX を使用して Windows デスクトップ アプリケーションを作成しています。データはローカルの MySQL サーバー (同じコンピューター上) に保存します。ユーザーがアプリケーションでのみデータを編集/作成できるようにしたいと考えています。また、自分で情報を破損または変更することはできません。
これを達成するための可能な解決策はありますか?
php - How to protect medical data in a web app/database?
I'm working on a small paramedical app (mainly calendar and information about the patients) that will be web hosted. The app will allow multiple accounts (1 for each practitioner) that won't share data. I want to protect the personal data as much as possible, especially to avoid 2 possible problems :
1/ a programming bug that may lead one practitioner to access data from someone else 2/ if the complete database is stolen, I want the personal information to be safe
I know that the firsts things are to avoid every sql or parameter injection but I want to take an extra steps because I'm human and I know that just one error could lead to a real mess if the data leaks... and I really want to avoid that.
- The app is based on PHP and Mysql
- the app HAS TO have a way to decrypt the personal data by it's own, because for example it sends in background emails and SMS to the patients to remind them their appointments.
- a practitioner often has a secretary that must be able to access the app with it's own login/password and see the practitioner's data (but not all of them, only the ones related to the contact information, appointment date/time...)
- of course the practitioner or secretary should be able to make a search in the database to find for example a patient by it's name, phone number... even if it's encrypted in the database.
So... I'm trying to figure out the best way to store, encrypt, decrypt the data. I'm also a little bit scared of performance, for example a search engine on encrypted data...
For now here is the simplest idea I have : 1/ when a new practitioner creates an account I generate a unique key, related to the account, that will never change, and store it in the database... it will be a kind of "salt" 2/ for every personal data, I encrypt it (for example : a patient's name, phone number) with a key composed of two parts : one which is the same for the whole application (stored in a php config file for example) + the "salt" taken from the practitioner account.
This is practical because there is no link between the practitioner's password and the app, so for example no problem for the practitioner's secretary to access the data, my email/SMS tasks to decrypt the data and if the practitioner looses his password (which is more likely to happen than the steal of the database). I first imagined to encrypt the encryption key with the (clear) password of the practitioner but then it's impossible to access the data with the secretary account or the schedule task. If I encrypt the encryption key with the hash of the practitioner's password (which is stored in the database) it's a lot more complicated and in fact adds zero security benefit.
Questions :
A/ do you think it's strong enough or am I missing something ? I know that if the complete server is compromised, the data are potentially not safe (if the hacker is smart enough to locate the key, write a code to decrypt all the data)... but that's not exactly what I fear. And I can't find any better solution which keeps the schedule task able to decrypt the data. Do you have better suggestions ?
B/ how would you encrypt/decrypt the text data ? (algorithm, key, database...) I'm really new to this in PHP and I fear making mistakes. I read the documentation but it lacks complete real life example (from key generation to text encryption/decryption). I fear utf8 problems, problems with key lengths (what are the good practices for creating a compound key from a fixed part (php config file) and a variable part stored in the database ?)...
C/ for the search engine, how would you do ? for example I want to find a person having the name starting by "ABCD" do I have a better way to do it than retrieving the whole list of encrypted names, decrypt (php) every name, put them in a list, and then (still php) make a search function inside that list ? Do you think I should encrypt/decrypt the whole data using the MySQL's AES_ENCRYPT/AES_DECRYPT functions instead ?
Thanks in advance