security

What are your ways of securing a Express.js REST API?

China☆狼群 提交于 2020-12-15 05:16:12
问题 I'm building an app with an Express.js REST API as the back-end and I'm trying to wrap my head around all the necessary security measures and which libraries and tools to use. Could you guys and gals make a rundown of what your favorite and secure libraries you use for each part of the securing process are? Maybe also write why you use the ones you use. It would really help me a lot. Thank you in advance. 回答1: You should use CORS to prevent access to your API from unwanted origins (domain,

Rest API under https security

好久不见. 提交于 2020-12-13 03:18:14
问题 I am new and need directions so I can ask the correct questions. Here's the deal: I have developed a REST API under HTTPS. The user must provide a valid token to use the API. The token expires after not being used for more than 5 minutes. To obtain the token, the client must call the authentication API passing his private primary or secondary key, along with his user number. Each key is unique, and on the database I save it's hash. The user passes his primary or secondary key through the

Rest API under https security

情到浓时终转凉″ 提交于 2020-12-13 03:17:38
问题 I am new and need directions so I can ask the correct questions. Here's the deal: I have developed a REST API under HTTPS. The user must provide a valid token to use the API. The token expires after not being used for more than 5 minutes. To obtain the token, the client must call the authentication API passing his private primary or secondary key, along with his user number. Each key is unique, and on the database I save it's hash. The user passes his primary or secondary key through the

X509Certificate2 constructor throwing Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: There is not enough space on the disk

巧了我就是萌 提交于 2020-12-12 10:18:21
问题 I am running into a similar issue that is described here. This is a .NET Core 3.1 App running as a Azure WebJob in Azure App Service. Based on the discussion in the above link, I assume this is an issue with file counts in a directory, I am having trouble figuring out which directory is getting full. The environments page on the Kudu portal shows this, basically doesn't seem to be a overall disk space issue- D:\home usage: 57,344 MB total; 56,795 MB free d:\local usage: 11,264 MB total; 10

X509Certificate2 constructor throwing Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: There is not enough space on the disk

安稳与你 提交于 2020-12-12 10:15:29
问题 I am running into a similar issue that is described here. This is a .NET Core 3.1 App running as a Azure WebJob in Azure App Service. Based on the discussion in the above link, I assume this is an issue with file counts in a directory, I am having trouble figuring out which directory is getting full. The environments page on the Kudu portal shows this, basically doesn't seem to be a overall disk space issue- D:\home usage: 57,344 MB total; 56,795 MB free d:\local usage: 11,264 MB total; 10

JWT token - Man in middle attack

末鹿安然 提交于 2020-12-12 02:52:32
问题 I was going through the JWT auth. It looks pretty good. However I have a question that is the JWT authentication prone to Man in the Middle attack ? Can someone get this token while it is being sent. If so, then with the token and a fake request(obviously with a correct url) the data can be fetched ? Is this even a valid scenario ? Any views are appreciated 回答1: JWT without https is prone to man in the middle attack, You should use it with https protocol to minimize the risk. You can make it

Helmet CSP not working correctly?

自闭症网瘾萝莉.ら 提交于 2020-12-07 03:41:59
问题 Using Vue SPA distributed by Express. this is my helmet code in express app.use(helmet.contentSecurityPolicy({ directives: { defaultSrc: ["'self'"], styleSrc: ["'self'","'unsafe-inline'" ,'unpkg.com', 'cdn.jsdelivr.net', 'fonts.googleapis.com', 'use.fontawesome.com'], scriptSrc: ["'self'","'unsafe-inline'",'js.stripe.com'], frameSrc: ["'self'",'js.stripe.com'], fontSrc:["'self'",'fonts.googleapis.com','fonts.gstatic.com','use.fontawesome.com','cdn. joinhoney.com'] } })); Doing this produces

Having a public API but only allowing access to requests sent from my website

浪子不回头ぞ 提交于 2020-12-06 12:28:22
问题 I have been searching on Google and SO for hours now but without finding the someone with the same challenge as I now face so here goes: We have a database with which we put a lot of money and effort into maintaining. The data from the database is publicly available through an REST-API. We also have a public javascript web app that consumes this API and which we sell to some 30-40 customers. As the data in the API is quite valuable to us we want to try to secure it so that no one can scrape

Having a public API but only allowing access to requests sent from my website

亡梦爱人 提交于 2020-12-06 12:25:04
问题 I have been searching on Google and SO for hours now but without finding the someone with the same challenge as I now face so here goes: We have a database with which we put a lot of money and effort into maintaining. The data from the database is publicly available through an REST-API. We also have a public javascript web app that consumes this API and which we sell to some 30-40 customers. As the data in the API is quite valuable to us we want to try to secure it so that no one can scrape

Does AWS SDK for Java communicate in a secure channel with S3 servers?

我是研究僧i 提交于 2020-12-06 06:50:26
问题 I would like to think that it's a big YES, but I prefer to ask before to suppose. So, do you know if the AWS SDK for Java always uses a secure channel when I download/upload files from/to S3 buckets? Or this is something that should be configured when I write the code or into the S3 buckets itself? 回答1: Amazon S3 end points support both HTTP and HTTPS (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) when you're using the Java SDK you will create an AmazonS3Client and if you