1. 04 Oct, 2017 1 commit
  2. 08 Dec, 2015 1 commit
    • Kirk Webb's avatar
      Batch of changes that creates a PhantomNet portal branding. · ba49a457
      Kirk Webb authored
      Also includes some PhantomNet-specific restrictions (e.g. only
      allows use of the main Utah Emulab testbed  aggregate).
      
      This excercise stretched the limits of what we can reasonably do
      before introducing real per-testbed branding/policy mechanisms to
      the php/web front-end.  My changes ain't exactly pretty...
      
      Please take care when adding any testbed-specific changes to the
      code.  There are three flavors now to consider in the logic.
      ba49a457
  3. 27 Aug, 2014 1 commit
  4. 26 Aug, 2014 1 commit
  5. 24 Sep, 2012 1 commit
    • Eric Eide's avatar
      Replace license symbols with {{{ }}}-enclosed license blocks. · 6df609a9
      Eric Eide authored
      This commit is intended to makes the license status of Emulab and
      ProtoGENI source files more clear.  It replaces license symbols like
      "EMULAB-COPYRIGHT" and "GENIPUBLIC-COPYRIGHT" with {{{ }}}-delimited
      blocks that contain actual license statements.
      
      This change was driven by the fact that today, most people acquire and
      track Emulab and ProtoGENI sources via git.
      
      Before the Emulab source code was kept in git, the Flux Research Group
      at the University of Utah would roll distributions by making tar
      files.  As part of that process, the Flux Group would replace the
      license symbols in the source files with actual license statements.
      
      When the Flux Group moved to git, people outside of the group started
      to see the source files with the "unexpanded" symbols.  This meant
      that people acquired source files without actual license statements in
      them.  All the relevant files had Utah *copyright* statements in them,
      but without the expanded *license* statements, the licensing status of
      the source files was unclear.
      
      This commit is intended to clear up that confusion.
      
      Most Utah-copyrighted files in the Emulab source tree are distributed
      under the terms of the Affero GNU General Public License, version 3
      (AGPLv3).
      
      Most Utah-copyrighted files related to ProtoGENI are distributed under
      the terms of the GENI Public License, which is a BSD-like open-source
      license.
      
      Some Utah-copyrighted files in the Emulab source tree are distributed
      under the terms of the GNU Lesser General Public License, version 2.1
      (LGPL).
      6df609a9
  6. 11 Jul, 2012 1 commit
    • Leigh Stoller's avatar
      Cleanup in the web interface to prevent XSS attacks. · 6cf701f9
      Leigh Stoller authored
      We had a couple of different problems actually.
      
      * We allow users to insert html into many DB fields (say, a project or
        experiment description).
      
      * We did not sanitize that output when displaying back.
      
      * We did not sanitize initial page arguments that were reflected in the
        output (say, in a form).
      
      Since no one has the time to analyze every line of code, I took a couple of
      shortcuts. The first is that I changed the regex table to not allow any <>
      chars to go from the user into the DB. Brutal, but in fact there are only a
      couple of places where a user legitimately needs them. For example, a
      startup command that includes redirection. I handle those as special
      cases. As more come up, we can fix them.
      
      I did a quick pass through all of the forms, and made sure that we run
      htmlspecialchars on everything including initial form args. This was not
      too bad cause of the way all of the forms are structured, with a
      "formfields" array.
      
      I also removed a bunch of obsolete code and added an update script to
      actually remove them from the www directory.
      
      Lastly, I purged some XMLRPC code I did a long time ago in the Begin
      Experiment path. Less complexity, easier to grok and fix.
      
      	modified:   sql/database-fill.sql
      	modified:   sql/dbfill-update.sql
      6cf701f9
  7. 21 Oct, 2008 1 commit
    • Kevin Atkinson's avatar
      If a known user (based on stored cookies) is not logged in than · 846a98d6
      Kevin Atkinson authored
      redirect to the login page rather than printing a message with a link
      to the page.  Otherwise send a "403 Forbidden" to keep robots from
      indexing the page.  Also send appreciate HTTP responses on other
      precheck errors to keep a robot from indexing the page.  In order to
      do this the PAGEHEADER call needed to be moved to after
      CheckLoginOrDie and Required/OptionalPageArguments on many pages.  A
      warning will be printed if either CheckLoginOrDie or
      Required/OptionalPageArguments detects that PAGEHEADER was already
      called.
      
      Also change the redirect in kb-show to be a permanent redirect (301)
      rather than a temporary one (302) which is the default unless a status
      code is given.
      846a98d6
  8. 16 May, 2008 1 commit
  9. 01 May, 2008 1 commit
    • Kevin Atkinson's avatar
      Implemt FS#187 -- Show admin history of projects: · 8054f5f8
      Kevin Atkinson authored
        When a project is initially created a new mailing list is created,
        PROJ-admin@emulab.net.
      
        testbed-approval is subscribed to the list
      
        Several emails that originally went to testbed-approval now go to the
        mailing list instead.  The From, To, fields are basically the same
        with testbed-approval becoming PROJ-admin.  This means some mail
        is sent with a From PROJ-admin and Bcc the mailing list.  Note that
        some mail still goes to testbed-approval directly, in particular
        ones where there is no clear project involved, and when a project is
        denied.
      
        In addition notifications of approval status of new members is also
        sent to the list.  These emails use to only go to testbed-audit@.
      
        Currently All mail sent to PROJ-admin is also sent to testbed-audit
        (via a Bcc).  This means that some mail that didn't use to go to
        testbed-audit now does.
      
        The mailing list is deleted when a project is deleted with out first
        being approved.  Becuase of this notified that a project is denied
        is sent to testbed-approval instead of PROJ-admin.
      
        Admins can access the mailing list from the Project Profile page.
      
        The mailing list is open in order to allow users to reply to the
        mailing list, in addition the check that PROJ-admin is in the To or
        CC field is disabled.  There is currently no spam control on the
        mailing lists.  However, since the mailing list address is not posted
        anywhere it should't pick up to much spam.  If it does we can deal
        with it then.
      
        Finally, a new script is created to create the per-project admin
        mailing list.  See doc/UPDATING.
      
      Also add DBQuerySingleFatal to libdb, which is like DBQueryFatal but
      also fails if the query didn't return any results.  Basically
      identical to he version in libtblog.  Eventually libtblog should be
      modified to use this version.
      8054f5f8
  10. 20 Feb, 2008 1 commit
  11. 02 Nov, 2007 1 commit
  12. 24 Oct, 2007 1 commit
    • Russ Fish's avatar
      Fix the approveproject:Destroy option. · c6291e10
      Russ Fish authored
      approveproject.php3 - Take the user out of project group first,
          then 'nuke' the user, similar to how approveproject:Nuke does it,
          before removing the destroyed project.
      tbsetup/rmuser.in - Allow removing an unapproved project leader when nuking.
      tbsetup/rmgroup.in - There are no /etc/group entries for an unapproved project group.
      db/Group.pm.in - More exclude_leader fixes to Group->MemberList.
      c6291e10
  13. 14 Aug, 2007 1 commit
    • Russ Fish's avatar
      When I fixed the regexp in PAGEARG_STRING that checks for quotes, it plugged · ab1761e5
      Russ Fish authored
      one SQL injection hole, and shifted detection of probes  earlier in a lot
      of other pages.  But some inputs that were marked PAGEARG_STRING should
      actually be PAGEARG_ANYTHING, since they're text fields where quotes make
      sense, and are escaped properly in the logic that handles them.
      
        approveproject.php3 - message
        editnodetype.php3 - newattribute_value
        newnodelog.php3 - log_entry
        newosid.php3 - description
        nodecontrol.php3 - startupcmd (node_control strips single-quotes from values.)
      ab1761e5
  14. 16 Mar, 2007 1 commit
    • Leigh Stoller's avatar
      Change to elabman handling, to setup an account that we can use for · d7f33445
      Leigh Stoller authored
      helping remote sites setup and update.
      
      * Added a V2 (DSA) key to the install directory that us inserted into
        the pubkeys table for the elabman. This key is encrypted and stored in
        /root/.ssh/elabman_dsa on Utah's boss.
      
      * elabman now starts out as webonly=0,status='active' with a real
        shell on both boss and ops.
      
      * freeze/thaw user now treat elabman as special, giving elabman a real
        account on boss and ops when thawed.
      
      * Addeda "notes" entry to the user profile that indicates the account
        can be frozen once the remote emulab is up and running.
      d7f33445
  15. 12 Feb, 2007 1 commit
    • Leigh Stoller's avatar
      * Replace the argument processing code in all pages. Currently we rely on · 48acc8e3
      Leigh Stoller authored
        register_globals=1 to turn POST/GET/COOKIES arguments in local variables.
        This is known to be a terrible security risk, and we keep saying we are
        going to fix it, and now I am. In order to accomplish this on a
        transitional basis (since I don't want the entire web interface to stop
        working while I debug it), and because the code just needs the cleanup, I
        am doing it like this: Each page will sport new declarations at the top:
      
      	RequiredPageArguments("experiment", PAGEARG_EXPERIMENT,
                                    "template",   PAGEARG_TEMPLATE,
                                    "instance",   PAGEARG_INSTANCE,
                                    "metadata",   PAGEARG_METADATA,
                                    "osinfo",     PAGEARG_OSINFO,
                                    "image",      PAGEARG_IMAGE,
                                    "project",    PAGEARG_PROJECT,
                                    "group",      PAGEARG_GROUP,
                                    "user",       PAGEARG_USER,
      			      "node",       PAGEARG_NODE,
      			      "yesno",      PAGEARG_BOOLEAN,
      			      "message",    PAGEARG_STRING,
      			      "age",        PAGEARG_INTEGER,
                                    "cost",       PAGEARG_NUMERIC,
                                    "formfields", PAGEARG_ARRAY,
                                    "unknown",    PAGEARG_ANYTHING);
      
      	OptionalPageArguments("canceled", PAGEARG_BOOLEAN);
      
        The first token in each pair is the name of the global variable to
        set, and the second token is the type. So, for "experiment" we look at
        the URL for a pid/eid or exptidx, etc, sanity check them (safe for a
        DB query), and then try to find that experiment in the DB. If it maps
        to an experiment, set global variable $experiment to the object. Since
        its a required argument, produce an error if not supplied. Similar
        treatment for optional arguments, with the obvious difference.
      
        The goal is to have ALL argument processing in one place, consistent,
        and correct. I've found numerous places where we leak unchecked
        arguments into queries. It also cuts out a lot of duplicated code.
      
      * To make the above easier to deal with, I've been replacing lots of
        hardcoded URLS in the code of the form:
      
      	foo.php3?pid=$pid&eid=$eid ...
      
        with
      
              CreateURL("foo", $experiment)
      
        which creates and returns the neccessary url string, by looking at
        the type of its arguments (experiment, template, instance, etc.)
      
        Eventually plan to replace them all so that URL handling throughout
        the code is all defined in one place (all the new URL code is in
        url_defs.php).
      
      * I have cranked up error reporting to tell me anytime a variable is
        used before it is initialized, plus a bunch of other stuff that PHP
        deems improper. Think of it like -Wall ... and boy we get a lot of
        warnings.  A very large percentage of the diffs are to fix all these
        warnings.
      
        The warnings are currently going to /usr/testbed/log/php-errors.log,
        and I'll be adding a script to capture them each night and mail them
        to tbops. This file also gets errors (this will be a change for
        developers; rather then seeing errors and warnings dumped in the
        middle of web pages, they will go to this file instead).
      
      * Major refactoring of the code. More objects (nodes, images, osids).
        Moving tons of queries into the objects in the hopes of someday
        getting to a point where we can split the web interface onto a
        different server.  Lots of general cleanup.
      48acc8e3
  16. 18 Jan, 2007 1 commit
  17. 05 Jan, 2007 1 commit
    • Leigh Stoller's avatar
      Move the core approval code from the web interface to the backend so · 5e25aa17
      Leigh Stoller authored
      that we can run project approval from the command line. Part of the
      ongoing push to get stuff out of php and into the backend ...
      
      The command line is now:
      
      	mkproj [-s] [-h leader_uid] [-m <message> | -f <file>] <pid>
      	switches and arguments:
      	  -s         - silent; do not send approval email to leader
        	  -h <uid>   - switch project leader to specified uid
      	  -m <text>  - Include text in approval email message
      	  -f <file>  - Include text from file in approval email message
      	  <pid>      - project to approve.
      
      Notes:
      
      * The leader can be switched to a new user only at initial project creation.
        Once a project is actually approved (created), its too late. We need
        more stuff in place to change the leader after that, and that code
        is not written yet.
      
      * Email is now sent from the backend script, so easier to recover from
        problems. When invoked from the web interface, the message text will
        be appended to the tberror email if the backend fails for some
        reason.  This should avoid the problem of that text getting lost and
        not being able to recover it.
      
      * The web interface still handles part of project denial internally.
        Move that later.
      5e25aa17
  18. 20 Dec, 2006 1 commit
  19. 03 Jul, 2006 1 commit
  20. 16 Jun, 2006 1 commit
  21. 06 Apr, 2006 1 commit
  22. 21 Dec, 2005 1 commit
  23. 19 Sep, 2005 1 commit
    • Leigh Stoller's avatar
      Move all modification of the group_membership table to the backend, · cfba1ac7
      Leigh Stoller authored
      into a single new script call modgroups. Usage:
      
      	modgroups [-a pid:gid:trust[,pid:gid:trust]...]
                        [-m pid:gid:trust[,pid:gid:trust]...]
                        [-r pid:gid[,pid:gid]...] user
      
      So, -a to add groups, -r to remove groups, and -m to modify the trust
      value for a member of a group.
      
      The reason for doing this is that previously, we had no idea in the
      backend what group changes actually happened; we just knew what the
      current groups are. This make it hard to add and remove users from
      mailing lists, chat server buddy lists, etc. This is cleaner ...
      cfba1ac7
  24. 13 May, 2005 1 commit
    • Leigh Stoller's avatar
      Automate initial user/project setup from setup-db.txt. Rather then · dd1b57bc
      Leigh Stoller authored
      have the user go through a set of hard to explain steps, just push
      them through it using the web interface.
      
      * New sitevars to control a little state machine used by the web
        interface.
      
      * When first setting up a testbed, the sitevar value will force the
        web interface to present the user with a single menu option "Create
        New Project" and the "Home" link will take the user to that page.
        The user is instructed to login is as elabman.
      
      * The user fills in the form as directed in setup-ops.txt. Even though
        he is logged in as elabman, the newproject form has been altered to
        operate as if no one is logged in. I also default a bunch more of
        the fields in this case.
      
      * The user submits the form. Rather then pend the new project, just
        jump straight into approveproject. That grinds along as usual, and
        when it is done, the elabman account is frozen and the user logged
        out. The user gets a link inviting him to log back in as the user
        just created.
      
      * Side effects of this new process:
      
      	* The user is made an admin user (admin=1) automatically.
      	* The user is added to the emulab-ops project as group_root.
      	* The user verification process is skipped.
      	* The user is added to the unixgroups wheel and tbadmin.
      
      * I reworked this entire section of setup-db.txt ...
      
      * The user still needs to give himself a real shell and password on
        boss, but I left that for the user to do explicitly. I also drop in
        a pointer to the shellonboss.txt. I might automate this part too at
        some point. Not sure yet.
      dd1b57bc
  25. 10 Jan, 2005 1 commit
  26. 09 Dec, 2003 1 commit
    • Leigh Stoller's avatar
      Add drop down menu to approve project form that allows admin person to · 9d882479
      Leigh Stoller authored
      select the default user interface for a project. The choice is current
      'emulab or 'plab', defaults to 'emulab'. New users that join emulab
      get the default user interface from the first project they join.
      
      Also generalize the plab_user bit as new "user_interface" slot of the
      users table, which is an enum of interface tokens, currently either
      'emulab' or 'plab', defaults to 'emulab'. The plab_user bit will be
      removed later.
      9d882479
  27. 05 Dec, 2003 1 commit
    • Leigh Stoller's avatar
      Move setting the node permission table for a project from the web · 4931fecf
      Leigh Stoller authored
      interface to the backend. mkproj now looks at the pcremote_ok set
      and makes the proper calls to grantnodetype. This reduces the amount
      of hardwired goo in the web interface.
      
      Still, there is a bit of hardwired stuff in mkproj. At present we do
      not form a relationship between a phys node type and the types we
      assign to the virtual nodes. Thats is, nothing says that a pcplabphys
      implies the right to use pcplabinet, etc. With only 3 remote phys
      types, I just hardwired it into mkproj calling grantnodetype with type
      pcplab (the class for the virtnodes) for pcplabphys. Same for pcron
      and pcwa, (both get pcvwa). Ultimately we need a better type system.
      In general the type system is pretty screwy.
      4931fecf
  28. 12 Sep, 2003 1 commit
  29. 12 May, 2003 1 commit
  30. 14 Apr, 2003 1 commit
  31. 11 Apr, 2003 1 commit
  32. 29 Mar, 2003 1 commit
    • Leigh Stoller's avatar
      Add target_pid,target_gid arguments to joinproject page so that · 26bccd9e
      Leigh Stoller authored
      we can send links that cause those fields to be filled in for people.
      Add those links to email generated by newproject and newgroup pages
      so that they can be saved by the leaders.
      
      Add a bit of referrer magic to login page. When clicked from the join
      or new project pages, tell login page to pass along the referrer page
      so that when login is complete, user is zapped back to the original
      page. This is especially nice when combined with the above change to
      joinproject, whereby we send along the target pid/gid, but the user
      has not yet logged in and remembers to do so via the link at the top
      of the page.
      26bccd9e
  33. 21 Mar, 2003 1 commit
  34. 25 Feb, 2003 1 commit
    • Robert Ricci's avatar
      Make sure that the head uid of a project is 'active' or 'unapproved' · 1ebdf309
      Robert Ricci authored
      before allowing a project to be approved. (In approveproject_form,
      this meant removing the automatic transition from 'newuser' to
      'unverified')
      
      Since this check is done in two places, once in the form, and once in
      the page that does the work, it's possible for this to get out of
      sync.
      1ebdf309
  35. 24 Jan, 2003 1 commit
  36. 01 Oct, 2002 1 commit
    • Robert Ricci's avatar
      Add a box to change the head of a project on the project approval · 39eb481b
      Robert Ricci authored
      'action' page. This will be used when a student applies to start
      a project - we'll have the professor, PI, etc. apply to join the
      project, then change the head UID when we approve it.
      
      Changing the head uid is repected when _any_ action is taken
      (postponing, more info requests, etc.) Any mail gets sent to the
      new head, and NOT the old head.
      39eb481b
  37. 16 Sep, 2002 1 commit
  38. 29 Jul, 2002 1 commit
    • Leigh Stoller's avatar
      Widearea permission changes: · d3c6f9c8
      Leigh Stoller authored
      * Two new fields on the new project page that ask the project leader to
        specify how many ron and pcplab nodes they need. There is a link to a
        page that should describe these nodes, but thats blank.
      
      * The project approval page will add a couple of checkboxes for ron and
        pcplab nodes. This will allow the project to be approved independent of
        the ron/pcplab usage. So, you can approve the project but decline the
        request to use those nodes types (or just one of them).
      
      * The project table in the DB has a "list" of remote node types for which
        accounts should be built. Its implemented as a set and it can contain
        just two node types (pcron, pcplab) right now. The set is created in
        the approval page, and someday we can add a page to operate on that
        set directly if we need it.
      d3c6f9c8
  39. 10 Jul, 2002 1 commit
  40. 07 Jul, 2002 1 commit