diff options
3 files changed, 104 insertions, 49 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index ab0be0819..4b9a1d2fb 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -859,7 +859,6 @@ sub post_bug_after_creation { my ($self, $args) = @_; my $vars = $args->{vars}; my $bug = $vars->{bug}; - my $template = Bugzilla->template; if (Bugzilla->input_params->{format} && Bugzilla->input_params->{format} eq 'employee-incident' @@ -868,9 +867,12 @@ sub post_bug_after_creation { my $error_mode_cache = Bugzilla->error_mode; Bugzilla->error_mode(ERROR_MODE_DIE); - my $new_bug; + my $template = Bugzilla->template; + my $cgi = Bugzilla->cgi; + + my ($investigate_bug, $ssh_key_bug); + my $old_user = Bugzilla->user; eval { - my $old_user = Bugzilla->user; Bugzilla->set_user(Bugzilla::User->new({ name => 'nobody@mozilla.org' })); my $new_user = Bugzilla->user; @@ -880,13 +882,15 @@ sub post_bug_after_creation { Bugzilla::Group->new({ name => 'infra' }), Bugzilla::Group->new({ name => 'infrasec' }) ]; - my $comment; - $vars->{no_display_action_needed} = 1; + my $recipients = { changer => $new_user }; $vars->{original_reporter} = $old_user; + + my $comment; + $cgi->param('display_action', ''); $template->process('bug/create/comment-employee-incident.txt.tmpl', $vars, \$comment) || ThrowTemplateError($template->error()); - $new_bug = Bugzilla::Bug->create({ + $investigate_bug = Bugzilla::Bug->create({ short_desc => 'Investigate Lost Device', product => 'mozilla.org', component => 'Security Assurance: Incident', @@ -900,17 +904,39 @@ sub post_bug_after_creation { version => 'other', dependson => $bug->bug_id, }); - - my $recipients = { changer => $new_user }; - Bugzilla::BugMail::Send($new_bug->id, $recipients); + $bug->set_all({ blocked => { add => [ $investigate_bug->bug_id ] }}); + Bugzilla::BugMail::Send($investigate_bug->id, $recipients); Bugzilla->set_user($old_user); + $vars->{original_reporter} = ''; + $comment = ''; + $cgi->param('display_action', 'ssh'); + $template->process('bug/create/comment-employee-incident.txt.tmpl', $vars, \$comment) + || ThrowTemplateError($template->error()); + + $ssh_key_bug = Bugzilla::Bug->create({ + short_desc => 'Disable/Regenerate SSH Key', + product => $bug->product, + component => $bug->component, + bug_severity => 'critical', + cc => $bug->cc, + groups => [ map { $_->{name} } @{ $bug->groups } ], + comment => $comment, + op_sys => 'All', + rep_platform => 'All', + version => 'other', + dependson => $bug->bug_id, + }); + $bug->set_all({ blocked => { add => [ $ssh_key_bug->bug_id ] }}); + Bugzilla::BugMail::Send($ssh_key_bug->id, $recipients); }; + my $error = $@; + Bugzilla->set_user($old_user); Bugzilla->error_mode($error_mode_cache); - if ($@ || !$new_bug) { - warn "Failed to create secondary employee-incident bug: $@" if $@; + if ($error || !$investigate_bug || !$ssh_key_bug) { + warn "Failed to create additional employee-incident bug: $error" if $error; $vars->{'message'} = 'employee_incident_creation_failed'; } } diff --git a/extensions/BMO/template/en/default/bug/create/comment-employee-incident.txt.tmpl b/extensions/BMO/template/en/default/bug/create/comment-employee-incident.txt.tmpl index ebd700e16..1b0902d64 100644 --- a/extensions/BMO/template/en/default/bug/create/comment-employee-incident.txt.tmpl +++ b/extensions/BMO/template/en/default/bug/create/comment-employee-incident.txt.tmpl @@ -25,14 +25,20 @@ Reporter: [% original_reporter.identity FILTER none %] [%- END -%] - [% IF !no_display_action_needed %] -Action needed: Please immediately reset the LDAP password for this user. -The user reported that their mobile or laptop device has been lost or stolen. -This ticket was automatically generated from the employee incident reporting -form. A second ticket has been filed (see blocker bugs) for InfraSec to review the -impact of this lost device. + [% IF cgi.param('display_action') %] + [% IF cgi.param('display_action') == 'ldap' %] +Action needed: Please immediately reset the LDAP password for this user. + [% ELSIF cgi.param('display_action') == 'ssh' %] +Action needed: Please immediately disable the SSH key for this user. + [% END %] + +The user reported that their mobile or laptop device has been lost or stolen. +This ticket was automatically generated from the employee incident reporting +form. An additional ticket has been filed (see blocker bugs) for InfraSec to +review the impact of this lost device. [% END %] +Type of device: [% cgi.param('device') %] Was the device encrypted?: [% cgi.param('encrypted') %] Any user data on the device?: [% cgi.param('userdata') %] [% IF cgi.param('userdata') == 'Yes' %] diff --git a/extensions/BMO/template/en/default/bug/create/create-employee-incident.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-employee-incident.html.tmpl index df7ba24df..2bbacdb12 100644 --- a/extensions/BMO/template/en/default/bug/create/create-employee-incident.html.tmpl +++ b/extensions/BMO/template/en/default/bug/create/create-employee-incident.html.tmpl @@ -18,19 +18,18 @@ # David Lawrence <dkl@mozilla.com> #%] -[% PROCESS global/variables.none.tmpl %] - -[% PROCESS global/header.html.tmpl - title = "Mozilla Corporation/Foundation Employee Incident" +[% PROCESS global/variables.none.tmpl %] + +[% PROCESS global/header.html.tmpl + title = "Mozilla Corporation/Foundation Employee Incident" %] - -[% USE Bugzilla %] + +[% USE Bugzilla %] <script type="text/javascript"> -<!-- var type_desc = new Array(); type_desc['safety'] = "If this is an emergency please immediately call your local police or emergency number."; - type_desc['stolen'] = "Please report a lost Mozilla laptop or any mobile device that was used to access<br> " + + type_desc['stolen'] = "Please report a lost Mozilla laptop or any mobile device that was used to access<br> " + "Mozilla email or contained passwords for Mozilla servers, devices, applications, etc."; function validateAndSubmit() { @@ -45,6 +44,9 @@ var select = YAHOO.util.Dom.get('incident_type'); var selectValue = select.options[select.selectedIndex].value; if (selectValue == 'stolen') { + if (!isFilledOut('device')) { + alert_text += "Please provide the type of device.\n"; + } if (!isFilledOut('encrypted')) { alert_text += "Please answer whether the device was encrypted.\n"; } @@ -87,18 +89,20 @@ // Alter the product/component/group based on type selected if (selectValue == 'stolen') { - document.getElementById('product').value = 'mozilla.org'; - document.getElementById('component').value = 'Server Operations: Desktop Issues'; - document.getElementById('groups').value = 'infra'; - document.getElementById('cc').value = 'mcoates@mozilla.com, jstevensen@mozilla.com, afowler@mozilla.com'; - document.getElementById('bug_severity').value = 'critical'; + document.getElementById('product').value = 'mozilla.org'; + document.getElementById('component').value = 'Server Operations: Desktop Issues'; + document.getElementById('groups').value = 'infra'; + document.getElementById('cc').value = 'mcoates@mozilla.com, jstevensen@mozilla.com, afowler@mozilla.com'; + document.getElementById('bug_severity').value = 'critical'; + document.getElementById('display_action').value = 'ldap'; } else { - document.getElementById('product').value = 'Mozilla Corporation'; - document.getElementById('component').value = 'Facilities Management'; - document.getElementById('groups').value = 'hr'; - document.getElementById('cc').value = 'dcohen@mozilla.com, mcoates@mozilla.com, jill@mozilla.com'; - document.getElementById('bug_severity').value = 'normal'; + document.getElementById('product').value = 'Mozilla Corporation'; + document.getElementById('component').value = 'Facilities Management'; + document.getElementById('groups').value = 'hr'; + document.getElementById('cc').value = 'dcohen@mozilla.com, mcoates@mozilla.com, jill@mozilla.com'; + document.getElementById('bug_severity').value = 'normal'; + document.getElementById('display_action').value = ''; } } @@ -115,21 +119,20 @@ } function isFilledOut(elem_id) { - var str = document.getElementById(elem_id).value; - return str.length > 0 && str != "noneselected"; - } + var str = document.getElementById(elem_id).value; + return str.length > 0 && str != "noneselected"; + } YAHOO.util.Event.onDOMReady(function () { setType(document.getElementById('incident_type')); toggleEnabled('userdata', 'Yes', 'sensitivedata'); toggleEnabled('rememberpasswords', 'Yes', 'criticalsites'); }); -// --> </script> <p><strong>Please use this form for employee incidents only!</strong></p> <p>If you have a [% terms.bug %] to file, go <a href="enter_bug.cgi">here</a>.</p> -<p><span style="color: red;">*</span></strong> Required Fields</p> +<p><span style="color: red;">*</span> Required Fields</p> <form method="post" action="post_bug.cgi" id="incidentForm" enctype="multipart/form-data" onSubmit="return validateAndSubmit();"> <input type="hidden" id="product" name="product" value=""> @@ -142,6 +145,7 @@ <input type="hidden" id="groups" name="groups" value=""> <input type="hidden" id="format" name="format" value="employee-incident"> <input type="hidden" id="bug_severity" name="bug_severity" value=""> + <input type="hidden" id="display_action" name="display_action" value=""> <input type="hidden" id="token" name="token" value="[% token FILTER html %]"> <table> @@ -161,7 +165,7 @@ <strong><span style="color: red;">*</span> Summary:</strong> </td> <td> - <input name="short_desc" id="short_desc" size="60" + <input name="short_desc" id="short_desc" size="60" value="[% short_desc FILTER html %]"> </td> </tr> @@ -173,6 +177,25 @@ <table> <tr> <td> + <label for="device"> + <strong><span style="color: red;">*</span></strong> + Type of device lost: + </label> + </td> + <td> + <select name="device" id="device"> + <option value="">---</option> + <option value="Mobile Phone">Mobile Phone</option> + <option value="Tablet">Tablet</option> + <option value="Laptop">Laptop</option> + <option value="WorkStation">WorkStation</option> + <option value="Portable Storage Device">Portable Storage Device</option> + <option value="Other">Other (describe in 'Extra Notes')</option> + </select> + </td> + </tr> + <tr> + <td> <label for="encrypted"> <strong><span style="color: red;">*</span></strong> To your knowledge, was your device encrypted? @@ -181,7 +204,7 @@ <td> <select name="encrypted" id="encrypted"> <option value="">---</option> - <option value="No">No</option> + <option value="No">No</option> <option value="Yes">Yes</option> </select> </td> @@ -197,10 +220,10 @@ <select name="userdata" id="userdata" onchange="toggleEnabled('userdata', 'Yes', 'sensitivedata');"> <option value="">---</option> - <option value="No">No</option> + <option value="No">No</option> <option value="Yes">Yes</option> </select> - </td> + </td> </tr> </table> </td> @@ -220,13 +243,13 @@ <td> <label for="rememberpasswords"> <strong><span style="color: red;">*</span></strong> - Was your browser configured to remember passwords + Was your browser configured to remember passwords (<a href="http://support.mozilla.com/en-US/kb/make-firefox-remember-usernames-and-passwords">more info</a>)? </label> - <select name="rememberpasswords" id="rememberpasswords" + <select name="rememberpasswords" id="rememberpasswords" onchange="toggleEnabled('rememberpasswords', 'Yes', 'criticalsites');"> <option value="">---</option> - <option value="No">No</option> + <option value="No">No</option> <option value="Yes">Yes</option> </select> </td> @@ -249,7 +272,7 @@ [% comment FILTER html %]</textarea> </td> </tr> - <tr> + <tr> <td> </td> <td> <input type="submit" id="commit" value="Submit Request"> @@ -262,4 +285,4 @@ Thanks for contacting us. You will be notified by email of any progress made in resolving your request. </p> -[% PROCESS global/footer.html.tmpl %] +[% PROCESS global/footer.html.tmpl %] |