Git Product home page Git Product logo

accessibility-insights-service's Introduction

Product Logo Accessibility Insights Service

Build Status codecov

Accessibility Insights Service is a service that can be used to scan websites for accessibility issues on a periodic basis. It is TypeScript project with shell scripts for install and update scenarios.

This project can be run in an Azure environment and can be set up easily using the install scripts provided.

Prerequisites

  • Git
  • Node.js v16
  • TypeScript
  • Yarn v3
  • Visual Studio Code
  • Docker Desktop
  • Ubuntu, WSL, Git Bash, or similar Linux environment

Building the code

1. Clone the repository

  • Clone the repository

    git clone https://github.com/Microsoft/accessibility-insights-service.git
  • Select the solution directory

    cd accessibility-insights-service

2. Install packages

  • Run yarn to install initial npm packages

    yarn install

3. Working from Visual Studio Code

  • Open workspace.code-workspace from .vscode\ folder under root directory.
  • On opening the workspace, it will suggest you to install the recommended extensions. Install them.

4. Build solution

  • Run yarn to build solution

       yarn build

5. Run before check-in

  • Run the below command to build, test, check file format styling and eslint issues
    yarn precheckin

Testing

1. Run unit tests

  • Run the below command from the command line to execute all unit tests

          yarn test

2. Run test in watch mode

  • Goto the package you want to watch for. You can run tests whenever source code is modified in watch mode.

          yarn watch:test

Deployment

  • Follow this README to deploy required Azure resources.

Debugging

To debug packages locally follow the generic steps below.

  1. Complete deployment of the service in your Azure subscription

  2. Run the following script to get the content of the .env plain text file:

          ./packages/resource-deployment/scripts/create-env-file-for-debug.sh -r <resourceGroupName>
  3. Create the .env plain text file under package root folder to debug it locally

  4. Debug selected package using Visual Studio Code selecting respective debug configuration

Telemetry and Monitoring

During deployment, the Azure dashboard will be created to track service metrics and telemetry data.

  • Documentation for all telemetry events sent can be found here
  • Documentation for the Azure dashboard created upon deployment can be found here

Contributing

All contributions are welcome! Please visit our Contributing page.

Contact us

Please file a Github Issue. We actively monitor PRs and issues.

Alternatively you may also ask questions on stackoverflow.com and tag them with an accessibility-insights tag.

Reporting security vulnerabilities

If you believe you have found a security vulnerability in this project, please follow these steps to report it. For more information on how vulnerabilities are disclosed, see Coordinated Vulnerability Disclosure.

accessibility-insights-service's People

Contributors

ahmedabdoortiga avatar alisonlomaka avatar brocktaylor7 avatar davetryon avatar dbjorge avatar dependabot-preview[bot] avatar dependabot[bot] avatar devaradhanm avatar flyingundertheradar avatar github-actions[bot] avatar haonliu avatar jgibson2019 avatar karanbirsingh avatar katydecorah avatar lamaks avatar lisli1 avatar madalynrose avatar manishsat avatar microsoftopensource avatar msftgits avatar mslonli avatar pownkel avatar robgallo avatar v-pchippalat avatar v-viyada avatar waabid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accessibility-insights-service's Issues

[Bug] Gracefully handle batch job manager restart

Currently the batch job manager terminates even there are corresponding scan tasks pending/running.

The expected job manager termination workflow:

  1. Stop queuing batch task
  2. Wait for pending task to complete
  3. Terminate job manager

[Bug] Add retries on 500/429 errors while fetching for auth token

The sdk doesnt seem to have retry on failure response(https://github.com/Azure/ms-rest-nodeauth/blob/adea8415de97a8076006fbd9948123d09dfdd78d/lib/credentials/msiAppServiceTokenCredentials.ts#L94). So we may need to add retry & caching, make class singleton for results returned by CredentialsProvider.

Refer https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#error-handling

Currently, in Azure function sometimes, we have received the below error in production:
Result: Failure

Exception: Error: MSI: Failed to retrieve a token from "http://127.0.0.1:41709/MSI/token/?resource=https%3A%2F%2Fvault.azure.net&api-version=2017-09-01" with an error: {"ExceptionMessage":"","ErrorCode":"service_unavailable","ServiceErrorCodes":null,"StatusCode":503,"Message":null,"CorrelationId":"8b0bb15d-11f7-4a3b-8fbb-3a55ca98a884"}
Stack: Error: MSI: Failed to retrieve a token from "http://127.0.0.1:41709/MSI/token/?resource=https%3A%2F%2Fvault.azure.net&api-version=2017-09-01" with an error: {"ExceptionMessage":"","ErrorCode":"service_unavailable","ServiceErrorCodes":null,"StatusCode":503,"Message":null,"CorrelationId":"8b0bb15d-11f7-4a3b-8fbb-3a55ca98a884"}
    at MSIAppServiceTokenCredentials.<anonymous> (D:\home\site\wwwroot\get-report-func\index.js:56446:23)
    at Generator.next (<anonymous>)
    at fulfilled (D:\home\site\wwwroot\get-report-func\index.js:56384:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] Inconsistent HTTP request singleton pattern

The solution had single logging provider Logger() in a corresponding library /Logger. To support HTTP request singleton pattern the new logging provider was introduced ContextAwareLogger(). The sparse usage of a new logging provider introduced inconsistent logging pattern where some packages use Logger() (for example the azure-services package) and web-api package uses ContextAwareLogger().

As result the Logger() indirectly being used in HTTP context where ContextAwareLogger() is used as well which do not let log context related event properly.

Expected implementation pattern

The context aware pattern should be implemented on IoC container level instead. Any other providers that require context awareness should be part on that container (like logging library). The context IoC container should follow HTTP request singleton pattern.

[Bug] Trace log does not properly expand object been logged

The object property should be expanded correctly for logging.

[Trace][error][properties - { source: 'webApiScanJobManager' }] === An error occurred while adding new task {"status":"ClientError","taskId":"task_dc2a1e5a-dfbb-4274-bc02-44c88d8ec512_1636d7dac58c76b95633","error":{"code":"InvalidPropertyValue","message":{"lang":"en-US","value":"The value provided for one of the properties in the request body is invalid.\nRequestId:9278f373-0952-4a07-a879-5b40af6698bd\nTime:2020-01-24T21:14:57.7025004Z"},"values":[{"key":"PropertyName","value":"name"},{"key":"PropertyValue","value":"TASK_ARGUMENTS"},{"key":"Reason","value":"Duplicate Environment Setting name"}]},"[email protected]":"https://..."} to the job on-demand-url-scan-schedule:job-35.
[Trace][info][properties - { '0': '[',
  '1': 'o',
  '2': 'b',
  '3': 'j',
  '4': 'e',
  '5': 'c',
  '6': 't',
  '7': ' ',
  '8': 'O',
  '9': 'b',
  '10': 'j',
  '11': 'e',
  '12': 'c',
  '13': 't',
  '14': ']',
  source: 'webApiScanJobManager' }] === Pool load statistics

[Bug] Add cost insights dashboard widget for prod subscription

Describe the bug
A clear and concise description of what the bug is.

Area

  • Install script
  • Update script
  • Service

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Log files
If applicable, any log files / console output that might help explain what the issue might be.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

[Bug] Requests storage queue size should correlate with batch pool size

To support scan priority processing the request storage queue size should be small enough to not hold priority scan request for too long. Optimal queue size should be 2x of a single batch processing ie priority message should be red no longer than 2x time of average single message processing.
To achieve this batch pool manager calculated size data need to be connected with scan request sender.

[Bug] Send response code of scanned url when asked for scan status.

Describe the bug

When the url requested for scan loads with failure error code, we don't send the error code returned by the page. We simply return state as httpErrorCode failure. It is better to always send the final response code of the scanned page.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] The batch scan task will not have scan DB state updated when terminated by Batch service

The Batch service will terminate long running scan tasks. In this case no corresponding state will be updated within Cosmom DB. The scan state will be marked as 'running'.

There should be a mechanism to handle batch scan tasks state after external termination. Either job manager should re-validate tasks states periodically or job scheduler post task should do re-validation.

[Bug] Scan request queue message is too large

The scan request queue message should be abstracted from Page document.

[Exception][properties - { source: 'scanRequestSender' }] === { VError: Error occurred while executing job: RequestBodyTooLargeThe request body is too large and exceeds the maximum permissible limit.
RequestId:72500c2d-1003-001a-1e51-33cfc4000000
Time:2019-07-05T16:46:24.4987695Z65536
at Logger.trackExceptionAny (/mnt/batch/tasks/workitems/scan-req-schedule/job-19/scan-req-sender-task/wd/sender.js:150998:29)
at ScanRequestEntryPoint. (/mnt/batch/tasks/workitems/scan-req-schedule/job-19/scan-req-sender-task/wd/sender.js:151392:24)
at Generator.throw ()
at rejected (/mnt/batch/tasks/workitems/scan-req-schedule/job-19/scan-req-sender-task/wd/sender.js:151350:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
jse_shortmsg: 'Error occurred while executing job',
jse_cause:
{ Error: RequestBodyTooLargeThe request body is too large and exceeds the maximum permissible limit.
RequestId:72500c2d-1003-001a-1e51-33cfc4000000
Time:2019-07-05T16:46:24.4987695Z65536
at new RestError (/mnt/batch/tasks/workitems/scan-req-schedule/job-19/scan-req-sender-task/wd/sender.js:20190:28)
at /mnt/batch/tasks/workitems/scan-req-schedule/job-19/scan-req-sender-task/wd/sender.js:19014:37
at process._tickCallback (internal/process/next_tick.js:68:7)
code: undefined,
statusCode: 413,

[Bug] Add retries for azure function code upload

Describe the bug

After deploying azure function, sometimes the function may not be available to publish code.
In this case running "func azure functionapp publish ..." will silently fail with log:

Publishing 'web-api' scripts to 'web-api-allyfuncappxjohj2cwcdj4c' Function App...
Can't find app with name "web-api-allyfuncappxjohj2cwcdj4c"
Successfully published 'web-api' scripts to 'web-api-allyfuncappxjohj2cwcdj4c' Function App.

We should check if the azure function exists & retry.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] Batch pool intermittent Internet connectivity may require scan run retry

The batch pool may experience intermittent Internet connectivity issue. This may require re-run failed scans.

{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded\n at Promise.then (/mnt/batch/tasks/shared/batch-web-api-scan-runner/node_modules/puppeteer/lib/LifecycleWatcher.js:142:21)\n -- ASYNC --\n at Frame. (/mnt/batch/tasks/shared/batch-web-api-scan-runner/node_modules/puppeteer/lib/helper.js:111:15)\n at Page.goto (/mnt/batch/tasks/shared/batch-web-api-scan-runner/node_modules/puppeteer/lib/Page.js:629:49)\n at Page. (/mnt/batch/tasks/shared/batch-web-api-scan-runner/node_modules/puppeteer/lib/helper.js:112:23)\n at Page. (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180776:55)\n at Generator.next ()\n at /mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180753:71\n at new Promise ()\n at module.exports.../scanner/dist/page.js.__awaiter (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180749:12)\n at Page.scanForA11yIssues (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180775:16)\n at Scanner. (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180897:40)\n -- ASYNC --\n at Page. (/mnt/batch/tasks/shared/batch-web-api-scan-runner/node_modules/puppeteer/lib/helper.js:111:15)\n at Page. (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180776:55)\n at Generator.next ()\n at /mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180753:71\n at new Promise ()\n at module.exports.../scanner/dist/page.js.__awaiter (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180749:12)\n at Page.scanForA11yIssues (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180775:16)\n at Scanner. (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180897:40)\n at Generator.next ()\n at fulfilled (/mnt/batch/tasks/workitems/on-demand-url-scan-schedule/job-1534/task_acb3de9c-3155-4779-9944-f8a7b3e9e7e5_81d9e3eee4a6701c083e/wd/web-api-scan-runner.js:180873:58) name: 'TimeoutError' }

[Bug] Limited schema validation can lead to wrong errors.

Describe the bug

{
    "url": "https://www.bing.com",
    "priority": 0
}

instead of

[
  {
    "url": "https://www.bing.com",
    "priority": 0
  }
]

will error on invalid url / 500 instead of malformed request and consequently be harder to debug for a consumer.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] Add documentation on release process

Describe the bug
A clear and concise description of what the bug is.

Area

  • Install script
  • Update script
  • Service

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Log files
If applicable, any log files / console output that might help explain what the issue might be.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

[Bug] Functions debugging documentation is no longer accurate.

Describe the bug

In general the documentation is very sparse. The documentation that is present is wrong (asks for the function host to be started" before starting the debug from VS Code. This isn't true. As a part of debugging it does start up the host.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] AZ API has been obsoleted and deployment script should be updated accordingly

The Cosmos DB related install scripts should be updated due to AZ API has been obsoleted

[setup-cosmos-db] Checking if database 'scanner' exists in Cosmos account ... in resource group ...
This command has been deprecated and will be removed in a future release. Use 'cosmosdb sql database, cosmosdb mongodb database, cosmosdb cassandra keyspace or cosmosdb gremlin database' instead.
This command is implicitly deprecated because command group 'cosmosdb database' is deprecated and will be removed in a future release. Use 'cosmosdb sql database, cosmosdb mongodb database, cosmosdb cassandra keyspace or cosmosdb gremlin database' instead.
[setup-cosmos-db] Checking if collection 'a11yIssues' exists in db 'scanner' of cosmosAccount ... in resource group ...
This command has been deprecated and will be removed in a future release. Use 'cosmosdb sql container, cosmosdb mongodb collection, cosmosdb cassandra table, cosmosdb gremlin graph or cosmosdb table' instead.
This command is implicitly deprecated because command group 'cosmosdb collection' is deprecated and will be removed in a future release. Use 'cosmosdb sql container, cosmosdb mongodb collection, cosmosdb cassandra table, cosmosdb gremlin graph or cosmosdb table' instead.
Adding secret for cosmosDbUrl in key vault ...
This command has been deprecated and will be removed in a future release. Use 'cosmosdb keys list' instead.

[Bug] Delete Legacy scan error handling ( string parsing in ScanRunErrorConverter)

Describe the bug

This has to be done after a month. (after Jan 1) so that all the old documents that has scanError as string would have been deleted.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] error response code not as expected.

Describe the bug

The rest api always returns 404 with no err message when any error occurs.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:
send a scan status get request with an invalid guid.

Expected behavior

the response should indicate that the input is not valid.

Log files

Screenshots

Additional context

[Feature] Remove batching from our API's

Is your feature request related to a problem? Please describe.

Spoke with @manishsat and he mentioned batching is no longer required and we should remove batching from our API spec and implementations.

Describe the solution you'd like

This work will include changing the API spec as well as cutting down unwanted code in the API layer only. Both submit and get will no longer be batched.

  • Post scans will take in a single URL with priority
  • There will be a single GET scan endpoint that takes in a single url. The batch endpoint will be dropped as part of a different feature.
  • The GET report endpoint remains unchanged.

Scope is limited to changing the API spec and API layer. Everything else will remain as is and everything underneath is still handled the same way. A separate feature will work to remove the flab and re-architect everything below the API layer.

Work with Uday and come up with a way to transition smoothly.

[Bug] Improve ICM alert actionable diagnostic information

Describe the bug
A clear and concise description of what the bug is.

Area

  • Install script
  • Update script
  • Service

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Log files
If applicable, any log files / console output that might help explain what the issue might be.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

[Bug] Logging when scanRequestSender & other components hit 429's on cosmosDB

Describe the bug

When the scan request sender hits 429's it fails (without logging to application insights).
Examples - https://github.com/microsoft/accessibility-insights-service/blob/master/packages/web-api-scan-request-sender/src/sender/on-demand-dispatcher.ts#L35

https://github.com/microsoft/accessibility-insights-service/blob/master/packages/web-api-scan-request-sender/src/sender/on-demand-scan-request-sender.ts#L20

We should go through our code and find all instances where we can possibly hit 429.

A common way of handling these would be great.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

We log the 429 into application insights along with appropriate data.

Log files

Running Scan request sender for on demand requests
[Trace][info][properties - { source: 'webApiScanRequestSender' }] === [Sender] Maximum queue size configuration set to 2000
[Trace][info][properties - { source: 'webApiScanRequestSender' }] === [Sender] Current queue size is 446
[Exception][properties - { source: 'webApiScanRequestSender' }] === { VError: Error occurred while executing action.
at Logger.trackExceptionAny (/mnt/batch/tasks/workitems/on-demand-scan-req-schedule/job-19760/on-demand-scan-req-sender-task/wd/sender.js:221355:29)
at WebApiScanRequestSenderEntryPoint. (/mnt/batch/tasks/workitems/on-demand-scan-req-schedule/job-19760/on-demand-scan-req-sender-task/wd/sender.js:222048:24)
at Generator.throw ()
at rejected (/mnt/batch/tasks/workitems/on-demand-scan-req-schedule/job-19760/on-demand-scan-req-sender-task/wd/sender.js:222005:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
jse_shortmsg: 'Error occurred while executing action.',
jse_info:
{ error:
{ code: 429,
body:
'{"code":"429","message":"Message: {\"Errors\":[\"Request rate is large\"]}\r\nActivityId: 262a7648-44a4-4e07-9b7f-13aaee548910, Request URI: /apps/4f5c042d-76fb-4ce6-bda3-517e6ef3984f/services/1ddcee52-6dbd-4f48-b37c-f554a4589315/partitions/025e9987-207d-48ed-99be-59cc04da3dc4/replicas/132136347263726188p/, RequestStats: \r\nRequestStartTime: 2019-10-21T11:50:41.6881406Z, RequestEndTime: 2019-10-21T11:50:41.6981437Z, Number of regions attempted:1\r\nResponseTime: 2019-10-21T11:50:41.6981437Z, StoreResult: StorePhysicalAddress: rntbd://cdb-ms-prod-westus2-fd2.documents.azure.com:16824/apps/4f5c042d-76fb-4ce6-bda3-517e6ef3984f/services/1ddcee52-6dbd-4f48-b37c-f554a4589315/partitions/025e9987-207d-48ed-99be-59cc04da3dc4/replicas/132136347263726188p/, LSN: 4981, GlobalCommittedLsn: 4981, PartitionKeyRangeId: , IsValid: True, StatusCode: 429, SubStatusCode: 3200, RequestCharge: 0.38, ItemLSN: -1, SessionToken: , UsingLocalLSN: False, TransportException: null, ResourceType: Document, OperationType: Delete\r\n, SDK: Microsoft.Azure.Documents.Common/2.7.0"}',
headers:
{ 'transfer-encoding': 'chunked',
'content-type': 'application/json',
'content-location':
'https://allycosmosli56mzbng5jpe-westus2.documents.azure.com/dbs/onDemandScanner/colls/scanRequests/docs/1e9f3f3e-8c41-6d81-017b-8b1566d09429',
server: 'Microsoft-HTTPAPI/2.0',
'x-ms-retry-after-ms': '897',
lsn: '4981',
'x-ms-schemaversion': '1.8',
'x-ms-quorum-acked-lsn': '4981',
'x-ms-substatus': '3200',
'x-ms-current-write-quorum': '3',
'x-ms-current-replica-set-size': '4',
'x-ms-xp-role': '1',
'x-ms-global-committed-lsn': '4981',
'x-ms-number-of-read-regions': '0',
'x-ms-transport-request-id': '2077',
'x-ms-cosmos-llsn': '4981',
'x-ms-cosmos-quorum-acked-llsn': '4981',
'x-ms-request-charge': '0.38',
'x-ms-serviceversion': 'version=2.7.0.0',
'x-ms-activity-id': '262a7648-44a4-4e07-9b7f-13aaee548910',
'strict-transport-security': 'max-age=31536000',
'x-ms-gatewayversion': 'version=2.7.0',
date: 'Mon, 21 Oct 2019 11:50:41 GMT',
'x-ms-throttle-retry-count': 9,
'x-ms-throttle-retry-wait-time-ms': 6728 },
activityId: '262a7648-44a4-4e07-9b7f-13aaee548910',
substatus: 3200,
retryAfterInMilliseconds: 897,
requestHeaders:
{ 'Cache-Control': 'no-cache',
'x-ms-version': '2018-06-18',
'User-Agent':
'linux/4.15.0-1060-azure Nodejs/v10.16.3 azure-cosmos-js/2.1.7',
'x-ms-documentdb-partitionkey': '["pageScanRequestDocuments"]',
'x-ms-date': 'Mon, 21 Oct 2019 11:50:34 GMT',
Accept: 'application/json',
authorization:
'type%3Dmaster%26ver%3D1.0%26sig%3DMiFlbUrqqyPz2zhn9tMWBfy9JRzdVL%2FbxgZd9FLNL0Y%3D' } } },
message: 'Error occurred while executing action.' }

Screenshots

Additional context

[Bug] GET scan result HTTP payload malformed when scan failed

The GET scan response HTTP payload malformed and contains misleading data (see below). The payload should be in the following format:

{
"scanId": "1e9dc9b0-2522-6411-f0d5-cc6817d96315",
"url": "https://support.microsoft.com/en-us",
"run": {
"state": "failed",
"timestamp": "2019-09-21T18:13:54.812Z",
"error": ""
}
}

Malformed payload:
{
"scanId": "1e9dc9b0-2522-6411-f0d5-cc6817d96315",
"url": "https://support.microsoft.com/en-us",
"scanResult": {
"state": "unknown",
"issueCount": 0
},
"reports": [
{
"reportId": "",
"href": "",
"format": "sarif"
}
],
"run": {
"state": "failed",
"timestamp": "2019-09-21T18:13:54.812Z",
"error": "{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded..."
}
}

[Bug] Move logs to storage account from Azure Batch

Describe the bug

Currently all the logs stdout/stderr) are sitting on the host machine and we will loose them, if we recycle/reimage the vms.

Area

  • Install script
  • Update script
  • [X ] Service

We need to make change while creating task from job manager to specify the location where we want logs to be generated.

https://docs.microsoft.com/en-us/azure/batch/batch-task-output-files

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] Building azure functions should be moved to build defintion

Describe the bug

Currently we are building the azure function app(dotnet build ont he csproj) in release definition before publishing. We should be building in the build definition instead & let the release definition do only the deployment.

Area

  • Install script
  • Update script
  • Service

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Log files

Screenshots

Additional context

[Bug] Establish staging validation process & add release notes support

Describe the bug
A clear and concise description of what the bug is.

Area

  • Install script
  • Update script
  • Service

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Log files
If applicable, any log files / console output that might help explain what the issue might be.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

[Bug] REST API scan result report link host should be APIM host

The REST API is exposed through Azure API Management service. The scan response report link should have APIM host name instead of Azure Function host name.

The Azure APIM should have policy added that set Forwarded HTTP header. The func app should use Forwarded host= header to set correct host name in a report link. Reference to Add a Forwarded header policy example.

{
"scanId": "1e9e4937-6a37-64e1-cfd4-85cdcfb8ec2e",
"url": "https://code.visualstudio.com/",
"scanResult": {
"state": "fail",
"issueCount": 6
},
"reports": [
{
"reportId": "1e9e493a-bd7c-61c0-bfcd-316aa1961397",
"format": "sarif",
"links": {
"rel": "self",
"href": "https://web-api-allyfuncappgghrfwzvmcdly.azurewebsites.net/api/scans/1e9e4937-6a37-64e1-cfd4-85cdcfb8ec2e/reports/1e9e493a-bd7c-61c0-bfcd-316aa1961397?api-version=1.0"
}
}
],
"run": {
"state": "completed",
"timestamp": "2019-10-01T21:37:30.587Z"
}
},

[Bug] Set correct content type for each response.

Describe the bug
In the get scan request the response header for content/type is currently set to text/plain. Should it perhaps bet set to "application/json" to better reflect what is being sent? Additionally all other requests should also set this header.

A possible solution would be to use a decorator class that would set the appropriate headers for all outgoing responses.

Area

  • Install script
  • Update script
  • Service

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Log files
If applicable, any log files / console output that might help explain what the issue might be.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

[Bug] Refactor OnDemandPageScanRunResultProvider API

Refactor OnDemandPageScanRunResultProvider API as follows:

  1. The updateScanRun() should return the updated document version that has been returned by underlying Azure Cosmos DB client on write operation. Missing this return value result read document after write that is redundant and expensive Cosmos operation

  2. Add single version APIs: readScanRun(), writeScanRun()

  3. The saveSarifReport() API should return the created blob path

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.