Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realm import does not include security defenses headers #218

Open
ghost opened this issue Feb 11, 2020 · 9 comments
Open

Realm import does not include security defenses headers #218

ghost opened this issue Feb 11, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Feb 11, 2020

During i write documentation for the security defenses headers of the keycloak_realm resource (#130), i notice that a terraform import does not write any informations from the headers and brute_force_detection block in the terraform statefile. Its seems all settings of the security_defenses are ignored at a terraform import. Creating and updating a realm with the settings works fine.

I cant fix this by myself, because my go-debugger does not work inside the WSL until the WSL2 release.

@tomrutsaert
Copy link
Contributor

I saw that as well, i have added those fields in pr #215, should work once that PR is merged.
(Thx for the documentation update)

@ghost
Copy link
Author

ghost commented Feb 11, 2020

Ah okey great. Thanks for the update as well 👍
I mark this Issue as closed.

@tomrutsaert
Copy link
Contributor

Hey @adresan #215 was merged, Can you check if if this now works for you?

@ghost
Copy link
Author

ghost commented Feb 20, 2020

@tomrutsaert

Seems not to work. The security defenses headers are still comple empty in the statefile after a realm import.

"security_defenses": [],

@ghost ghost reopened this Feb 20, 2020
@tomrutsaert
Copy link
Contributor

Strange.
Is any variable in security defenses in your config different from the default?

@ghost
Copy link
Author

ghost commented Feb 20, 2020

Mhh yes, strange. Their should be no connection between a import of a realm and the defined attributes/variables inside the keycloak_realm resource. If you left security_defenses complete from your .tf file, he should still import the security_defenses inside the statefile if their are set in a keycloak realm - like he does with the smtp settings. But even if i define it with the example from the doc., he still not import it.

I tryed it with the release version and also with a build from source. No difference.

@tomrutsaert
Copy link
Contributor

tomrutsaert commented Feb 20, 2020

First of all I have to correct and excuse myself, The change I did #215 Is a change on data_source_keycloak_realm and that has no influence on keycloak realm resource import.
Thus, my PR will not have fixed this issue.
I was to eager to respond to your issue as it was talking about the exact same fields missing in the data_source_keycloak_realm which I just added a couple minutes before you reported this issue.

Again my excuses for the confusion

@ghost
Copy link
Author

ghost commented Feb 20, 2020

Really no problem. I keep this issue open. If you or somebody else could fix this, i can test it again.

@mrparkers mrparkers added the bug Something isn't working label Feb 25, 2020
@serginhofernandes
Copy link

serginhofernandes commented Jun 22, 2023

I think I had a related issue: I imported the realm, and some time later I changed via Terraform the passwordPolicy. Although the execution plan showed only the passwordPolicy change, after applying, it wiped out all my customizations under Security Defenses (which was not present on the TF file).
No drift was shown before that change, but now I can see on the old terraform statefile that the security_defenses is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants