1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
// This file is @generated by prost-build.
/// Defines a custom error message used by CreateScanConfig and UpdateScanConfig
/// APIs when scan configuration validation fails. It is also reported as part of
/// a ScanRunErrorTrace message if scan validation fails due to a scan
/// configuration error.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanConfigError {
/// Output only. Indicates the reason code for a configuration failure.
#[prost(enumeration = "scan_config_error::Code", tag = "1")]
pub code: i32,
/// Output only. Indicates the full name of the ScanConfig field that triggers this error,
/// for example "scan_config.max_qps". This field is provided for
/// troubleshooting purposes only and its actual value can change in the
/// future.
#[prost(string, tag = "2")]
pub field_name: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ScanConfigError`.
pub mod scan_config_error {
/// Output only.
/// Defines an error reason code.
/// Next id: 44
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Code {
/// There is no error.
Unspecified = 0,
/// Indicates an internal server error.
/// Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown.
InternalError = 1,
/// One of the seed URLs is an App Engine URL but we cannot validate the scan
/// settings due to an App Engine API backend error.
AppengineApiBackendError = 2,
/// One of the seed URLs is an App Engine URL but we cannot access the
/// App Engine API to validate scan settings.
AppengineApiNotAccessible = 3,
/// One of the seed URLs is an App Engine URL but the Default Host of the
/// App Engine is not set.
AppengineDefaultHostMissing = 4,
/// Google corporate accounts can not be used for scanning.
CannotUseGoogleComAccount = 6,
/// The account of the scan creator can not be used for scanning.
CannotUseOwnerAccount = 7,
/// This scan targets Compute Engine, but we cannot validate scan settings
/// due to a Compute Engine API backend error.
ComputeApiBackendError = 8,
/// This scan targets Compute Engine, but we cannot access the Compute Engine
/// API to validate the scan settings.
ComputeApiNotAccessible = 9,
/// The Custom Login URL does not belong to the current project.
CustomLoginUrlDoesNotBelongToCurrentProject = 10,
/// The Custom Login URL is malformed (can not be parsed).
CustomLoginUrlMalformed = 11,
/// The Custom Login URL is mapped to a non-routable IP address in DNS.
CustomLoginUrlMappedToNonRoutableAddress = 12,
/// The Custom Login URL is mapped to an IP address which is not reserved for
/// the current project.
CustomLoginUrlMappedToUnreservedAddress = 13,
/// The Custom Login URL has a non-routable IP address.
CustomLoginUrlHasNonRoutableIpAddress = 14,
/// The Custom Login URL has an IP address which is not reserved for the
/// current project.
CustomLoginUrlHasUnreservedIpAddress = 15,
/// Another scan with the same name (case-sensitive) already exists.
DuplicateScanName = 16,
/// A field is set to an invalid value.
InvalidFieldValue = 18,
/// There was an error trying to authenticate to the scan target.
FailedToAuthenticateToTarget = 19,
/// Finding type value is not specified in the list findings request.
FindingTypeUnspecified = 20,
/// Scan targets Compute Engine, yet current project was not whitelisted for
/// Google Compute Engine Scanning Alpha access.
ForbiddenToScanCompute = 21,
/// User tries to update managed scan
ForbiddenUpdateToManagedScan = 43,
/// The supplied filter is malformed. For example, it can not be parsed, does
/// not have a filter type in expression, or the same filter type appears
/// more than once.
MalformedFilter = 22,
/// The supplied resource name is malformed (can not be parsed).
MalformedResourceName = 23,
/// The current project is not in an active state.
ProjectInactive = 24,
/// A required field is not set.
RequiredField = 25,
/// Project id, scanconfig id, scanrun id, or finding id are not consistent
/// with each other in resource name.
ResourceNameInconsistent = 26,
/// The scan being requested to start is already running.
ScanAlreadyRunning = 27,
/// The scan that was requested to be stopped is not running.
ScanNotRunning = 28,
/// One of the seed URLs does not belong to the current project.
SeedUrlDoesNotBelongToCurrentProject = 29,
/// One of the seed URLs is malformed (can not be parsed).
SeedUrlMalformed = 30,
/// One of the seed URLs is mapped to a non-routable IP address in DNS.
SeedUrlMappedToNonRoutableAddress = 31,
/// One of the seed URLs is mapped to an IP address which is not reserved
/// for the current project.
SeedUrlMappedToUnreservedAddress = 32,
/// One of the seed URLs has on-routable IP address.
SeedUrlHasNonRoutableIpAddress = 33,
/// One of the seed URLs has an IP address that is not reserved
/// for the current project.
SeedUrlHasUnreservedIpAddress = 35,
/// The Web Security Scanner service account is not configured under the
/// project.
ServiceAccountNotConfigured = 36,
/// A project has reached the maximum number of scans.
TooManyScans = 37,
/// Resolving the details of the current project fails.
UnableToResolveProjectInfo = 38,
/// One or more blacklist patterns were in the wrong format.
UnsupportedBlacklistPatternFormat = 39,
/// The supplied filter is not supported.
UnsupportedFilter = 40,
/// The supplied finding type is not supported. For example, we do not
/// provide findings of the given finding type.
UnsupportedFindingType = 41,
/// The URL scheme of one or more of the supplied URLs is not supported.
UnsupportedUrlScheme = 42,
}
impl Code {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Code::Unspecified => "CODE_UNSPECIFIED",
Code::InternalError => "INTERNAL_ERROR",
Code::AppengineApiBackendError => "APPENGINE_API_BACKEND_ERROR",
Code::AppengineApiNotAccessible => "APPENGINE_API_NOT_ACCESSIBLE",
Code::AppengineDefaultHostMissing => "APPENGINE_DEFAULT_HOST_MISSING",
Code::CannotUseGoogleComAccount => "CANNOT_USE_GOOGLE_COM_ACCOUNT",
Code::CannotUseOwnerAccount => "CANNOT_USE_OWNER_ACCOUNT",
Code::ComputeApiBackendError => "COMPUTE_API_BACKEND_ERROR",
Code::ComputeApiNotAccessible => "COMPUTE_API_NOT_ACCESSIBLE",
Code::CustomLoginUrlDoesNotBelongToCurrentProject => {
"CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT"
}
Code::CustomLoginUrlMalformed => "CUSTOM_LOGIN_URL_MALFORMED",
Code::CustomLoginUrlMappedToNonRoutableAddress => {
"CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS"
}
Code::CustomLoginUrlMappedToUnreservedAddress => {
"CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS"
}
Code::CustomLoginUrlHasNonRoutableIpAddress => {
"CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS"
}
Code::CustomLoginUrlHasUnreservedIpAddress => {
"CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS"
}
Code::DuplicateScanName => "DUPLICATE_SCAN_NAME",
Code::InvalidFieldValue => "INVALID_FIELD_VALUE",
Code::FailedToAuthenticateToTarget => "FAILED_TO_AUTHENTICATE_TO_TARGET",
Code::FindingTypeUnspecified => "FINDING_TYPE_UNSPECIFIED",
Code::ForbiddenToScanCompute => "FORBIDDEN_TO_SCAN_COMPUTE",
Code::ForbiddenUpdateToManagedScan => "FORBIDDEN_UPDATE_TO_MANAGED_SCAN",
Code::MalformedFilter => "MALFORMED_FILTER",
Code::MalformedResourceName => "MALFORMED_RESOURCE_NAME",
Code::ProjectInactive => "PROJECT_INACTIVE",
Code::RequiredField => "REQUIRED_FIELD",
Code::ResourceNameInconsistent => "RESOURCE_NAME_INCONSISTENT",
Code::ScanAlreadyRunning => "SCAN_ALREADY_RUNNING",
Code::ScanNotRunning => "SCAN_NOT_RUNNING",
Code::SeedUrlDoesNotBelongToCurrentProject => {
"SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT"
}
Code::SeedUrlMalformed => "SEED_URL_MALFORMED",
Code::SeedUrlMappedToNonRoutableAddress => {
"SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS"
}
Code::SeedUrlMappedToUnreservedAddress => {
"SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS"
}
Code::SeedUrlHasNonRoutableIpAddress => {
"SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS"
}
Code::SeedUrlHasUnreservedIpAddress => {
"SEED_URL_HAS_UNRESERVED_IP_ADDRESS"
}
Code::ServiceAccountNotConfigured => "SERVICE_ACCOUNT_NOT_CONFIGURED",
Code::TooManyScans => "TOO_MANY_SCANS",
Code::UnableToResolveProjectInfo => "UNABLE_TO_RESOLVE_PROJECT_INFO",
Code::UnsupportedBlacklistPatternFormat => {
"UNSUPPORTED_BLACKLIST_PATTERN_FORMAT"
}
Code::UnsupportedFilter => "UNSUPPORTED_FILTER",
Code::UnsupportedFindingType => "UNSUPPORTED_FINDING_TYPE",
Code::UnsupportedUrlScheme => "UNSUPPORTED_URL_SCHEME",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CODE_UNSPECIFIED" => Some(Self::Unspecified),
"INTERNAL_ERROR" => Some(Self::InternalError),
"APPENGINE_API_BACKEND_ERROR" => Some(Self::AppengineApiBackendError),
"APPENGINE_API_NOT_ACCESSIBLE" => Some(Self::AppengineApiNotAccessible),
"APPENGINE_DEFAULT_HOST_MISSING" => {
Some(Self::AppengineDefaultHostMissing)
}
"CANNOT_USE_GOOGLE_COM_ACCOUNT" => Some(Self::CannotUseGoogleComAccount),
"CANNOT_USE_OWNER_ACCOUNT" => Some(Self::CannotUseOwnerAccount),
"COMPUTE_API_BACKEND_ERROR" => Some(Self::ComputeApiBackendError),
"COMPUTE_API_NOT_ACCESSIBLE" => Some(Self::ComputeApiNotAccessible),
"CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT" => {
Some(Self::CustomLoginUrlDoesNotBelongToCurrentProject)
}
"CUSTOM_LOGIN_URL_MALFORMED" => Some(Self::CustomLoginUrlMalformed),
"CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS" => {
Some(Self::CustomLoginUrlMappedToNonRoutableAddress)
}
"CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS" => {
Some(Self::CustomLoginUrlMappedToUnreservedAddress)
}
"CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS" => {
Some(Self::CustomLoginUrlHasNonRoutableIpAddress)
}
"CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS" => {
Some(Self::CustomLoginUrlHasUnreservedIpAddress)
}
"DUPLICATE_SCAN_NAME" => Some(Self::DuplicateScanName),
"INVALID_FIELD_VALUE" => Some(Self::InvalidFieldValue),
"FAILED_TO_AUTHENTICATE_TO_TARGET" => {
Some(Self::FailedToAuthenticateToTarget)
}
"FINDING_TYPE_UNSPECIFIED" => Some(Self::FindingTypeUnspecified),
"FORBIDDEN_TO_SCAN_COMPUTE" => Some(Self::ForbiddenToScanCompute),
"FORBIDDEN_UPDATE_TO_MANAGED_SCAN" => {
Some(Self::ForbiddenUpdateToManagedScan)
}
"MALFORMED_FILTER" => Some(Self::MalformedFilter),
"MALFORMED_RESOURCE_NAME" => Some(Self::MalformedResourceName),
"PROJECT_INACTIVE" => Some(Self::ProjectInactive),
"REQUIRED_FIELD" => Some(Self::RequiredField),
"RESOURCE_NAME_INCONSISTENT" => Some(Self::ResourceNameInconsistent),
"SCAN_ALREADY_RUNNING" => Some(Self::ScanAlreadyRunning),
"SCAN_NOT_RUNNING" => Some(Self::ScanNotRunning),
"SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT" => {
Some(Self::SeedUrlDoesNotBelongToCurrentProject)
}
"SEED_URL_MALFORMED" => Some(Self::SeedUrlMalformed),
"SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS" => {
Some(Self::SeedUrlMappedToNonRoutableAddress)
}
"SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS" => {
Some(Self::SeedUrlMappedToUnreservedAddress)
}
"SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS" => {
Some(Self::SeedUrlHasNonRoutableIpAddress)
}
"SEED_URL_HAS_UNRESERVED_IP_ADDRESS" => {
Some(Self::SeedUrlHasUnreservedIpAddress)
}
"SERVICE_ACCOUNT_NOT_CONFIGURED" => {
Some(Self::ServiceAccountNotConfigured)
}
"TOO_MANY_SCANS" => Some(Self::TooManyScans),
"UNABLE_TO_RESOLVE_PROJECT_INFO" => {
Some(Self::UnableToResolveProjectInfo)
}
"UNSUPPORTED_BLACKLIST_PATTERN_FORMAT" => {
Some(Self::UnsupportedBlacklistPatternFormat)
}
"UNSUPPORTED_FILTER" => Some(Self::UnsupportedFilter),
"UNSUPPORTED_FINDING_TYPE" => Some(Self::UnsupportedFindingType),
"UNSUPPORTED_URL_SCHEME" => Some(Self::UnsupportedUrlScheme),
_ => None,
}
}
}
}
/// Output only.
/// Defines an error trace message for a ScanRun.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanRunErrorTrace {
/// Output only. Indicates the error reason code.
#[prost(enumeration = "scan_run_error_trace::Code", tag = "1")]
pub code: i32,
/// Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
/// message encountered during scan configuration validation that is performed
/// before each scan run.
#[prost(message, optional, tag = "2")]
pub scan_config_error: ::core::option::Option<ScanConfigError>,
/// Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
/// common HTTP error code, if such is available. For example, if this code is
/// 404, the scan has encountered too many NOT_FOUND responses.
#[prost(int32, tag = "3")]
pub most_common_http_error_code: i32,
}
/// Nested message and enum types in `ScanRunErrorTrace`.
pub mod scan_run_error_trace {
/// Output only.
/// Defines an error reason code.
/// Next id: 8
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Code {
/// Default value is never used.
Unspecified = 0,
/// Indicates that the scan run failed due to an internal server error.
InternalError = 1,
/// Indicates a scan configuration error, usually due to outdated ScanConfig
/// settings, such as starting_urls or the DNS configuration.
ScanConfigIssue = 2,
/// Indicates an authentication error, usually due to outdated ScanConfig
/// authentication settings.
AuthenticationConfigIssue = 3,
/// Indicates a scan operation timeout, usually caused by a very large site.
TimedOutWhileScanning = 4,
/// Indicates that a scan encountered excessive redirects, either to
/// authentication or some other page outside of the scan scope.
TooManyRedirects = 5,
/// Indicates that a scan encountered numerous errors from the web site
/// pages. When available, most_common_http_error_code field indicates the
/// most common HTTP error code encountered during the scan.
TooManyHttpErrors = 6,
}
impl Code {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Code::Unspecified => "CODE_UNSPECIFIED",
Code::InternalError => "INTERNAL_ERROR",
Code::ScanConfigIssue => "SCAN_CONFIG_ISSUE",
Code::AuthenticationConfigIssue => "AUTHENTICATION_CONFIG_ISSUE",
Code::TimedOutWhileScanning => "TIMED_OUT_WHILE_SCANNING",
Code::TooManyRedirects => "TOO_MANY_REDIRECTS",
Code::TooManyHttpErrors => "TOO_MANY_HTTP_ERRORS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CODE_UNSPECIFIED" => Some(Self::Unspecified),
"INTERNAL_ERROR" => Some(Self::InternalError),
"SCAN_CONFIG_ISSUE" => Some(Self::ScanConfigIssue),
"AUTHENTICATION_CONFIG_ISSUE" => Some(Self::AuthenticationConfigIssue),
"TIMED_OUT_WHILE_SCANNING" => Some(Self::TimedOutWhileScanning),
"TOO_MANY_REDIRECTS" => Some(Self::TooManyRedirects),
"TOO_MANY_HTTP_ERRORS" => Some(Self::TooManyHttpErrors),
_ => None,
}
}
}
}
/// Output only.
/// Defines a warning trace message for ScanRun. Warning traces provide customers
/// with useful information that helps make the scanning process more effective.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ScanRunWarningTrace {
/// Output only. Indicates the warning code.
#[prost(enumeration = "scan_run_warning_trace::Code", tag = "1")]
pub code: i32,
}
/// Nested message and enum types in `ScanRunWarningTrace`.
pub mod scan_run_warning_trace {
/// Output only.
/// Defines a warning message code.
/// Next id: 6
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Code {
/// Default value is never used.
Unspecified = 0,
/// Indicates that a scan discovered an unexpectedly low number of URLs. This
/// is sometimes caused by complex navigation features or by using a single
/// URL for numerous pages.
InsufficientCrawlResults = 1,
/// Indicates that a scan discovered too many URLs to test, or excessive
/// redundant URLs.
TooManyCrawlResults = 2,
/// Indicates that too many tests have been generated for the scan. Customer
/// should try reducing the number of starting URLs, increasing the QPS rate,
/// or narrowing down the scope of the scan using the excluded patterns.
TooManyFuzzTasks = 3,
/// Indicates that a scan is blocked by IAP.
BlockedByIap = 4,
/// Indicates that no seeds is found for a scan
NoStartingUrlFoundForManagedScan = 5,
}
impl Code {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Code::Unspecified => "CODE_UNSPECIFIED",
Code::InsufficientCrawlResults => "INSUFFICIENT_CRAWL_RESULTS",
Code::TooManyCrawlResults => "TOO_MANY_CRAWL_RESULTS",
Code::TooManyFuzzTasks => "TOO_MANY_FUZZ_TASKS",
Code::BlockedByIap => "BLOCKED_BY_IAP",
Code::NoStartingUrlFoundForManagedScan => {
"NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CODE_UNSPECIFIED" => Some(Self::Unspecified),
"INSUFFICIENT_CRAWL_RESULTS" => Some(Self::InsufficientCrawlResults),
"TOO_MANY_CRAWL_RESULTS" => Some(Self::TooManyCrawlResults),
"TOO_MANY_FUZZ_TASKS" => Some(Self::TooManyFuzzTasks),
"BLOCKED_BY_IAP" => Some(Self::BlockedByIap),
"NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN" => {
Some(Self::NoStartingUrlFoundForManagedScan)
}
_ => None,
}
}
}
}
/// A ScanRun is a output-only resource representing an actual run of the scan.
/// Next id: 12
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanRun {
/// Output only. The resource name of the ScanRun. The name follows the format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
/// The ScanRun IDs are generated by the system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. The execution state of the ScanRun.
#[prost(enumeration = "scan_run::ExecutionState", tag = "2")]
pub execution_state: i32,
/// Output only. The result state of the ScanRun. This field is only available after the
/// execution state reaches "FINISHED".
#[prost(enumeration = "scan_run::ResultState", tag = "3")]
pub result_state: i32,
/// Output only. The time at which the ScanRun started.
#[prost(message, optional, tag = "4")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The time at which the ScanRun reached termination state - that the ScanRun
/// is either finished or stopped by user.
#[prost(message, optional, tag = "5")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The number of URLs crawled during this ScanRun. If the scan is in progress,
/// the value represents the number of URLs crawled up to now.
#[prost(int64, tag = "6")]
pub urls_crawled_count: i64,
/// Output only. The number of URLs tested during this ScanRun. If the scan is in progress,
/// the value represents the number of URLs tested up to now. The number of
/// URLs tested is usually larger than the number URLS crawled because
/// typically a crawled URL is tested with multiple test payloads.
#[prost(int64, tag = "7")]
pub urls_tested_count: i64,
/// Output only. Whether the scan run has found any vulnerabilities.
#[prost(bool, tag = "8")]
pub has_vulnerabilities: bool,
/// Output only. The percentage of total completion ranging from 0 to 100.
/// If the scan is in queue, the value is 0.
/// If the scan is running, the value ranges from 0 to 100.
/// If the scan is finished, the value is 100.
#[prost(int32, tag = "9")]
pub progress_percent: i32,
/// Output only. If result_state is an ERROR, this field provides the primary reason for
/// scan's termination and more details, if such are available.
#[prost(message, optional, tag = "10")]
pub error_trace: ::core::option::Option<ScanRunErrorTrace>,
/// Output only. A list of warnings, if such are encountered during this scan run.
#[prost(message, repeated, tag = "11")]
pub warning_traces: ::prost::alloc::vec::Vec<ScanRunWarningTrace>,
}
/// Nested message and enum types in `ScanRun`.
pub mod scan_run {
/// Types of ScanRun execution state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionState {
/// Represents an invalid state caused by internal server error. This value
/// should never be returned.
Unspecified = 0,
/// The scan is waiting in the queue.
Queued = 1,
/// The scan is in progress.
Scanning = 2,
/// The scan is either finished or stopped by user.
Finished = 3,
}
impl ExecutionState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ExecutionState::Unspecified => "EXECUTION_STATE_UNSPECIFIED",
ExecutionState::Queued => "QUEUED",
ExecutionState::Scanning => "SCANNING",
ExecutionState::Finished => "FINISHED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"QUEUED" => Some(Self::Queued),
"SCANNING" => Some(Self::Scanning),
"FINISHED" => Some(Self::Finished),
_ => None,
}
}
}
/// Types of ScanRun result state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ResultState {
/// Default value. This value is returned when the ScanRun is not yet
/// finished.
Unspecified = 0,
/// The scan finished without errors.
Success = 1,
/// The scan finished with errors.
Error = 2,
/// The scan was terminated by user.
Killed = 3,
}
impl ResultState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ResultState::Unspecified => "RESULT_STATE_UNSPECIFIED",
ResultState::Success => "SUCCESS",
ResultState::Error => "ERROR",
ResultState::Killed => "KILLED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESULT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"SUCCESS" => Some(Self::Success),
"ERROR" => Some(Self::Error),
"KILLED" => Some(Self::Killed),
_ => None,
}
}
}
}
/// A ScanRunLog is an output-only proto used for Stackdriver customer logging.
/// It is used for logs covering the start and end of scan pipelines.
/// Other than an added summary, this is a subset of the ScanRun.
/// Representation in logs is either a proto Struct, or converted to JSON.
/// Next id: 9
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanRunLog {
/// Human friendly message about the event.
#[prost(string, tag = "1")]
pub summary: ::prost::alloc::string::String,
/// The resource name of the ScanRun being logged.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// The execution state of the ScanRun.
#[prost(enumeration = "scan_run::ExecutionState", tag = "3")]
pub execution_state: i32,
/// The result state of the ScanRun.
#[prost(enumeration = "scan_run::ResultState", tag = "4")]
pub result_state: i32,
#[prost(int64, tag = "5")]
pub urls_crawled_count: i64,
#[prost(int64, tag = "6")]
pub urls_tested_count: i64,
#[prost(bool, tag = "7")]
pub has_findings: bool,
#[prost(message, optional, tag = "8")]
pub error_trace: ::core::option::Option<ScanRunErrorTrace>,
}
/// ! Information about a vulnerability with an HTML.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Form {
/// ! The URI where to send the form when it's submitted.
#[prost(string, tag = "1")]
pub action_uri: ::prost::alloc::string::String,
/// ! The names of form fields related to the vulnerability.
#[prost(string, repeated, tag = "2")]
pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Information reported for an outdated library.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutdatedLibrary {
/// The name of the outdated library.
#[prost(string, tag = "1")]
pub library_name: ::prost::alloc::string::String,
/// The version number.
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
/// URLs to learn more information about the vulnerabilities in the library.
#[prost(string, repeated, tag = "3")]
pub learn_more_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Information regarding any resource causing the vulnerability such
/// as JavaScript sources, image, audio files, etc.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViolatingResource {
/// The MIME type of this resource.
#[prost(string, tag = "1")]
pub content_type: ::prost::alloc::string::String,
/// URL of this violating resource.
#[prost(string, tag = "2")]
pub resource_url: ::prost::alloc::string::String,
}
/// Information about vulnerable request parameters.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VulnerableParameters {
/// The vulnerable parameter names.
#[prost(string, repeated, tag = "1")]
pub parameter_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Information about vulnerable or missing HTTP Headers.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VulnerableHeaders {
/// List of vulnerable headers.
#[prost(message, repeated, tag = "1")]
pub headers: ::prost::alloc::vec::Vec<vulnerable_headers::Header>,
/// List of missing headers.
#[prost(message, repeated, tag = "2")]
pub missing_headers: ::prost::alloc::vec::Vec<vulnerable_headers::Header>,
}
/// Nested message and enum types in `VulnerableHeaders`.
pub mod vulnerable_headers {
/// Describes a HTTP Header.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Header {
/// Header name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Header value.
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
}
/// Information reported for an XSS.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Xss {
/// Stack traces leading to the point where the XSS occurred.
#[prost(string, repeated, tag = "1")]
pub stack_traces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// An error message generated by a javascript breakage.
#[prost(string, tag = "2")]
pub error_message: ::prost::alloc::string::String,
/// The attack vector of the payload triggering this XSS.
#[prost(enumeration = "xss::AttackVector", tag = "3")]
pub attack_vector: i32,
/// The reproduction url for the seeding POST request of a Stored XSS.
#[prost(string, tag = "4")]
pub stored_xss_seeding_url: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Xss`.
pub mod xss {
/// Types of XSS attack vector.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AttackVector {
/// Unknown attack vector.
Unspecified = 0,
/// The attack comes from fuzzing the browser's localStorage.
LocalStorage = 1,
/// The attack comes from fuzzing the browser's sessionStorage.
SessionStorage = 2,
/// The attack comes from fuzzing the window's name property.
WindowName = 3,
/// The attack comes from fuzzing the referrer property.
Referrer = 4,
/// The attack comes from fuzzing an input element.
FormInput = 5,
/// The attack comes from fuzzing the browser's cookies.
Cookie = 6,
/// The attack comes from hijacking the post messaging mechanism.
PostMessage = 7,
/// The attack comes from fuzzing parameters in the url.
GetParameters = 8,
/// The attack comes from fuzzing the fragment in the url.
UrlFragment = 9,
/// The attack comes from fuzzing the HTML comments.
HtmlComment = 10,
/// The attack comes from fuzzing the POST parameters.
PostParameters = 11,
/// The attack comes from fuzzing the protocol.
Protocol = 12,
/// The attack comes from the server side and is stored.
StoredXss = 13,
/// The attack is a Same-Origin Method Execution attack via a GET parameter.
SameOrigin = 14,
/// The attack payload is received from a third-party host via a URL that is
/// user-controllable
UserControllableUrl = 15,
}
impl AttackVector {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AttackVector::Unspecified => "ATTACK_VECTOR_UNSPECIFIED",
AttackVector::LocalStorage => "LOCAL_STORAGE",
AttackVector::SessionStorage => "SESSION_STORAGE",
AttackVector::WindowName => "WINDOW_NAME",
AttackVector::Referrer => "REFERRER",
AttackVector::FormInput => "FORM_INPUT",
AttackVector::Cookie => "COOKIE",
AttackVector::PostMessage => "POST_MESSAGE",
AttackVector::GetParameters => "GET_PARAMETERS",
AttackVector::UrlFragment => "URL_FRAGMENT",
AttackVector::HtmlComment => "HTML_COMMENT",
AttackVector::PostParameters => "POST_PARAMETERS",
AttackVector::Protocol => "PROTOCOL",
AttackVector::StoredXss => "STORED_XSS",
AttackVector::SameOrigin => "SAME_ORIGIN",
AttackVector::UserControllableUrl => "USER_CONTROLLABLE_URL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ATTACK_VECTOR_UNSPECIFIED" => Some(Self::Unspecified),
"LOCAL_STORAGE" => Some(Self::LocalStorage),
"SESSION_STORAGE" => Some(Self::SessionStorage),
"WINDOW_NAME" => Some(Self::WindowName),
"REFERRER" => Some(Self::Referrer),
"FORM_INPUT" => Some(Self::FormInput),
"COOKIE" => Some(Self::Cookie),
"POST_MESSAGE" => Some(Self::PostMessage),
"GET_PARAMETERS" => Some(Self::GetParameters),
"URL_FRAGMENT" => Some(Self::UrlFragment),
"HTML_COMMENT" => Some(Self::HtmlComment),
"POST_PARAMETERS" => Some(Self::PostParameters),
"PROTOCOL" => Some(Self::Protocol),
"STORED_XSS" => Some(Self::StoredXss),
"SAME_ORIGIN" => Some(Self::SameOrigin),
"USER_CONTROLLABLE_URL" => Some(Self::UserControllableUrl),
_ => None,
}
}
}
}
/// Information reported for an XXE.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Xxe {
/// The XML string that triggered the XXE vulnerability. Non-payload values
/// might be redacted.
#[prost(string, tag = "1")]
pub payload_value: ::prost::alloc::string::String,
/// Location within the request where the payload was placed.
#[prost(enumeration = "xxe::Location", tag = "2")]
pub payload_location: i32,
}
/// Nested message and enum types in `Xxe`.
pub mod xxe {
/// Locations within a request where XML was substituted.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Location {
/// Unknown Location.
Unspecified = 0,
/// The XML payload replaced the complete request body.
CompleteRequestBody = 1,
}
impl Location {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Location::Unspecified => "LOCATION_UNSPECIFIED",
Location::CompleteRequestBody => "COMPLETE_REQUEST_BODY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LOCATION_UNSPECIFIED" => Some(Self::Unspecified),
"COMPLETE_REQUEST_BODY" => Some(Self::CompleteRequestBody),
_ => None,
}
}
}
}
/// A ScanConfig resource contains the configurations to launch a scan.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScanConfig {
/// The resource name of the ScanConfig. The name follows the format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
/// generated by the system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. The user provided display name of the ScanConfig.
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// The maximum QPS during scanning. A valid value ranges from 5 to 20
/// inclusively. If the field is unspecified or its value is set 0, server will
/// default to 15. Other values outside of \[5, 20\] range will be rejected with
/// INVALID_ARGUMENT error.
#[prost(int32, tag = "3")]
pub max_qps: i32,
/// Required. The starting URLs from which the scanner finds site pages.
#[prost(string, repeated, tag = "4")]
pub starting_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The authentication configuration. If specified, service will use the
/// authentication configuration during scanning.
#[prost(message, optional, tag = "5")]
pub authentication: ::core::option::Option<scan_config::Authentication>,
/// The user agent used during scanning.
#[prost(enumeration = "scan_config::UserAgent", tag = "6")]
pub user_agent: i32,
/// The excluded URL patterns as described in
/// <https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls>
#[prost(string, repeated, tag = "7")]
pub blacklist_patterns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The schedule of the ScanConfig.
#[prost(message, optional, tag = "8")]
pub schedule: ::core::option::Option<scan_config::Schedule>,
/// Controls export of scan configurations and results to Security
/// Command Center.
#[prost(enumeration = "scan_config::ExportToSecurityCommandCenter", tag = "10")]
pub export_to_security_command_center: i32,
/// The risk level selected for the scan
#[prost(enumeration = "scan_config::RiskLevel", tag = "12")]
pub risk_level: i32,
/// Whether the scan config is managed by Web Security Scanner, output
/// only.
#[prost(bool, tag = "13")]
pub managed_scan: bool,
/// Whether the scan configuration has enabled static IP address scan feature.
/// If enabled, the scanner will access applications from static IP addresses.
#[prost(bool, tag = "14")]
pub static_ip_scan: bool,
/// Whether to keep scanning even if most requests return HTTP error codes.
#[prost(bool, tag = "15")]
pub ignore_http_status_errors: bool,
}
/// Nested message and enum types in `ScanConfig`.
pub mod scan_config {
/// Scan authentication configuration.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Authentication {
/// Required.
/// Authentication configuration
#[prost(oneof = "authentication::Authentication", tags = "1, 2, 4")]
pub authentication: ::core::option::Option<authentication::Authentication>,
}
/// Nested message and enum types in `Authentication`.
pub mod authentication {
/// Describes authentication configuration that uses a Google account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GoogleAccount {
/// Required. The user name of the Google account.
#[prost(string, tag = "1")]
pub username: ::prost::alloc::string::String,
/// Required. Input only. The password of the Google account. The credential is stored encrypted
/// and not returned in any response nor included in audit logs.
#[prost(string, tag = "2")]
pub password: ::prost::alloc::string::String,
}
/// Describes authentication configuration that uses a custom account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomAccount {
/// Required. The user name of the custom account.
#[prost(string, tag = "1")]
pub username: ::prost::alloc::string::String,
/// Required. Input only. The password of the custom account. The credential is stored encrypted
/// and not returned in any response nor included in audit logs.
#[prost(string, tag = "2")]
pub password: ::prost::alloc::string::String,
/// Required. The login form URL of the website.
#[prost(string, tag = "3")]
pub login_url: ::prost::alloc::string::String,
}
/// Describes authentication configuration for Identity-Aware-Proxy (IAP).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IapCredential {
/// Identity-Aware-Proxy (IAP) Authentication Configuration
#[prost(oneof = "iap_credential::IapCredentials", tags = "1")]
pub iap_credentials: ::core::option::Option<iap_credential::IapCredentials>,
}
/// Nested message and enum types in `IapCredential`.
pub mod iap_credential {
/// Describes authentication configuration when Web-Security-Scanner
/// service account is added in Identity-Aware-Proxy (IAP) access policies.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IapTestServiceAccountInfo {
/// Required. Describes OAuth2 client id of resources protected by
/// Identity-Aware-Proxy (IAP).
#[prost(string, tag = "1")]
pub target_audience_client_id: ::prost::alloc::string::String,
}
/// Identity-Aware-Proxy (IAP) Authentication Configuration
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum IapCredentials {
/// Authentication configuration when Web-Security-Scanner service
/// account is added in Identity-Aware-Proxy (IAP) access policies.
#[prost(message, tag = "1")]
IapTestServiceAccountInfo(IapTestServiceAccountInfo),
}
}
/// Required.
/// Authentication configuration
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Authentication {
/// Authentication using a Google account.
#[prost(message, tag = "1")]
GoogleAccount(GoogleAccount),
/// Authentication using a custom account.
#[prost(message, tag = "2")]
CustomAccount(CustomAccount),
/// Authentication using Identity-Aware-Proxy (IAP).
#[prost(message, tag = "4")]
IapCredential(IapCredential),
}
}
/// Scan schedule configuration.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Schedule {
/// A timestamp indicates when the next run will be scheduled. The value is
/// refreshed by the server after each run. If unspecified, it will default
/// to current server time, which means the scan will be scheduled to start
/// immediately.
#[prost(message, optional, tag = "1")]
pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
/// Required. The duration of time between executions in days.
#[prost(int32, tag = "2")]
pub interval_duration_days: i32,
}
/// Type of user agents used for scanning.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum UserAgent {
/// The user agent is unknown. Service will default to CHROME_LINUX.
Unspecified = 0,
/// Chrome on Linux. This is the service default if unspecified.
ChromeLinux = 1,
/// Chrome on Android.
ChromeAndroid = 2,
/// Safari on IPhone.
SafariIphone = 3,
}
impl UserAgent {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
UserAgent::Unspecified => "USER_AGENT_UNSPECIFIED",
UserAgent::ChromeLinux => "CHROME_LINUX",
UserAgent::ChromeAndroid => "CHROME_ANDROID",
UserAgent::SafariIphone => "SAFARI_IPHONE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"USER_AGENT_UNSPECIFIED" => Some(Self::Unspecified),
"CHROME_LINUX" => Some(Self::ChromeLinux),
"CHROME_ANDROID" => Some(Self::ChromeAndroid),
"SAFARI_IPHONE" => Some(Self::SafariIphone),
_ => None,
}
}
}
/// Scan risk levels supported by Web Security Scanner. LOW impact
/// scanning will minimize requests with the potential to modify data. To
/// achieve the maximum scan coverage, NORMAL risk level is recommended.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RiskLevel {
/// Use default, which is NORMAL.
Unspecified = 0,
/// Normal scanning (Recommended)
Normal = 1,
/// Lower impact scanning
Low = 2,
}
impl RiskLevel {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
RiskLevel::Unspecified => "RISK_LEVEL_UNSPECIFIED",
RiskLevel::Normal => "NORMAL",
RiskLevel::Low => "LOW",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RISK_LEVEL_UNSPECIFIED" => Some(Self::Unspecified),
"NORMAL" => Some(Self::Normal),
"LOW" => Some(Self::Low),
_ => None,
}
}
}
/// Controls export of scan configurations and results to Security
/// Command Center.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExportToSecurityCommandCenter {
/// Use default, which is ENABLED.
Unspecified = 0,
/// Export results of this scan to Security Command Center.
Enabled = 1,
/// Do not export results of this scan to Security Command Center.
Disabled = 2,
}
impl ExportToSecurityCommandCenter {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ExportToSecurityCommandCenter::Unspecified => {
"EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED"
}
ExportToSecurityCommandCenter::Enabled => "ENABLED",
ExportToSecurityCommandCenter::Disabled => "DISABLED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED" => {
Some(Self::Unspecified)
}
"ENABLED" => Some(Self::Enabled),
"DISABLED" => Some(Self::Disabled),
_ => None,
}
}
}
}
/// A FindingTypeStats resource represents stats regarding a specific FindingType
/// of Findings under a given ScanRun.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindingTypeStats {
/// Output only. The finding type associated with the stats.
#[prost(string, tag = "1")]
pub finding_type: ::prost::alloc::string::String,
/// Output only. The count of findings belonging to this finding type.
#[prost(int32, tag = "2")]
pub finding_count: i32,
}
/// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web
/// Security Scanner Service crawls the web applications, following all links
/// within the scope of sites, to find the URLs to test against.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CrawledUrl {
/// Output only. The http method of the request that was used to visit the URL, in
/// uppercase.
#[prost(string, tag = "1")]
pub http_method: ::prost::alloc::string::String,
/// Output only. The URL that was crawled.
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
/// Output only. The body of the request that was used to visit the URL.
#[prost(string, tag = "3")]
pub body: ::prost::alloc::string::String,
}
/// A Finding resource represents a vulnerability instance identified during a
/// ScanRun.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Finding {
/// Output only. The resource name of the Finding. The name follows the format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
/// The finding IDs are generated by the system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. The type of the Finding.
/// Detailed and up-to-date information on findings can be found here:
/// <https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings>
#[prost(string, tag = "2")]
pub finding_type: ::prost::alloc::string::String,
/// Output only. The severity level of the reported vulnerability.
#[prost(enumeration = "finding::Severity", tag = "17")]
pub severity: i32,
/// Output only. The http method of the request that triggered the vulnerability, in
/// uppercase.
#[prost(string, tag = "3")]
pub http_method: ::prost::alloc::string::String,
/// Output only. The URL produced by the server-side fuzzer and used in the request that
/// triggered the vulnerability.
#[prost(string, tag = "4")]
pub fuzzed_url: ::prost::alloc::string::String,
/// Output only. The body of the request that triggered the vulnerability.
#[prost(string, tag = "5")]
pub body: ::prost::alloc::string::String,
/// Output only. The description of the vulnerability.
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
/// Output only. The URL containing human-readable payload that user can leverage to
/// reproduce the vulnerability.
#[prost(string, tag = "7")]
pub reproduction_url: ::prost::alloc::string::String,
/// Output only. If the vulnerability was originated from nested IFrame, the immediate
/// parent IFrame is reported.
#[prost(string, tag = "8")]
pub frame_url: ::prost::alloc::string::String,
/// Output only. The URL where the browser lands when the vulnerability is detected.
#[prost(string, tag = "9")]
pub final_url: ::prost::alloc::string::String,
/// Output only. The tracking ID uniquely identifies a vulnerability instance across
/// multiple ScanRuns.
#[prost(string, tag = "10")]
pub tracking_id: ::prost::alloc::string::String,
/// Output only. An addon containing information reported for a vulnerability with an HTML
/// form, if any.
#[prost(message, optional, tag = "16")]
pub form: ::core::option::Option<Form>,
/// Output only. An addon containing information about outdated libraries.
#[prost(message, optional, tag = "11")]
pub outdated_library: ::core::option::Option<OutdatedLibrary>,
/// Output only. An addon containing detailed information regarding any resource causing the
/// vulnerability such as JavaScript sources, image, audio files, etc.
#[prost(message, optional, tag = "12")]
pub violating_resource: ::core::option::Option<ViolatingResource>,
/// Output only. An addon containing information about vulnerable or missing HTTP headers.
#[prost(message, optional, tag = "15")]
pub vulnerable_headers: ::core::option::Option<VulnerableHeaders>,
/// Output only. An addon containing information about request parameters which were found
/// to be vulnerable.
#[prost(message, optional, tag = "13")]
pub vulnerable_parameters: ::core::option::Option<VulnerableParameters>,
/// Output only. An addon containing information reported for an XSS, if any.
#[prost(message, optional, tag = "14")]
pub xss: ::core::option::Option<Xss>,
/// Output only. An addon containing information reported for an XXE, if any.
#[prost(message, optional, tag = "18")]
pub xxe: ::core::option::Option<Xxe>,
}
/// Nested message and enum types in `Finding`.
pub mod finding {
/// The severity level of a vulnerability.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Severity {
/// No severity specified. The default value.
Unspecified = 0,
/// Critical severity.
Critical = 1,
/// High severity.
High = 2,
/// Medium severity.
Medium = 3,
/// Low severity.
Low = 4,
}
impl Severity {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Severity::Unspecified => "SEVERITY_UNSPECIFIED",
Severity::Critical => "CRITICAL",
Severity::High => "HIGH",
Severity::Medium => "MEDIUM",
Severity::Low => "LOW",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
"CRITICAL" => Some(Self::Critical),
"HIGH" => Some(Self::High),
"MEDIUM" => Some(Self::Medium),
"LOW" => Some(Self::Low),
_ => None,
}
}
}
}
/// Request for the `CreateScanConfig` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateScanConfigRequest {
/// Required. The parent resource name where the scan is created, which should be a
/// project resource name in the format 'projects/{projectId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The ScanConfig to be created.
#[prost(message, optional, tag = "2")]
pub scan_config: ::core::option::Option<ScanConfig>,
}
/// Request for the `DeleteScanConfig` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteScanConfigRequest {
/// Required. The resource name of the ScanConfig to be deleted. The name follows the
/// format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `GetScanConfig` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetScanConfigRequest {
/// Required. The resource name of the ScanConfig to be returned. The name follows the
/// format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListScanConfigs` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanConfigsRequest {
/// Required. The parent resource name, which should be a project resource name in the
/// format 'projects/{projectId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of ScanConfigs to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "3")]
pub page_size: i32,
}
/// Request for the `UpdateScanConfigRequest` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateScanConfigRequest {
/// Required. The ScanConfig to be updated. The name field must be set to identify the
/// resource to be updated. The values of fields not covered by the mask
/// will be ignored.
#[prost(message, optional, tag = "2")]
pub scan_config: ::core::option::Option<ScanConfig>,
/// Required. The update mask applies to the resource. For the `FieldMask` definition,
/// see
/// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
#[prost(message, optional, tag = "3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Response for the `ListScanConfigs` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanConfigsResponse {
/// The list of ScanConfigs returned.
#[prost(message, repeated, tag = "1")]
pub scan_configs: ::prost::alloc::vec::Vec<ScanConfig>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `StartScanRun` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartScanRunRequest {
/// Required. The resource name of the ScanConfig to be used. The name follows the
/// format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `GetScanRun` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetScanRunRequest {
/// Required. The resource name of the ScanRun to be returned. The name follows the
/// format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListScanRuns` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanRunsRequest {
/// Required. The parent resource name, which should be a scan resource name in the
/// format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of ScanRuns to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "3")]
pub page_size: i32,
}
/// Response for the `ListScanRuns` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListScanRunsResponse {
/// The list of ScanRuns returned.
#[prost(message, repeated, tag = "1")]
pub scan_runs: ::prost::alloc::vec::Vec<ScanRun>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `StopScanRun` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopScanRunRequest {
/// Required. The resource name of the ScanRun to be stopped. The name follows the
/// format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListCrawledUrls` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCrawledUrlsRequest {
/// Required. The parent resource name, which should be a scan run resource name in the
/// format
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of CrawledUrls to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "3")]
pub page_size: i32,
}
/// Response for the `ListCrawledUrls` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCrawledUrlsResponse {
/// The list of CrawledUrls returned.
#[prost(message, repeated, tag = "1")]
pub crawled_urls: ::prost::alloc::vec::Vec<CrawledUrl>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `GetFinding` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFindingRequest {
/// Required. The resource name of the Finding to be returned. The name follows the
/// format of
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListFindings` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingsRequest {
/// Required. The parent resource name, which should be a scan run resource name in the
/// format
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The filter expression. The expression must be in the format: <field>
/// <operator> <value>.
/// Supported field: 'finding_type'.
/// Supported operator: '='.
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
/// A token identifying a page of results to be returned. This should be a
/// `next_page_token` value returned from a previous List request.
/// If unspecified, the first page of results is returned.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// The maximum number of Findings to return, can be limited by server.
/// If not specified or not positive, the implementation will select a
/// reasonable value.
#[prost(int32, tag = "4")]
pub page_size: i32,
}
/// Response for the `ListFindings` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingsResponse {
/// The list of Findings returned.
#[prost(message, repeated, tag = "1")]
pub findings: ::prost::alloc::vec::Vec<Finding>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `ListFindingTypeStats` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingTypeStatsRequest {
/// Required. The parent resource name, which should be a scan run resource name in the
/// format
/// 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
}
/// Response for the `ListFindingTypeStats` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFindingTypeStatsResponse {
/// The list of FindingTypeStats returned.
#[prost(message, repeated, tag = "1")]
pub finding_type_stats: ::prost::alloc::vec::Vec<FindingTypeStats>,
}
/// Generated client implementations.
pub mod web_security_scanner_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Web Security Scanner Service identifies security vulnerabilities in web
/// applications hosted on Google Cloud. It crawls your application, and
/// attempts to exercise as many user inputs and event handlers as possible.
#[derive(Debug, Clone)]
pub struct WebSecurityScannerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> WebSecurityScannerClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> WebSecurityScannerClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
WebSecurityScannerClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Creates a new ScanConfig.
pub async fn create_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::CreateScanConfigRequest>,
) -> std::result::Result<tonic::Response<super::ScanConfig>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/CreateScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"CreateScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes an existing ScanConfig and its child resources.
pub async fn delete_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::DeleteScanConfigRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/DeleteScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"DeleteScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a ScanConfig.
pub async fn get_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::GetScanConfigRequest>,
) -> std::result::Result<tonic::Response<super::ScanConfig>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"GetScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists ScanConfigs under a given project.
pub async fn list_scan_configs(
&mut self,
request: impl tonic::IntoRequest<super::ListScanConfigsRequest>,
) -> std::result::Result<
tonic::Response<super::ListScanConfigsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanConfigs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"ListScanConfigs",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates a ScanConfig. This method support partial update of a ScanConfig.
pub async fn update_scan_config(
&mut self,
request: impl tonic::IntoRequest<super::UpdateScanConfigRequest>,
) -> std::result::Result<tonic::Response<super::ScanConfig>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/UpdateScanConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"UpdateScanConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Start a ScanRun according to the given ScanConfig.
pub async fn start_scan_run(
&mut self,
request: impl tonic::IntoRequest<super::StartScanRunRequest>,
) -> std::result::Result<tonic::Response<super::ScanRun>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/StartScanRun",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"StartScanRun",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a ScanRun.
pub async fn get_scan_run(
&mut self,
request: impl tonic::IntoRequest<super::GetScanRunRequest>,
) -> std::result::Result<tonic::Response<super::ScanRun>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanRun",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"GetScanRun",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
/// stop time.
pub async fn list_scan_runs(
&mut self,
request: impl tonic::IntoRequest<super::ListScanRunsRequest>,
) -> std::result::Result<
tonic::Response<super::ListScanRunsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanRuns",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"ListScanRuns",
),
);
self.inner.unary(req, path, codec).await
}
/// Stops a ScanRun. The stopped ScanRun is returned.
pub async fn stop_scan_run(
&mut self,
request: impl tonic::IntoRequest<super::StopScanRunRequest>,
) -> std::result::Result<tonic::Response<super::ScanRun>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/StopScanRun",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"StopScanRun",
),
);
self.inner.unary(req, path, codec).await
}
/// List CrawledUrls under a given ScanRun.
pub async fn list_crawled_urls(
&mut self,
request: impl tonic::IntoRequest<super::ListCrawledUrlsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCrawledUrlsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListCrawledUrls",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"ListCrawledUrls",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a Finding.
pub async fn get_finding(
&mut self,
request: impl tonic::IntoRequest<super::GetFindingRequest>,
) -> std::result::Result<tonic::Response<super::Finding>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/GetFinding",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"GetFinding",
),
);
self.inner.unary(req, path, codec).await
}
/// List Findings under a given ScanRun.
pub async fn list_findings(
&mut self,
request: impl tonic::IntoRequest<super::ListFindingsRequest>,
) -> std::result::Result<
tonic::Response<super::ListFindingsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"ListFindings",
),
);
self.inner.unary(req, path, codec).await
}
/// List all FindingTypeStats under a given ScanRun.
pub async fn list_finding_type_stats(
&mut self,
request: impl tonic::IntoRequest<super::ListFindingTypeStatsRequest>,
) -> std::result::Result<
tonic::Response<super::ListFindingTypeStatsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.websecurityscanner.v1.WebSecurityScanner",
"ListFindingTypeStats",
),
);
self.inner.unary(req, path, codec).await
}
}
}