function main(sourceName = 'FULL_PATH_TO_SOURCE_FOR_FINDING') {
  // [START securitycenter_create_finding_with_source_properties]
  // Imports the Google Cloud client library.
  const {SecurityCenterClient} = require('@google-cloud/security-center');

  // Creates a new client.
  const client = new SecurityCenterClient();
  // sourceName is the full resource name of the source the finding should
  // be associated with.
  /*
   * TODO(developer): Uncomment the following lines
   */
  // const sourceName = "organizations/111122222444/sources/1234";

  // Use now as the eventTime for the security finding.
  const eventTime = new Date();
  async function createFinding() {
    const [newFinding] = await client.createFinding({
      parent: sourceName,
      findingId: 'findingwithprops',
      finding: {
        state: 'ACTIVE',
        // Resource the finding is associated with.  This is an
        // example any resource identifier can be used.
        resourceName:
          '//cloudresourcemanager.googleapis.com/organizations/11232',
        // A free-form category.
        category: 'MEDIUM_RISK_ONE',
        // The time associated with discovering the issue.
        eventTime: {
          seconds: Math.floor(eventTime.getTime() / 1000),
          nanos: (eventTime.getTime() % 1000) * 1e6,
        },
        sourceProperties: {
          s_value: {stringValue: 'string_example'},
          n_value: {numberValue: 1234},
        },
      },
    });
    console.log('New finding created: %j', newFinding);
  }
  createFinding();
  // [END securitycenter_create_finding_with_source_properties]
}
Demonstrates how to create a new security finding in CSCC with source
properties.