Importing Answers to Security Questions from a CSV file

Christopher Dakin

This article will show you how to use a comma separated file to perform a bulk import of Security Questions answers for your users, using a worked example.

We will first create a task to import a CSV file and then chain that to an Import Q&A task.

 

Gathering information

First, we need to know what the text of the Questions is that we are wanting to provide answers for.

Go to Authentication Flows->Questions and look at the Questions text. Copy each of these questions and paste them into a new CSV file.

If the Question text does not match in the import task, then new questions with the text you provide will be created.

 

 

Now create a CSV file with one line per answer. 

For the example here, we will use username, question and answer.

This example file has answers for 5 questions for 3 user accounts.

 

Our example file with 3 users looks like this:

testuser,What is the name of your first school?,school
testuser,What is your father's first name?,father
testuser,What is your mother's maiden name?,mother
testuser,What was your first pet's name?,petname
testuser,Where were you born?,sometown
testuser.one,What is the name of your first school?,school
testuser.one,What is your father's first name?,father
testuser.one,What is your mother's maiden name?,mother
testuser.one,What was your first pet's name?,petname
testuser.one,Where were you born?,sometown
testuser.two,What is the name of your first school?,school
testuser.two,What is your father's first name?,father
testuser.two,What is your mother's maiden name?,mother
testuser.two,What was your first pet's name?,petname
testuser.two,Where were you born?,sometown

 

Creating the automation to import the file

Go to Automations. Click Create.

Give the new Automation a name and start typing in Import CSV in the task, and select this when it appears.

Take note of the Quote and Delimiter characters and ensure these match with the format of the CSV file you will be creating. You may want to change the Quote character as the default questions have apostrophes in them, therefore we'll change the Quote char to a double quote(") instead.

 

Select the Source tab.

For the Source, you may choose Upload (and upload the CSV file), Path (to read the file from a path directly on the LogonBox server) or Text (where you can paste the CSV text directly into a text field).

For this example. We select Upload, then click on Choose File and select the file.

Next, define the number of columns in the file in the Columns field. Our example has 3.

Then set whether the file has headers our not. The example does not so this can be left off.

 

As this will be a one time import, you may skip the Schedule tab.

In the Transaction tab, you can opt to turn on Fire Events. This will cause Audit Log events to be recorded. For this example, we will turn on Fire Events.

Transaction Required can be useful when chaining events as in this article, to protect the database from any corruption in the case of any failures, so turn this on also.

 

On the Repeat tab, leave Repeat as Never and Every as 0, as we will be triggering this automation manually.

In the Notes tab, you can optionally enter some information as to what you have created this trigger for if you want.

Click Create to create the new Automation.

You will now see the newly created Automation. Click on the + symbol to its left to expand the Automation. Now click on the + icon in the Import module, this will chain a new task to this one.

 

Creating the answers automation

For the chained automation, give it a name such as Create Answers.

The event will already be filled with Import CSV which is correct.

Set the Triggers On to Success (i.e we only want the system to create users if the CSV file imported okay).

For Triggers Task, start typing in Import Q&A and select it from the list when it appears.

We have no specific conditions to meet so the Conditions tab can be left as default.

 

Select the Q&A tab. In Username click on the ${} button to the right, then select the appropriate column from your CSV file. As this was the first column in our example, we select ${attr.column1}.

Set the Question and Answer settings as per your preferences (in our example, ${attr.column2} and ${attr.column3} respectively).

Leave Assign to All as default.

 

Click Create to complete the automation.

The expanded Import automation now shows the chained triggers.

 

Running the Import

As we set this up with no Schedule or Repeat, this task is set to run only on demand.

When ready, click the green gears icon next to the automation and click Run Now.

 

The automation runs and your users have their security answers set.