Product Update: New Identity APIs

👋Hi folks, Tim Jarrett, Veracode PM here. We are pleased to announce the upcoming availability of Veracode's newest REST APIs, the Identity APIs for managing users, teams, business units, and API credentials. The new APIs are designed to do everything the old Admin XML APIs did, and then some. Specifically, they will allow you to:

  • Create, read, update and delete users and teams
  • NEW: Create, read, update and delete API service accounts (aka API users)
  • Search for a user by username
  • NEW: Create, read, update and delete business units
  • Add users to teams
  • Add teams to business units
  • NEW: Administrator can view API credential expiration dates and revoke API credentials
  • NEW: User can read view API credential expiration dates, revoke API credentials and generate new credentials

We're excited about these APIs because they'll allow for a lot of automation when onboarding a new application. For instance, you will be able to write a script that automatically creates a team and an API service account for pipeline automation at the same time that you create the application profile.

 

The API documentation will be available in the Help Center with our next release, currently scheduled for this Thursday night. Let us know if you have questions!

 


VCode likes this.
  • ABacchi035478 (Community Member)

    My team is thrilled to see this become a reality! Very excited about being able to systematically create API accounts and also see the expiration of keys.

  • ABacchi035478 (Community Member)

    Hey @Tim J (Veracode PM) (Veracode)​ can you provide an example on how to create an API service account? As in the minimum required parameters?

  • Hi @ABacchi035478 (Community Member)​ -- great question! We actually have an article working its way toward the Help Center that will provide some samples for some of the more common Identity API use cases, but I can give you a preview now. For the sake of this illustration, I'll assume you're using httpie.

     

    The command is pretty simple:

     

    http --auth-type=veracode_hmac POST "https://api.veracode.com/api/authn/v2/users" < input.json

     

    The contents of the JSON must include the following attributes for an API user:

    • user_name
    • first_name
    • last_name
    • email_address
    • active: "true"
    • roles -- see below
    • teams -- required if not creating an unlimited user, see below
    • permissions: [ {"permission_name": "api_user"}] -- this step is critical because it sets up the user as an API user rather than a human user

    You may also want to include IP restriction settings or so on, but that's enough to get started.

     

    For roles, we have both the formal platform roles and some additional permissions that are also entered as "roles" for the purposes of the API command. These include:

    • Supported API families:
      • submitterapi, uploadapi, resultsapi, mitigationapi, archerreports, greenlightapiuser, adminapi
    • Upload and scan type permissions:
      • staticuploadapi, apisubmitstaticscan, apisubmitdynamicscan, apisubmitmanualscan, apisubmitanyscan
    • Additional permissions: -- this allows creating an API user without team restrictions
      • noteamrestrictionapi

     

    For teams, you add another element that includes an array of the team_names you are including:

     

    "teams": [

      {

       "team_name": "Team One"

      },

     {

       "team_name": "Team Two"

      }

     ]

     

    So a sample JSON payload might look something like this:

    {

    "user_name": "exampleapiuser",

    "first_name": "Example",

    "last_name": "APIuser",

    "email_address": "exampleapiuser@example.com",

    "ip_restricted": false,

    "active": true,

    "teams": [

      {

       "team_name": "Team One"

      },

     {

       "team_name": "Team Two"

      }

     ],

    "roles": [

    {

    "role_name": "apisubmitanyscan"

    },

    {

    "role_name": "uploadapi"

    },

    {

    "role_name": "resultsapi"

    }

    ],

    "permissions": [

    {

    "permission_name": "apiUser"

    }

    ]

    }

     

    Hope this is helpful!

    Expand Post
  • AUB-1 (Community Member)

    @Tim J (Veracode PM) (Veracode)​ The documentation available, aside from the definitions on SwaggerHub and help.veracode.com is minimal, to say the least.

     

    For example, there is no available documentation that describes the allowed values of User Roles when creating users via POST through the /v2/users end point. Same with Team Memberships.

     

    Also, the base API is http://api.veracode.com/api/authn and not https://api.veracode.com/api/authn/v2/ as documented on SwaggerHub, as discussed earlier.

     

    The goal here is to be able to create users programmatically, which becomes a necessity when an organization has hundreds of developers. Please advise.

     

    Expand Post
    • PSheffield153543 (Community Member)

      Hey AUB!

      I have been working on a Python script to take CLI input and run the API calls to create API Accounts, I'm sure you could probably adapt it to create user accounts. If you want I can send you a PM!

  • Hi folks, just a note to say that based on customer feedback we've added a new search option on the /users endpoint that allows finding users by email address. Example syntax:

     

    https://api.veracode.com/api/authn/v2/users?email_address=bob%40example.com,sue%40example.com

     

    Please note that you can pass more than one email address, separated by commas, and that you need to URL encode the email addresses (e.g. replace @ with %40).

     

    We will be updating the Help Center for this soon, but wanted to let folks know that this option is now available.

    Expand Post

Topics (7)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.