Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 62 additions & 15 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@
{
"packageName": "@azure/core-http",
"projectFolder": "sdk/core/core-http",
"decoupledLocalDependencies": ["@azure/core-tracing"],
"decoupledLocalDependencies": [
"@azure/core-tracing"
],
"versionPolicyName": "core"
},
{
Expand Down Expand Up @@ -619,7 +621,9 @@
{
"packageName": "@azure/identity",
"projectFolder": "sdk/identity/identity",
"decoupledLocalDependencies": ["@azure/keyvault-keys"],
"decoupledLocalDependencies": [
"@azure/keyvault-keys"
],
"versionPolicyName": "client"
},
{
Expand Down Expand Up @@ -2126,6 +2130,11 @@
"packageName": "@azure/arm-playwrighttesting",
"projectFolder": "sdk/playwrighttesting/arm-playwrighttesting",
"versionPolicyName": "management"
},
{
"packageName": "@azure-rest/defender-easm-rest",
"projectFolder": "sdk/easm/defendereasm-rest",
"versionPolicyName": "client"
}
]
}
}
8 changes: 5 additions & 3 deletions sdk/easm/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.

trigger:
branches:
include:
Expand All @@ -9,22 +9,24 @@ trigger:
paths:
include:
- sdk/iot/

pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/easm/

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: easm
Artifacts:
- name: azure-easm-defender
safeName: azureeasmdefender
- name: azure-rest-defender-easm-rest
safeName: azurerestdefendereasmrest
11 changes: 11 additions & 0 deletions sdk/easm/defendereasm-rest/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["@azure/azure-sdk"],
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
"rules": {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"tsdoc/syntax": "warn"
}
}
59 changes: 59 additions & 0 deletions sdk/easm/defendereasm-rest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Azure Easm REST client library for JavaScript

Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop clients that integrate with your application.

**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**

Key links:

- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/easm/defendereasm-rest)
- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/defender-easm-rest)
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/defender-easm-rest?view=azure-node-preview)
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/easm/defendereasm-rest/samples)

## Getting started

### Currently supported environments

- LTS versions of Node.js

### Prerequisites

- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.

### Install the `@azure-rest/defender-easm-rest` package

Install the Azure Easm REST client REST client library for JavaScript with `npm`:

```bash
npm install @azure-rest/defender-easm-rest
```

### Create and authenticate a `EasmClient`

To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
provide an instance of the desired credential type obtained from the
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.

To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)

After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
can be used to authenticate the client.

Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET

## Troubleshooting

### Logging

Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

```javascript
const { setLogLevel } = require("@azure/logger");

setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
31 changes: 31 additions & 0 deletions sdk/easm/defendereasm-rest/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./types/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/defender-easm-rest.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
Loading