Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access control id remote client #1

Open
highlevellogic opened this issue Dec 20, 2020 · 1 comment
Open

access control id remote client #1

highlevellogic opened this issue Dec 20, 2020 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@highlevellogic
Copy link
Owner

highlevellogic commented Dec 20, 2020

Working towards a simple but effective access control. When the client is a browser, CORS is an approach. For other clients:

// local and remote ip addresses differ
// local has local ip of server machine
// remote has lan ip (router) within lan
// remote has public ip when client is outside of lan
console.log("localAddress: " + req.socket.localAddress);
console.log("remoteAddress: " + req.socket.remoteAddress);

Sufficient for password authentication for remote clients?
Comments welcome!

@highlevellogic
Copy link
Owner Author

highlevellogic commented Dec 20, 2020

Approach #2: Require https

const cert = req.connection.getPeerCertificate();
use cert.subject.CN for domain (common name)

or

cert.subjectaltname: 'DNS:*.nodejs.org, DNS:nodejs.org'
(But this is listed as optional in my reference.)

Is cert.subject.CN the truth?
The trick here seems to be understanding which fields are user defined and which are automatic - i.e. What are the fields the CA creates from the request -- i.e. that are guaranteed to be accurate?

whitelist / blacklist domains

@highlevellogic highlevellogic added the help wanted Extra attention is needed label Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant