Comments (3)
OK, so it looks like we're talking about canary.php -- which is generated by TestCommand and installed on the test site as part of an end-to-end test:
https://github.com/totten/amp/blob/30aaa0f94/src/Amp/Command/TestCommand.php#L103
https://github.com/totten/amp/blob/30aaa0f94/src/Amp/views/canary.php#L6
The script does some incautious things -- e.g. it accepts a MySQL DSN from $_POST and connects to it -- and that could be abused (e.g to launch DoS) if some bug or accident caused the file to show up on a public httpd. So the script includes the localhost check to prevent abuse by third-parties.
We could change the mechanism for passing DSN (e.g. pass it the same way we pass $dataDir or $autoloader)... Do you think the script would be secure enough that it would be OK if (through bug or accident) it got exposed on a public URL? If so, we could remove the REMOTE_ADDR check entirely.
Aside: I'm kind of curious what use-case you have in which REMOTE_ADDR is not localhost...
from amp.
Hi totten. Sorry, I may have misidentified the issue. I'm done some more testing this morning and I'm getting an access denied even before it manages to get into the script, so I expect this is a boreader permissions issue on my server.
The REMOTE_ADDR is only set if you're accessing from localhost, but not using the command line. Since I was debugging the file using the command line, the REMOTE_ADDR wasn't set, so it was hitting this error. That sent me off course a bit.
Thanks for the comments though. I think the localhost check should probably stay in place for security, as you mention.
from amp.
Silly me, I was trying to include the file before the <Directory />
, and there were permissions to fix up as well. Sorry for the false alarm totten, but thanks for the help.
from amp.
Related Issues (20)
- amp config - Better advice on httpd
- Nginx support HOT 3
- Check for Apache mod_rewrite HOT 5
- NginX: Restrict access to sensitive directories
- Is app/defaults/services.yml distributed? HOT 1
- Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: Connection refused HOT 5
- nginx vhost view doesn't detect whether php is running on a port or a socket. HOT 3
- No random characters at the end of database name HOT 9
- amp config fails for invalid mysql config HOT 10
- amp config failed to read :7979 HOT 6
- Update README.md
- permissions: worldWritable not working for unprivileged users HOT 4
- Detect if we're running with encrypted home directories and suggest using AMPHOME instead HOT 3
- Allow longer database names HOT 5
- Make apache vhost config 12 factor friendly HOT 2
- Apache access denied without +x for user home directory
- Explicitly identify common stacks/environments
- Clarity / documentation
- Add ability to pass db user and password when creating (as we do with url etc) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amp.