Skip to content

Commit dfae985

Browse files
StewartWsbkok
authored and
stewwall
committed
Feat/policy refactor (#3)
* Starting refactor of policy application * initial testing * Unit tests for OrganisationPolicy class * Linting * wip * Merging * sìos leis a' Bheurla * Resetting generate params * Fixing spelling mistakes * Updating documentation * Apply suggestions from code review Co-authored-by: Simon Kok <[email protected]> * Update src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organization_policy_campaign.py Co-authored-by: Simon Kok <[email protected]> * Update src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py Co-authored-by: Simon Kok <[email protected]> * Update src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organization_policy_campaign.py Co-authored-by: Simon Kok <[email protected]> * fixing tests * fixing linting * linting again * temp remove assertion * updating logging * running black with ll 80 * linting * Tox no longer complaining --------- Co-authored-by: Simon Kok <[email protected]> Co-authored-by: Simon Kok <[email protected]>
1 parent 51f6936 commit dfae985

15 files changed

+2590
-234
lines changed

docs/admin-guide.md

+61
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,67 @@ Once you have enabled all features within your Organization, ADF can manage and
876876
automate the application and updating process of the Tag Policies. For more
877877
information, see [here](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html).
878878

879+
## Policies V2
880+
881+
### What is Policies V2
882+
883+
A new feature of ADF, that gives you the ability to define a policy in a
884+
single location, and apply it to multiple targets.
885+
886+
### Enabling the new version
887+
888+
Because of the difference in this approach to applying policies, it is not
889+
currently the default method and will have to be enabled. In order to enable it,
890+
you have to update your serverlessrepo stack in the organizational root account
891+
and set the parameter `EnablePolicyV2' to "TRUE". Once the stack has redeployed,
892+
it will be enabled.
893+
894+
### Using the new version
895+
896+
Inside your adf-bootstrap folder, create a directory named `adf-policies`,
897+
Inside the `adf-policies` directory you then create subdirectories per policy type.
898+
Currently, only `scp` and `tagging-policy` are supported in the AWS partition.
899+
Inside this directory you can create a JSON file that defines your policy.
900+
So in the following example, if you wanted to create an scp policy it would be in
901+
`adf-policies/scp/<your-file-name>.json`
902+
Using the following Schema:
903+
904+
```json
905+
{
906+
"Targets": [
907+
"YourOrg", "YourOtherOrg",
908+
],
909+
"Version": "2022-10-14",
910+
"PolicyName": "Example",
911+
"Policy": {
912+
"Version": "2012-10-17",
913+
"Statement": [
914+
{
915+
"Effect": "Deny",
916+
"Action": "cloudtrail:Stop*",
917+
"Resource": "*"
918+
},
919+
{
920+
"Effect": "Allow",
921+
"Action": "*",
922+
"Resource": "*"
923+
},
924+
{
925+
"Effect": "Deny",
926+
"Action": [
927+
"config:DeleteConfigRule",
928+
"config:DeleteConfigurationRecorder",
929+
"config:DeleteDeliveryChannel",
930+
"config:Stop*"
931+
],
932+
"Resource": "*"
933+
}
934+
]
935+
}
936+
}
937+
938+
```
939+
879940
## Integrating Slack
880941

881942
### Integrating with Slack using Lambda

0 commit comments

Comments
 (0)