1. 27 Nov, 2006 1 commit
    • Leigh B. Stoller's avatar
      Call this commit "Snow in Corvallis" ... · 4998b2d7
      Leigh B. Stoller authored
      The major functional change in this revision is converting from user
      selected UIDs to system selected UIDs. This is controlled by the
      variable $USERSELECTUIDS in defs/defs.php3.in which is now set to
      zero, so system selected UIDs is the default.
      
      The algo for creating the uid is to take the email address, strip the
      @whatever from it, squeeze out dots and dashes and underlines, and
      make sure any +foo tokens are removed. Then make sure it is unique by
      taking the first 5 characters and then adding a 3 digit number,
      derived by checking the DB to see what exists.
      
      Since we will want to (more often) change the UID selected, there is a
      new admin only menu option on the Show User page. It calls the backend
      script to do the work (sbin/changeuid).
      
      The login page now defaults to storing and showing the email address
      for login, rather then the UID. It will still accept either one though
      (has for a long time).
      
      Along the way I also reorg'ed a number of pages to use the new user,
      group, and project classes and moved some common functionality into
      the class defs.
      
      Also changed the way addpubkey is called, to avoid some confusion.
      4998b2d7
  2. 15 Jun, 2006 1 commit
  3. 14 Jun, 2006 3 commits
  4. 08 Jun, 2006 1 commit
  5. 23 May, 2006 1 commit
  6. 08 May, 2006 1 commit
  7. 05 May, 2006 2 commits
  8. 19 Dec, 2005 1 commit
    • Leigh B. Stoller's avatar
      Add support for moving deleted users to a deleted users table. This · b4231fbf
      Leigh B. Stoller authored
      would be no big deal, except that we want to retain user_stats for
      deleted users, and rather then a deleted_user_stats table, I want to
      retain stats for deleted users in the user_stats table, since that
      is a more natural place for them.
      
      The main problem is that we use the login (uid) as the cross table
      reference slot all over the DB, which is fundamentally incorrect, if
      we want to be able reuse uids and still know what historical data
      refers to.
      
      So, I have taken a few baby steps towards weaning us off the uid, and
      towards permanently unique key for users, using the unix_uid integer
      for now, but probably something slightly different later.
      
      The user_stats is now indexed on this new key (called uid_idx in the
      users_stats table) instead of the plain uid.
      
      The unix_uid slot in the users table is no longer an auto_increment
      field, but instead uses the emulab_indicies table for the next
      available index.
      b4231fbf
  9. 15 Dec, 2005 1 commit
  10. 13 Nov, 2005 1 commit
  11. 21 Jul, 2005 1 commit
  12. 20 Apr, 2005 1 commit
  13. 29 Mar, 2005 1 commit
  14. 28 Mar, 2005 1 commit
    • Leigh B. Stoller's avatar
      Implement a cross machine login so that user is automatically logged · 9310dedb
      Leigh B. Stoller authored
      into the Wiki when clicking on the My Wiki's link. Works like this:
      
      * The My Wiki's link points to new page, gotowiki.php3, on boss.
      
      * The gotowiki page looks for a new cookie in the user's browser
        which holds a key (the usual random data run through md5).
      
      * If the key does not exist, generate it and store it in the user
        browser (expires when browser is closed or emulab login times out).
        Also invoke backend script wikixlogin, which will send the key over
        to the wiki server (via ssh), which will write the key into a file
        named by the user account.
      
      * The user's browser is redirected to the wiki server's login script
        (twiki/bin/newlogon), but instead of username and password, we send
        over username and key (as well as redurl= parameter which is the
        page on the wiki server to redirect to later).
      
      * The new login script looks for this case, and opens the file named
        by the user and compares the key it gets with what is in the file.
        If they match, the user login succeeds and the browser is once again
        redirected, but this time to the page it wants on the wiki server.
        If the key does not match, the browser is redirected to the login
        page (so user can enter username password normally). The redurl
        parameter is passed along as well.
      
      * Subsequent clicks on My Wiki's will not need to invoke the backend
        script, since the cookie will be in the browser.
      9310dedb
  15. 25 Mar, 2005 1 commit
    • Leigh B. Stoller's avatar
      Okay, I think I am finally done with WikiWhacking (or WhackingTheWiki?) · 90dcbbe2
      Leigh B. Stoller authored
      for the near future. Two big changes:
      
      * Add WikiOnly accounts. An external user can register for an account on
        the wiki. Rather then use the registration stuff that comes with TWiki,
        redirect to new Emulab web page so we can manage all of the wiki accounts
        from one place. I modified the joinproject page to spit out a subset of
        the required fields so that its simple to get a wiki only account (just a
        few things to fill in).
      
        In keeping with current security practices, we still generate a
        verification email message to ensure the email address works. However,
        when the user completes the verification, the wiki account is created right
        away, rather then waiting for someone to approve it (since that would
        defeat the entire point of the wiki).
      
        Aside: I have not thought much about the conversion from a wiki-only
        account to a real account. That is going to happen, and it would be nice
        if that step did not require one of use to go in and hack the DB. Will
        cross that moat later.
      
        Aside: Rather beat up on the modify user info page too much, I continue
        to spit out the same form, but mark most of the fields as not required,
        and allow wiki-only people to not specify them.
      
      * Both the joinproject and newproject pages sport a new WikiName field so
        that users can select their own WikiName. I added some JavaScript to
        both pages that generate a suitable wikiname from the FullName field, so
        that as soon as the user clicks out of the FullName, a default wikiname is
        inserted in the field.
      
        Both pages verify the wikinames by checking to make sure it is not
        already in use, and that it meets the WikiRules for WikiTopic names.
        (someone please shoot me if I continue to use WikiNotation).
      90dcbbe2
  16. 22 Mar, 2005 1 commit
  17. 29 Apr, 2004 1 commit
    • Leigh B. Stoller's avatar
      Add prelim support for using linktest. Because of problems, this is · 6cdccbd2
      Leigh B. Stoller authored
      currently available to only people with stud=1 status in the DB.
      
      * www/tbauth.php3: Add a STUDLY() function to check that bit.
      
      * www/linktest.php3: New page to run linktest on the fly. The level
        defaults to the current level in the experiments table, but you can
        override that via the form on the page.
      
      * www/showexp.php3: Add link to aforementioned page. STUDLY() only.
      
      * www/beginexp_form.php3: Add an option (selection) to set the linktest
        level for create/swapin. Defaults to 0 (no linktest). STUDLY() only.
      
      * www/editexp.php3: Add an option to edit the default linktest level
        for an experiment. STUDLY() only.
      
      * tbsetup/batchexp.in and tbsetup/swapexp.in: Add code to optionally run
        the linktest, sending email if it fails (exists with non-zero status).
        Failure does not affect the swapin.
      6cdccbd2
  18. 20 Jan, 2004 2 commits
  19. 16 Dec, 2003 1 commit
  20. 10 Dec, 2003 1 commit
  21. 09 Dec, 2003 1 commit
    • Leigh B. Stoller's avatar
      Add drop down menu to approve project form that allows admin person to · 9d882479
      Leigh B. 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
  22. 05 Dec, 2003 1 commit
  23. 04 Dec, 2003 1 commit
  24. 03 Dec, 2003 1 commit
  25. 02 Dec, 2003 2 commits
  26. 01 Dec, 2003 1 commit
    • Leigh B. Stoller's avatar
      Fix glitch with switching between browsers. Stems from the goal of not · 0efa7677
      Leigh B. Stoller authored
      switching the menu when user switches between http and https (since
      the secret cookie is not transferred in http, we have no way of
      actually knowing the user is logged in from the browser). So, add
      another cookie that is a crc32 hash of the real cookie, and trasnfer
      that in http mode. A valid crc32 hash simply indicates that the user
      is almost certainly logged in from the browser (but does not impart
      any privs until we get the real cookie), while the absence of the
      crc32 or a mismatch indicates that user is almost certainly *not*
      logged in from the browser, and so we draw the usual "not logged in"
      page.
      0efa7677
  27. 26 Nov, 2003 1 commit
  28. 18 Nov, 2003 1 commit
  29. 17 Nov, 2003 1 commit
    • Leigh B. Stoller's avatar
      Add web login attack detection/prevention. Two changes: · b1de9fb2
      Leigh B. Stoller authored
      * Add slots to users table to track number of failures in the last N
        seconds. If a threshold is passed (currently 4 failures in the last
        minute), the web login is disabled. Note that I do not disable the
        ops shell login at this time. Aging is passive; the values are cleared
        when login is successful, or when more then one minute has passed
        since the last failure. In other words, a burst of failures will
        disable the login, but failures over time are okay.
      
      * Add login_failures table to do exactly the same as above, except it
        is on an IP basis (REMOTE_ADDR in the server). Currently the
        threshold is 8 failures in the last two minutes, at which time all
        logins from that IP are disabled.
      
      In both cases email is sent to tbops (and the user).
      
      The constants are defined at the top of www/tbauth.in, rather then as
      site variables, to avoid pounding the DB when an attack is being
      launched.
      
      To clear a user freeze, go to the user profile page and use the
      "toggle" near the bottom.
      
      To clear an IP freeze: delete from login_failures were IP='1.1.1.1'
      b1de9fb2
  30. 10 Nov, 2003 1 commit
  31. 09 Nov, 2003 1 commit
    • Leigh B. Stoller's avatar
      More security hacking. · 754d8013
      Leigh B. Stoller authored
      * Add TBvalid_uid() function to regex uid's. To be used throughout the
        system. Eventually add routines for checking other things like pids
        and eids, etc.
      
      * Regex the uid value we get from the cookie, and switch to $_COOKIE
        superglobal.
      
      * Strict regex checking in DOLOGIN() of uid.
      
      * Change login.php to use superglobals, and general tightening of
        parameter checking.
      754d8013
  32. 06 Jun, 2003 1 commit
    • Chad Barb's avatar
      · 2fad09a4
      Chad Barb authored
      NetBuild modify. Woot.
      
      Available only to admins for now.
      
      Link is available off "modify experiment page" in admin mode.
      2fad09a4
  33. 04 Jun, 2003 1 commit
  34. 15 May, 2003 1 commit
    • Mac Newbold's avatar
      Fix the relogin stuff according to a couple of requests: · 37db313e
      Mac Newbold authored
       - Don't use the image, just use a text link. (Note: the text link in the
         middle is different than the button link on the left, since the button
         doesn't set refer=1.) (From Rob/Chad)
       - Don't jump back into admin mode just because I was before. Let it dump
         me back to green dot when I log back in. (From Leigh)
      37db313e
  35. 06 May, 2003 1 commit
    • Mac Newbold's avatar
      Fix a nit and a long-standing bug. · 668287a2
      Mac Newbold authored
      If I was red dot when my login timed out (or whatever) the login link
      should go back to admin mode after I log in.
      
      The bug was that by the time I get into loggedinordie, if my login isn't
      valid, getuid fails, and uid is "", instead of what the cookie said. This
      caused it always just to say "You do not appear to be logged in!" instead
      of the real error (ie timed out, etc). So if uid=="", grab the uid from
      the cookie instead of checking things for nobody.
      668287a2