csv_to_oscal_cd
trestle.tasks.csv_to_oscal_cd
¤
OSCAL transformation tasks.
Attributes¤
ADJUSTED_RISK_RATING = 'Adjusted_Risk_Rating'
module-attribute
¤
CHECK_DESCRIPTION = 'Check_Description'
module-attribute
¤
CHECK_ID = 'Check_Id'
module-attribute
¤
COMPONENT_DESCRIPTION = 'Component_Description'
module-attribute
¤
COMPONENT_TITLE = 'Component_Title'
module-attribute
¤
COMPONENT_TYPE = 'Component_Type'
module-attribute
¤
CONTROL_ID_LIST = 'Control_Id_List'
module-attribute
¤
FETCHER_DESCRIPTION = 'Fetcher_Description'
module-attribute
¤
FETCHER_ID = 'Fetcher_Id'
module-attribute
¤
HEADER_DECORATION_CHAR = '$'
module-attribute
¤
NAMESPACE = 'Namespace'
module-attribute
¤
ORIGINAL_RISK_RATING = 'Original_Risk_Rating'
module-attribute
¤
PARAMETER = 'Parameter'
module-attribute
¤
PARAMETER_DESCRIPTION = f'{PARAMETER}_Description'
module-attribute
¤
PARAMETER_ID = f'{PARAMETER}_Id'
module-attribute
¤
PARAMETER_VALUE_ALTERNATIVES = f'{PARAMETER}_Value_Alternatives'
module-attribute
¤
PARAMETER_VALUE_DEFAULT = f'{PARAMETER}_Value_Default'
module-attribute
¤
PROFILE_DESCRIPTION = 'Profile_Description'
module-attribute
¤
PROFILE_SOURCE = 'Profile_Source'
module-attribute
¤
RISK_ADJUSTMENT = 'Risk_Adjustment'
module-attribute
¤
RULE_DESCRIPTION = 'Rule_Description'
module-attribute
¤
RULE_ID = 'Rule_Id'
module-attribute
¤
Row = Iterator[List[str]]
module-attribute
¤
TARGET_COMPONENT = 'Target_Component'
module-attribute
¤
logger = logging.getLogger(__name__)
module-attribute
¤
prefix_rule_set = 'rule_set_'
module-attribute
¤
validation = 'validation'
module-attribute
¤
Classes¤
CsvColumn
¤
CsvColumn.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
Functions¤
get_check_property_column_names()
staticmethod
¤
Get check property column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1550 1551 1552 1553 |
|
get_filtered_optional_column_names()
staticmethod
¤
Get filtered optional column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1534 1535 1536 1537 1538 1539 1540 1541 |
|
get_filtered_required_column_names()
staticmethod
¤
Get filtered required column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1525 1526 1527 1528 1529 1530 1531 1532 |
|
get_optional_column_names()
staticmethod
¤
Get optional column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1469 1470 1471 1472 1473 1474 |
|
get_order(column_name)
staticmethod
¤
Get order for column_name.
Source code in trestle/tasks/csv_to_oscal_cd.py
1436 1437 1438 1439 1440 1441 1442 |
|
get_parameter_column_names()
staticmethod
¤
Get parameter column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1476 1477 1478 1479 1480 1481 |
|
get_required_column_names()
staticmethod
¤
Get required column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1462 1463 1464 1465 1466 1467 |
|
get_required_column_names_validation()
staticmethod
¤
Get required column names validation.
Source code in trestle/tasks/csv_to_oscal_cd.py
1483 1484 1485 1486 1487 1488 |
|
get_rule_property_column_names()
staticmethod
¤
Get rule property column names.
Source code in trestle/tasks/csv_to_oscal_cd.py
1504 1505 1506 1507 |
|
is_column_name_optional(name)
staticmethod
¤
Is column name optional.
Source code in trestle/tasks/csv_to_oscal_cd.py
1449 1450 1451 1452 |
|
is_column_name_parameter(name)
staticmethod
¤
Is column name parameter.
Source code in trestle/tasks/csv_to_oscal_cd.py
1454 1455 1456 1457 1458 1459 1460 |
|
is_column_name_required(name)
staticmethod
¤
Is column name required.
Source code in trestle/tasks/csv_to_oscal_cd.py
1444 1445 1446 1447 |
|
CsvToOscalComponentDefinition
¤
Bases: TaskBase
Task to create OSCAL ComponentDefinition json.
Attributes:
Name | Type | Description |
---|---|---|
name |
Name of the task. |
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
Attributes¤
name = 'csv-to-oscal-cd'
class-attribute
instance-attribute
¤
Functions¤
__init__(config_object)
¤
Initialize trestle task csv-to-oscal-cd.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_object
|
Optional[SectionProxy]
|
Config section associated with the task. |
required |
Source code in trestle/tasks/csv_to_oscal_cd.py
179 180 181 182 183 184 185 186 |
|
configure()
¤
Configure.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
control_mappings_add(add_control_mappings)
¤
Control mappings add.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
control_mappings_del(del_control_mappings)
¤
Control mappings delete.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
execute()
¤
Provide an executed outcome.
Source code in trestle/tasks/csv_to_oscal_cd.py
326 327 328 329 330 331 332 |
|
get_class(name)
¤
Get class value for specified name from config.
Source code in trestle/tasks/csv_to_oscal_cd.py
317 318 319 320 |
|
print_info()
¤
Print the help string.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
rules_add(add_rules)
¤
Add rules.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
rules_del(del_rules)
¤
Delete rules.
Source code in trestle/tasks/csv_to_oscal_cd.py
479 480 481 482 483 484 485 486 487 488 489 |
|
rules_mod(mod_rules)
¤
Modify rules.
Source code in trestle/tasks/csv_to_oscal_cd.py
762 763 764 765 766 767 768 769 770 771 |
|
set_params_add(add_set_params)
¤
Set parameters add.
Source code in trestle/tasks/csv_to_oscal_cd.py
819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 |
|
set_params_del(del_set_params)
¤
Set parameters delete.
Source code in trestle/tasks/csv_to_oscal_cd.py
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 |
|
set_params_mod(mod_set_params)
¤
Set parameters modify.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
simulate()
¤
Provide a simulated outcome.
Source code in trestle/tasks/csv_to_oscal_cd.py
322 323 324 |
|
Functions¤
derive_control_id(control_mapping)
¤
Derive control id.
Source code in trestle/tasks/csv_to_oscal_cd.py
75 76 77 78 |
|
derive_part_id(control_mapping)
¤
Derive part id.
Source code in trestle/tasks/csv_to_oscal_cd.py
81 82 83 84 85 86 87 |
|
etype(target)
¤
Get etype.
Source code in trestle/tasks/csv_to_oscal_cd.py
90 91 92 93 94 95 |
|
is_validation(component_type)
¤
Check for validation component.
Source code in trestle/tasks/csv_to_oscal_cd.py
149 150 151 |
|
row_property_builder(row, name, value, ns, class_, remarks)
¤
Row property builder.
Source code in trestle/tasks/csv_to_oscal_cd.py
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 |
|
synthesize_rule_key(component_title, component_type, rule_id, check_id, target_component)
¤
Synthesize rule_key.
Source code in trestle/tasks/csv_to_oscal_cd.py
154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
handler: python