LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-29-2015, 06:25 PM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
php-composer required, but I don't trust it


OK so I want to use php-opencloud and was quite chargined to find this in the install instructions:
Code:
You must install this library through Composer:

# Install Composer
curl -sS https://getcomposer.org/installer | php

# Require php-opencloud as a dependency
php composer.phar require rackspace/php-opencloud
Now I'm sure a lot of people are very excited by composer. I am not so excited.

Can anyone suggest a way that I might run these commands in a chroot jail or something so that I can truly understand what files are downloaded, what sites are accessed, what local files are changed, etc.?

Rants in favor of or against composer are also welcome.
 
Old 09-29-2015, 07:53 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, php is a src code language, so you could just download it ("installer") but not run it through php. Instead read the downloaded file ?
 
Old 09-29-2015, 08:20 PM   #3
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by chrism01 View Post
Well, php is a src code language, so you could just download it ("installer") but not run it through php. Instead read the downloaded file ?
I started to. It's over 4000 lines. I thought it would be more efficient to try and run it in some kind of jail and see what files it actually downloads (or alters) rather than trying to speculate theoretically about its results.
 
Old 09-29-2015, 09:58 PM   #4
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
could you not try installing from git ?

I didn't like the idea of composer either, but have come to like it well enough.

Install it to a VM, and toast it if you don't like what you see

Last edited by ceyx; 09-29-2015 at 10:02 PM.
 
Old 09-30-2015, 01:27 PM   #5
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by ceyx View Post
could you not try installing from git ?
As I originally posted, the installation instructions for php-opencloud on github say one MUST user composer:
Quote:
You must install this library through Composer
To install without composer is probably not especially difficult, but the composer.json file says there are a number of dependencies. I'm not sure if I can get away with just require or whether I need require-dev. I'm also not sure what the simple path names mean in there. For instance, what does guzzle/guzzle refer to? Are these github partial paths? Can anyone help me decipher this composer.json file?
Code:
{
    "name": "rackspace/php-opencloud",
    "description": "PHP SDK for Rackspace/OpenStack APIs",
    "keywords": ["rackspace", "openstack", "opencloud", "swift", "nova"],
    "type": "library",
    "license": "Apache-2.0",
    "authors": [
        {
            "name": "Jamie Hannaford",
            "email": "jamie.hannaford@rackspace.com",
            "homepage" : "https://github.com/jamiehannaford"
        }
    ],
    "autoload": {
        "psr-0": {
            "OpenCloud": ["lib/", "tests/"]
        }
    },
    "require": {
        "php" : ">=5.4",
        "guzzle/guzzle" : "~3.8",
        "psr/log": "~1.0",
        "mikemccabe/json-patch-php": "~0.1"
    },
    "require-dev" : {
        "phpunit/phpunit": "4.3.*",
        "phpspec/prophecy": "~1.4",
        "satooshi/php-coveralls": "0.6.*@dev",
        "jakub-onderka/php-parallel-lint": "0.*",
        "fabpot/php-cs-fixer": "1.0.*@dev",
        "apigen/apigen": "~4.0"
    }
}
Quote:
Originally Posted by ceyx View Post
I didn't like the idea of composer either, but have come to like it well enough.
It's easy to understand the allure. Getting dependencies in place is a chore. This makes it easier. HOWEVER, it seems abundantly clear that devs are all too willing to trust other convenient packages without making any attempt to check that those other packages are in fact trustworthy. For something like access to my rackspace cloud account, that is unacceptable. PHP-opencloud has my account credentials. Security is important.

Quote:
Originally Posted by ceyx View Post
Install it to a VM, and toast it if you don't like what you see
This is more or less what I was getting at, but I still need the right commands to monitor exactly which files are changed. How do I know, for instance, that /etc/passwd hasn't been accessed or changed?
 
Old 09-30-2015, 07:04 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
For specific files you are worried about you can take copies & either eyeball or run diff to check.
If you want to know about every file it changes, you'll have to read the code and/or ask the suppliers - do they have a community / support forum?
Maybe its in the FAQ?

Actually, something like tripwire (if its still around) or an equiv, although even then I'm not sure whether its practical to monitor EVERY file on your system.

Have you tried googling around about this tool generally to see if anyone has ever complained?
 
Old 10-01-2015, 10:23 AM   #7
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by chrism01 View Post
For specific files you are worried about you can take copies & either eyeball or run diff to check.
If you want to know about every file it changes, you'll have to read the code and/or ask the suppliers - do they have a community / support forum?
Maybe its in the FAQ?
Strictly speaking, this is not true. I vaguely recall a command that would let one monitor all file accesses/changes in a particular subdirectory but I can't seem to find it. I was hoping to use something like that in combination with a chroot jail or something to prevent composer from modifying or accessing any sensitive files.

Quote:
Originally Posted by chrism01 View Post
Actually, something like tripwire (if its still around) or an equiv, although even then I'm not sure whether its practical to monitor EVERY file on your system.
I don't think I need to continually monitor the system -- just long enough to run the composer install would be enough I think.

Quote:
Originally Posted by chrism01 View Post
Have you tried googling around about this tool generally to see if anyone has ever complained?
https://scott.arciszewski.me/blog/20...e-composer-php
 
Old 10-01-2015, 07:31 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
For a dir, try inotifywait or inotifywatch ?
 
Old 10-02-2015, 09:59 AM   #9
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by chrism01 View Post
For a dir, try inotifywait or inotifywatch ?
aha! That's it. I was able to find this old thread with more detail.

Now is there any way to jail composer while it runs? I.e., constrain its file access to some subdirectory?
 
  


Reply

Tags
composer, php



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: When It Comes To FOSS, Who Don’t You Trust? LXer Syndicated Linux News 0 05-27-2013 09:12 PM
Software signature is required..Do you trust the source of the packages ? Aquarius_Girl General 18 09-29-2010 09:36 PM
mozilla composer and php ybc Linux - Software 3 04-19-2003 01:37 PM
don't trust this guy! Half_Elf Linux - Distributions 5 10-28-2001 05:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration